@livenetworks/ashlar 2.1.2 → 2.1.4
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/index.js +0 -1
- package/components/ln-core/README.md +3 -3
- package/components/ln-core/dom.js +3 -3
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +1 -0
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form-dev.scss +5 -0
- package/components/ln-form/ln-form.schema.json +6 -0
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +1 -0
- package/components/ln-sort/README.md +4 -0
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/src/ln-sort.js +8 -5
- package/components/ln-table/ln-table.js +1 -1
- package/ln-ashlar.html-data.json +1 -2
- package/package.json +1 -1
- package/theme/components/_form.scss +6 -0
- package/theme/config/mixins/_form.scss +6 -0
- package/theme/ln-ashlar-dev.scss +0 -1
- package/web-types.json +3 -3
- package/components/ln-autoresize/README.md +0 -129
- package/components/ln-autoresize/ln-autoresize-dev.scss +0 -8
- package/components/ln-autoresize/ln-autoresize.js +0 -1
- package/components/ln-autoresize/ln-autoresize.schema.json +0 -22
- package/components/ln-autoresize/src/ln-autoresize.js +0 -56
package/components/index.js
CHANGED
|
@@ -63,7 +63,6 @@ import './ln-picklist/src/ln-picklist.js';
|
|
|
63
63
|
import './ln-confirm/src/ln-confirm.js';
|
|
64
64
|
import './ln-translations/src/ln-translations.js';
|
|
65
65
|
import './ln-autosave/src/ln-autosave.js';
|
|
66
|
-
import './ln-autoresize/src/ln-autoresize.js';
|
|
67
66
|
import './ln-editor/src/ln-editor.js';
|
|
68
67
|
import './ln-fill/src/ln-fill.js';
|
|
69
68
|
import './ln-slug/src/ln-slug.js';
|
|
@@ -339,14 +339,14 @@ Read the raw machine value behind a formatted cell/item display. The single
|
|
|
339
339
|
read path for value-based sort/filter across components.
|
|
340
340
|
|
|
341
341
|
```js
|
|
342
|
-
const raw = readValue(td); // '1250.50' from data-ln-value, datetime on <time>,
|
|
342
|
+
const raw = readValue(td); // '42' from value on <data>, '1250.50' from data-ln-value, datetime on <time>, else trimmed text
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
+
- Returns `value` attribute value if the element has it (native machine value on `<data>`, `<input>`, `<time>`, etc.).
|
|
345
346
|
- Returns `data-ln-value` attribute value if the element has it.
|
|
346
347
|
- Returns `datetime` attribute if the element is `<time>` and has it.
|
|
347
|
-
- Returns `value` attribute if the element is `<data>` and has it.
|
|
348
348
|
- Otherwise falls back to `el.textContent.trim()`.
|
|
349
|
-
- Used by `ln-table` for sort/filter.
|
|
349
|
+
- Used by `ln-table` and `ln-sort` for sort/filter.
|
|
350
350
|
|
|
351
351
|
### registerComponent(selector, attribute, ComponentFn, componentTag, options)
|
|
352
352
|
|
|
@@ -102,14 +102,14 @@ export function shouldInterceptLink(event, anchor) {
|
|
|
102
102
|
* Single read path for value-based sort/filter across components.
|
|
103
103
|
*/
|
|
104
104
|
export function readValue(el) {
|
|
105
|
+
if (el.hasAttribute('value')) {
|
|
106
|
+
return el.getAttribute('value');
|
|
107
|
+
}
|
|
105
108
|
if (el.hasAttribute('data-ln-value')) {
|
|
106
109
|
return el.getAttribute('data-ln-value');
|
|
107
110
|
}
|
|
108
111
|
if (el.tagName === 'TIME' && el.hasAttribute('datetime')) {
|
|
109
112
|
return el.getAttribute('datetime');
|
|
110
113
|
}
|
|
111
|
-
if (el.tagName === 'DATA' && el.hasAttribute('value')) {
|
|
112
|
-
return el.getAttribute('value');
|
|
113
|
-
}
|
|
114
114
|
return el.textContent.trim();
|
|
115
115
|
}
|
|
@@ -1 +1 @@
|
|
|
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 R(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(!R(i))return}e.apply(console,t)}}function Q(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function N(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){N(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&o[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);o[r.name]=r.value===""||isNaN(u)?null:u}else o[r.name]=r.value}return o}function we(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 n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[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 r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(r).split(",").map(function(p){return p.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=we(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}function be(e,t,{get:n,set:i}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){i?i.call(this,o,s=>t.set.call(this,s)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=me);const Y={};function ye(e,t){Y[e]=t}function Ce(e){return Y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=Ce);function F(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 J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,N(function(){new MutationObserver(function(){Q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function O(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=G,window.lnCore.getLocaleFallback=O,window.lnCore.ensureLocaleObserver=J);const B={};function _e(e,t){B[e]||(B[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=B[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(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],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const d=p[0].trim(),a=p[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const d=p[0].trim(),a=p[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function ve(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 i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[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)X(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 Z(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 i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ae(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],p=u.getAttribute("data-ln-render-key");p&&(l[p]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],p=String(i(u));let d=l[p];if(d)o(d,u,r);else{const a=_e(n,s);if(!a||(Z(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",p),o(d,u,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}function xe(e,t){const n={},i=e.querySelectorAll("["+t+"]");for(let o=0;o<i.length;o++)n[i[o].getAttribute(t)]=i[o].textContent,i[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Z,window.lnCore.fill=X,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function q(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function ee(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function te(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function ne(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function re(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return $.set(n,o),o}function oe(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function ie(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function le(e,t,n,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.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 r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} 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(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Se(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=re(i.values,i.fallback);break;case"integer":o=ee;break;case"float":o=oe;break;case"boolean":o=te;break;case"list":o=ne;break;case"json":o=ie;break;case"string":default:o=q;break}o||(o=q),t[i.prop]=[o,n,i.fallback]}return t}function Ee(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=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 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=Se,window.lnCore.attrSpec=ke,window.lnCore.attrStr=q,window.lnCore.attrInt=ee,window.lnCore.attrBool=te,window.lnCore.attrList=ne,window.lnCore.attrEnum=re,window.lnCore.attrFloat=oe,window.lnCore.attrJson=ie);function T(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 se(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&T(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)T(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(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 ae(){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=ae(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[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(s=>s.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 ce(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function Me(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=ae(),o=i.byAttr.get(t),s=K()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&R(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)le(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&ce(c,l,t,e.oldValue),i.reactiveWildcard.length&&ce(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(se(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Me(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].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 j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function P(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Fe(e){const t=V();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=j();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],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 o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&T(s,r);else if(s.matches&&s.matches(r.query)&&T(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let p=0;p<u.length;p++)T(u[p],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&P(s,r);else if(s.matches&&s.matches(u)&&P(s,r),s.querySelectorAll){const p=s.querySelectorAll(u);for(let d=0;d<p.length;d++)P(p[d],r)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{Fe(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ie(e){V().push(e),e.onSubtreeChange&&e.query&&j().push(e),ue()}function de(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,u=o.onAttrChange||null,p=o.effects||null,d=o.attributes||null,a=d?Ee(d):p,f=d?new Set(Object.keys(d)):null,h=o.persist||null;function g(m){const w=m||document.body;if(se(w,e,t,n),d&&K())for(const b in d){const A=d[b],x=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&x.push(w);for(let k=0;k<x.length;k++){const M=x[k];R(M)&&le(A,M.getAttribute(b),b,i,M)}}r&&r(w)}const C=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let w;for(;(w=m.exec(e))!==null;)C.push(w[1])}else C.push(e);Le({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:n,onInit:r,observed:C.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:f,persist:h}),Ne();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,_=o.subtreeQuery||(y?e:"["+e+"]"),S={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:_};V().push(S),c&&_&&j().push(S),ue(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=Ie);function D(){Oe()>0?Te(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",D):D(),g}function fe(e){return(e||"").replace(/^#/,"")}function H(e){const t=e===void 0?location.hash:e,n={},i=fe(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Re(e){if(!e)return null;const t=H();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=H();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");fe(location.hash)!==o&&(location.hash=o)}function qe(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.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 Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(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 Pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function He(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=H,window.lnCore.hashGet=Re,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=$e,window.lnCore.hashSortEncode=Ve,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=Pe,window.lnCore.hashFilterDecode=He);function We(){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=We);function v(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,i=new Date(n);return isNaN(i.getTime())?null:i}if(typeof e=="string"){const n=e.trim();if(!n)return null;const i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(i){const s=+i[1],l=+i[2],c=+i[3],r=new Date(s,l-1,c);return r.getFullYear()!==s||r.getMonth()!==l-1||r.getDate()!==c?null:r}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function E(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return t+"-"+n+"-"+i}const W=/^(short|medium|long)(\s+datetime)?$/,Ue={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function Ke(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(W)?Ue[e.trim()]:null}function L(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let n,i;if(t.indexOf(".")!==-1)n=".",i=t.split(".");else if(t.indexOf("/")!==-1)n="/",i=t.split("/");else if(t.indexOf("-")!==-1)n="-",i=t.split("-");else return null;if(i.length!==3)return null;const o=[];for(let u=0;u<3;u++){const p=parseInt(i[u],10);if(isNaN(p))return null;o.push(p)}let s,l,c;n==="."?(s=o[0],l=o[1],c=o[2]):n==="/"?(l=o[0],s=o[1],c=o[2]):i[0].length===4?(c=o[0],l=o[1],s=o[2]):(s=o[0],l=o[1],c=o[2]),c<100&&(c+=c<50?2e3:1900);const r=new Date(c,l-1,s);return r.getFullYear()!==c||r.getMonth()!==l-1||r.getDate()!==s?null:r}function U(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const o=e.getDate(),s=e.getMonth(),l=e.getFullYear(),c=e.getHours(),r=e.getMinutes();let u,p;const d=(n||"").toLowerCase().split("-")[0];let a=!1;try{const g=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];a=!!(i&&g!==d)}catch{a=!!i}if(a&&i&&i.monthsLong)u=i.monthsLong[s];else try{u=new Intl.DateTimeFormat(n,{month:"long"}).format(e)}catch{u=String(s+1)}if(a&&i&&i.monthsShort)p=i.monthsShort[s];else try{p=new Intl.DateTimeFormat(n,{month:"short"}).format(e)}catch{p=String(s+1)}const f={yyyy:String(l),yy:String(l).slice(-2),MMMM:u,MMM:p,MM:String(s+1).padStart(2,"0"),M:String(s+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(c).padStart(2,"0"),mm:String(r).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(h){return f[h]!==void 0?f[h]:h})}function I(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const o=Ke(t);if(o)try{const s=new Intl.DateTimeFormat(n,o),l=(n||"").toLowerCase().split("-")[0],c=s.resolvedOptions().locale.toLowerCase().split("-")[0];return i&&c!==l?U(e,"dd.MM.yyyy",n,i):s.format(e)}catch{return U(e,"dd.MM.yyyy",n,i)}return U(e,t||"dd.MM.yyyy",n,i)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function n(a){const f=a[t];if(f){if(f.isTextElement)f._initTextElement();else if(f.value){const h=v(f.value);h&&f._displayFormatted(h)}}}const i={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:n,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:n,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:n,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:n,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(a,f,h){Q(a.dom,"ln-date:change",{value:f,formatted:a.dom.value,date:h}),a.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function l(a,f,h,g){a._setHiddenRaw(f),o.set.call(a._picker,f),a._lastISO=f,g!==void 0?(a._isFormatting=!0,a.dom.value=g,a._isFormatting=!1):h&&a._displayFormatted(h),s(a,f,h)}function c(a){a._setHiddenRaw(""),o.set.call(a._picker,""),a._isFormatting=!0,a.dom.value="",a._isFormatting=!1,a._lastISO="",s(a,"",null)}const r=new Set;let u=!1;function p(){J(),!u&&(u=!0,document.addEventListener("ln-core:locale-change",function(){r.forEach(function(a){if(a.isTextElement)a._formatTextContent();else if(a.value){const f=v(a.value);f&&a._displayFormatted(f)}})}))}function d(a){if(a[t])return a[t];if(a[t]=this,this.dom=a,r.add(this),p(),a.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const f=a.value,h=a.name,g=a.closest(".form-element, form")||a.parentNode;if(g){const m=g.querySelectorAll("[data-ln-date-dict]");for(let w=0;w<m.length;w++){const b=m[w].getAttribute("data-ln-date-dict");if(b){const A=xe(m[w],"data-ln-date-dict-key");A["months-long"]&&(A.monthsLong=A["months-long"].split(",").map(x=>x.trim())),A["months-short"]&&(A.monthsShort=A["months-short"].split(",").map(x=>x.trim())),G(b,A)}}}const C=document.createElement("span");C.setAttribute("data-ln-date-field",""),a.parentNode.insertBefore(C,a),C.appendChild(a),this._wrapper=C;const y=document.createElement("input");y.type="hidden",y.name=h,a.removeAttribute("name"),a.hasAttribute("data-ln-fill-as")&&y.setAttribute("data-ln-fill-as",a.getAttribute("data-ln-fill-as")),a.insertAdjacentElement("afterend",y),this._hidden=y;const _=document.createElement("input");_.type="date",_.tabIndex=-1,_.setAttribute("tabindex","-1"),_.setAttribute("aria-hidden","true"),_.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Date picker"),_.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",y.insertAdjacentElement("afterend",_),this._picker=_,a.type="text";const S=document.createElement("button");S.type="button",S.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Open date picker"),S.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',_.insertAdjacentElement("afterend",S),this._btn=S,this._lastISO="",Object.defineProperty(y,"value",{get:function(){return o.get.call(y)},set:function(m){if(o.set.call(y,m),m&&m!==""){const w=v(m);w&&l(self,m,w)}else m===""&&c(self)}}),be(a,o,{get:function(){return o.get.call(a)},set:function(m,w){if(self._isFormatting){w(m);return}if(!m||m===""){w(""),c(self);return}const b=v(m)||L(m);if(b){const A=E(b),x=a.getAttribute(e)||"",k=F(a),M=O(k),he=I(b,x,k,M);w(he),l(self,A,b,he)}else w(String(m)),c(self)}}),this._onPickerChange=function(){const m=_.value;if(m){const w=v(m);w&&l(self,m,w)}else c(self)},_.addEventListener("change",this._onPickerChange),this._onBlur=function(){const m=self.dom.value.trim();if(m===""){self._lastISO!==""&&c(self);return}if(self._lastISO){const b=v(self._lastISO);if(b){const A=self.dom.getAttribute(e)||"",x=F(self.dom),k=O(x);if(m===I(b,A,x,k))return}}const w=L(m);if(w){const b=E(w);l(self,b,w)}else if(self._lastISO){const b=v(self._lastISO);b&&self._displayFormatted(b)}else self.dom.value=""},a.addEventListener("blur",this._onBlur),this._onBtnClick=function(){self._openPicker()},S.addEventListener("click",this._onBtnClick);const D=a.form;if(D&&(this._form=D,this._onFormReset=function(){setTimeout(function(){const m=self.dom.value;if(m){const w=v(m)||L(m);if(w){const b=E(w);l(self,b,w);return}}c(self)},0)},D.addEventListener("reset",this._onFormReset)),f&&f!==""){const m=v(f);m&&l(self,f,m)}return this}d.prototype._initTextElement=function(){const a=this.dom,f=a.getAttribute("data-ln-value"),h=a.getAttribute("data-ln-date"),g=a.getAttribute("datetime");let C=null;a.tagName==="TIME"&&g!==null&&g!==""?C=g:f!==null&&f!==""?C=f:g!==null&&g!==""?C=g:h!==null&&h!==""&&h!=="true"&&!W.test(h)?C=h:C=a.textContent.trim();const y=v(C)||L(C);if(y&&!isNaN(y.getTime())){const _=E(y);this._rawValue=_,a.tagName!=="TIME"&&!a.hasAttribute("data-ln-value")&&a.setAttribute("data-ln-value",_),this._formatTextContent()}else this._rawValue=null},d.prototype._formatTextContent=function(){if(this._rawValue){const a=v(this._rawValue);if(a){let h=this.dom.getAttribute("data-ln-date-format");if(!h){const y=this.dom.getAttribute("data-ln-date");y&&W.test(y)&&(h=y)}const g=F(this.dom),C=O(g);this.dom.textContent=I(a,h||"medium",g,C)}}},d.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},d.prototype._setHiddenRaw=function(a){o.set.call(this._hidden,a)},d.prototype._displayFormatted=function(a){const f=this.dom.getAttribute(e)||"",h=F(this.dom),g=O(h);this._isFormatting=!0,this.dom.value=I(a,f,h,g),this._isFormatting=!1},Object.defineProperty(d.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(a){if(this.isTextElement){if(!a||a===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const h=v(a)||L(a);if(!h)return;const g=E(h);this._rawValue=g,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",g):this.dom.setAttribute("data-ln-value",g),this._formatTextContent();return}if(!a||a===""){c(this);return}const f=v(a);f&&l(this,a,f)}}),Object.defineProperty(d.prototype,"date",{get:function(){const a=this.value;return a?v(a):null},set:function(a){if(!a||!(a instanceof Date)||isNaN(a.getTime())){this.value="";return}this.value=E(a)}}),Object.defineProperty(d.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),d.prototype.destroy=function(){if(!this.dom[t])return;if(r.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const a=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",a&&(this.dom.value=a),delete this.dom[t]},de(e,t,d,"ln-date",{attributes:i,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
|
|
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 R(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(!R(i))return}e.apply(console,t)}}function Q(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function N(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){N(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&o[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);o[r.name]=r.value===""||isNaN(u)?null:u}else o[r.name]=r.value}return o}function we(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 n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[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 r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(r).split(",").map(function(p){return p.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=we(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}function be(e,t,{get:n,set:i}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){i?i.call(this,o,s=>t.set.call(this,s)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=me);const Y={};function ye(e,t){Y[e]=t}function Ce(e){return Y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=Ce);function F(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 J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,N(function(){new MutationObserver(function(){Q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function T(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=G,window.lnCore.getLocaleFallback=T,window.lnCore.ensureLocaleObserver=J);const B={};function _e(e,t){B[e]||(B[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=B[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(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],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),a=p[1].trim();t[a]!=null&&c.setAttribute(m,t[a])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),a=p[1].trim();a in t&&c.classList.toggle(m,!!t[a])}}return e}function ve(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 i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[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)X(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 Z(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 i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ae(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],p=u.getAttribute("data-ln-render-key");p&&(l[p]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],p=String(i(u));let m=l[p];if(m)o(m,u,r);else{const a=_e(n,s);if(!a||(Z(a,u),m=a.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",p),o(m,u,r)}c.appendChild(m)}e.textContent="",e.appendChild(c)}function xe(e,t){const n={},i=e.querySelectorAll("["+t+"]");for(let o=0;o<i.length;o++)n[i[o].getAttribute(t)]=i[o].textContent,i[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Z,window.lnCore.fill=X,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function q(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function ee(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function te(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function ne(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function re(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return $.set(n,o),o}function oe(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function ie(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function le(e,t,n,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.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 r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} 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(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Se(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=re(i.values,i.fallback);break;case"integer":o=ee;break;case"float":o=oe;break;case"boolean":o=te;break;case"list":o=ne;break;case"json":o=ie;break;case"string":default:o=q;break}o||(o=q),t[i.prop]=[o,n,i.fallback]}return t}function Ee(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=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 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=Se,window.lnCore.attrSpec=ke,window.lnCore.attrStr=q,window.lnCore.attrInt=ee,window.lnCore.attrBool=te,window.lnCore.attrList=ne,window.lnCore.attrEnum=re,window.lnCore.attrFloat=oe,window.lnCore.attrJson=ie);function L(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 se(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&L(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)L(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(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 ae(){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=ae(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[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(s=>s.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 ce(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function Me(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=ae(),o=i.byAttr.get(t),s=K()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&R(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)le(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&ce(c,l,t,e.oldValue),i.reactiveWildcard.length&&ce(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(se(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Me(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].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 j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function P(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Fe(e){const t=V();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=j();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],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 o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&L(s,r);else if(s.matches&&s.matches(r.query)&&L(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let p=0;p<u.length;p++)L(u[p],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&P(s,r);else if(s.matches&&s.matches(u)&&P(s,r),s.querySelectorAll){const p=s.querySelectorAll(u);for(let m=0;m<p.length;m++)P(p[m],r)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{Fe(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ie(e){V().push(e),e.onSubtreeChange&&e.query&&j().push(e),ue()}function de(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,u=o.onAttrChange||null,p=o.effects||null,m=o.attributes||null,a=m?Ee(m):p,d=m?new Set(Object.keys(m)):null,h=o.persist||null;function g(D){const f=D||document.body;if(se(f,e,t,n),m&&K())for(const w in m){const b=m[w],_=Array.from(f.querySelectorAll("["+w+"]"));f.matches&&f.matches("["+w+"]")&&_.push(f);for(let S=0;S<_.length;S++){const E=_[S];R(E)&&le(b,E.getAttribute(w),w,i,E)}}r&&r(f)}const y=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let f;for(;(f=D.exec(e))!==null;)y.push(f[1])}else y.push(e);Le({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:n,onInit:r,observed:y.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:d,persist:h}),Ne();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(A?e:"["+e+"]"),x={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:C};V().push(x),c&&C&&j().push(x),ue(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=Ie);function k(){Oe()>0?Te(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k(),g}function fe(e){return(e||"").replace(/^#/,"")}function H(e){const t=e===void 0?location.hash:e,n={},i=fe(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Re(e){if(!e)return null;const t=H();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=H();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");fe(location.hash)!==o&&(location.hash=o)}function qe(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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.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 Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(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 Pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function He(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=H,window.lnCore.hashGet=Re,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=$e,window.lnCore.hashSortEncode=Ve,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=Pe,window.lnCore.hashFilterDecode=He);function We(){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=We);function v(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,i=new Date(n);return isNaN(i.getTime())?null:i}if(typeof e=="string"){const n=e.trim();if(!n)return null;const i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(i){const s=+i[1],l=+i[2],c=+i[3],r=new Date(s,l-1,c);return r.getFullYear()!==s||r.getMonth()!==l-1||r.getDate()!==c?null:r}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function O(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return t+"-"+n+"-"+i}const W=/^(short|medium|long)(\s+datetime)?$/,Ue={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function Ke(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(W)?Ue[e.trim()]:null}function M(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let n,i;if(t.indexOf(".")!==-1)n=".",i=t.split(".");else if(t.indexOf("/")!==-1)n="/",i=t.split("/");else if(t.indexOf("-")!==-1)n="-",i=t.split("-");else return null;if(i.length!==3)return null;const o=[];for(let u=0;u<3;u++){const p=parseInt(i[u],10);if(isNaN(p))return null;o.push(p)}let s,l,c;n==="."?(s=o[0],l=o[1],c=o[2]):n==="/"?(l=o[0],s=o[1],c=o[2]):i[0].length===4?(c=o[0],l=o[1],s=o[2]):(s=o[0],l=o[1],c=o[2]),c<100&&(c+=c<50?2e3:1900);const r=new Date(c,l-1,s);return r.getFullYear()!==c||r.getMonth()!==l-1||r.getDate()!==s?null:r}function U(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const o=e.getDate(),s=e.getMonth(),l=e.getFullYear(),c=e.getHours(),r=e.getMinutes();let u,p;const m=(n||"").toLowerCase().split("-")[0];let a=!1;try{const g=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];a=!!(i&&g!==m)}catch{a=!!i}if(a&&i&&i.monthsLong)u=i.monthsLong[s];else try{u=new Intl.DateTimeFormat(n,{month:"long"}).format(e)}catch{u=String(s+1)}if(a&&i&&i.monthsShort)p=i.monthsShort[s];else try{p=new Intl.DateTimeFormat(n,{month:"short"}).format(e)}catch{p=String(s+1)}const d={yyyy:String(l),yy:String(l).slice(-2),MMMM:u,MMM:p,MM:String(s+1).padStart(2,"0"),M:String(s+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(c).padStart(2,"0"),mm:String(r).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(h){return d[h]!==void 0?d[h]:h})}function I(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const o=Ke(t);if(o)try{const s=new Intl.DateTimeFormat(n,o),l=(n||"").toLowerCase().split("-")[0],c=s.resolvedOptions().locale.toLowerCase().split("-")[0];return i&&c!==l?U(e,"dd.MM.yyyy",n,i):s.format(e)}catch{return U(e,"dd.MM.yyyy",n,i)}return U(e,t||"dd.MM.yyyy",n,i)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function n(a){const d=a[t];if(d){if(d.isTextElement)d._initTextElement();else if(d.value){const h=v(d.value);h&&d._displayFormatted(h)}}}const i={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:n,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:n,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:n,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:n,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(a,d,h){Q(a.dom,"ln-date:change",{value:d,formatted:a.dom.value,date:h}),a.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function l(a,d,h,g){a._setHiddenRaw(d),o.set.call(a._picker,d),a._lastISO=d,g!==void 0?(a._isFormatting=!0,a.dom.value=g,a._isFormatting=!1):h&&a._displayFormatted(h),s(a,d,h)}function c(a){a._setHiddenRaw(""),o.set.call(a._picker,""),a._isFormatting=!0,a.dom.value="",a._isFormatting=!1,a._lastISO="",s(a,"",null)}const r=new Set;let u=!1;function p(){J(),!u&&(u=!0,document.addEventListener("ln-core:locale-change",function(){r.forEach(function(a){if(a.isTextElement)a._formatTextContent();else if(a.value){const d=v(a.value);d&&a._displayFormatted(d)}})}))}function m(a){if(a[t])return a[t];a[t]=this,this.dom=a;const d=this;if(r.add(this),p(),a.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const h=a.value,g=a.name,y=a.closest(".form-element, form")||a.parentNode;if(y){const f=y.querySelectorAll("[data-ln-date-dict]");for(let w=0;w<f.length;w++){const b=f[w].getAttribute("data-ln-date-dict");if(b){const _=xe(f[w],"data-ln-date-dict-key");_["months-long"]&&(_.monthsLong=_["months-long"].split(",").map(S=>S.trim())),_["months-short"]&&(_.monthsShort=_["months-short"].split(",").map(S=>S.trim())),G(b,_)}}}const A=document.createElement("span");A.setAttribute("data-ln-date-field",""),a.parentNode.insertBefore(A,a),A.appendChild(a),this._wrapper=A;const C=document.createElement("input");C.type="hidden",C.name=g,a.removeAttribute("name"),a.hasAttribute("data-ln-fill-as")&&C.setAttribute("data-ln-fill-as",a.getAttribute("data-ln-fill-as")),a.insertAdjacentElement("afterend",C),this._hidden=C;const x=document.createElement("input");x.type="date",x.tabIndex=-1,x.setAttribute("tabindex","-1"),x.setAttribute("aria-hidden","true"),x.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Date picker"),x.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",C.insertAdjacentElement("afterend",x),this._picker=x,a.type="text";const k=document.createElement("button");k.type="button",k.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Open date picker"),k.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',x.insertAdjacentElement("afterend",k),this._btn=k,this._lastISO="",Object.defineProperty(C,"value",{get:function(){return o.get.call(C)},set:function(f){if(o.set.call(C,f),f&&f!==""){const w=v(f);w&&l(d,f,w)}else f===""&&c(d)}}),be(a,o,{get:function(){return o.get.call(a)},set:function(f,w){if(d._isFormatting){w(f);return}if(!f||f===""){w(""),c(d);return}const b=v(f)||M(f);if(b){const _=O(b),S=a.getAttribute(e)||"",E=F(a),Qe=T(E),he=I(b,S,E,Qe);w(he),l(d,_,b,he)}else w(String(f)),c(d)}}),this._onPickerChange=function(){const f=x.value;if(f){const w=v(f);w&&l(d,f,w)}else c(d)},x.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=d.dom.value.trim();if(f===""){d._lastISO!==""&&c(d);return}if(d._lastISO){const b=v(d._lastISO);if(b){const _=d.dom.getAttribute(e)||"",S=F(d.dom),E=T(S);if(f===I(b,_,S,E))return}}const w=M(f);if(w){const b=O(w);l(d,b,w)}else if(d._lastISO){const b=v(d._lastISO);b&&d._displayFormatted(b)}else d.dom.value=""},a.addEventListener("blur",this._onBlur),this._onBtnClick=function(){d._openPicker()},k.addEventListener("click",this._onBtnClick);const D=a.form;if(D&&(this._form=D,this._onFormReset=function(){setTimeout(function(){const f=d.dom.value;if(f){const w=v(f)||M(f);if(w){const b=O(w);l(d,b,w);return}}c(d)},0)},D.addEventListener("reset",this._onFormReset)),h&&h!==""){const f=v(h);f&&l(d,h,f)}return this}m.prototype._initTextElement=function(){const a=this.dom,d=a.getAttribute("data-ln-value"),h=a.getAttribute("data-ln-date"),g=a.getAttribute("datetime");let y=null;a.tagName==="TIME"&&g!==null&&g!==""?y=g:d!==null&&d!==""?y=d:g!==null&&g!==""?y=g:h!==null&&h!==""&&h!=="true"&&!W.test(h)?y=h:y=a.textContent.trim();const A=v(y)||M(y);if(A&&!isNaN(A.getTime())){const C=O(A);this._rawValue=C,a.tagName!=="TIME"&&!a.hasAttribute("data-ln-value")&&a.setAttribute("data-ln-value",C),this._formatTextContent()}else this._rawValue=null},m.prototype._formatTextContent=function(){if(this._rawValue){const a=v(this._rawValue);if(a){let h=this.dom.getAttribute("data-ln-date-format");if(!h){const A=this.dom.getAttribute("data-ln-date");A&&W.test(A)&&(h=A)}const g=F(this.dom),y=T(g);this.dom.textContent=I(a,h||"medium",g,y)}}},m.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},m.prototype._setHiddenRaw=function(a){o.set.call(this._hidden,a)},m.prototype._displayFormatted=function(a){const d=this.dom.getAttribute(e)||"",h=F(this.dom),g=T(h);this._isFormatting=!0,this.dom.value=I(a,d,h,g),this._isFormatting=!1},Object.defineProperty(m.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(a){if(this.isTextElement){if(!a||a===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const h=v(a)||M(a);if(!h)return;const g=O(h);this._rawValue=g,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",g):this.dom.setAttribute("data-ln-value",g),this._formatTextContent();return}if(!a||a===""){c(this);return}const d=v(a);d&&l(this,a,d)}}),Object.defineProperty(m.prototype,"date",{get:function(){const a=this.value;return a?v(a):null},set:function(a){if(!a||!(a instanceof Date)||isNaN(a.getTime())){this.value="";return}this.value=O(a)}}),Object.defineProperty(m.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),m.prototype.destroy=function(){if(!this.dom[t])return;if(r.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const a=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",a&&(this.dom.value=a),delete this.dom[t]},de(e,t,m,"ln-date",{attributes:i,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function P(){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 B(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 l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!B(l))return}e.apply(console,t)}}function L(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function ke(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(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 _e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Se(e,t){const n=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(l&&r.matches&&r.matches(l)))if(r.type==="checkbox")n&&i[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&o[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);o[r.name]=r.value===""||isNaN(d)?null:d}else o[r.name]=r.value}return o}function xe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ie(e,t){const n=e.elements,l=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(r).split(",").map(function(y){return y.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=xe(r);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<i.options.length;d++)i.options[d].selected=r.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ie,window.lnCore.serializeForm=Se,window.lnCore.resolveFormMethod=_e);const G={};function Ee(e,t){G[e]=t}function Te(e){return G[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ee,window.lnCore.getDataMapper=Te);function qe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function Re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Le,window.lnCore.getLocaleFallback=Re,window.lnCore.ensureLocaleObserver=qe);const M={};function Oe(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();t[v]!=null&&a.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();v in t&&a.classList.toggle(m,!!t[v])}}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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<n.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[l],t??null),n[l].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)X(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 Y(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(i,a){return t[a]!==void 0?t[a]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Fe(e,t,n,l,o,s){const i={};for(let r=0;r<e.children.length;r++){const d=e.children[r],y=d.getAttribute("data-ln-render-key");y&&(i[y]=d)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],y=String(l(d));let m=i[y];if(m)o(m,d,r);else{const v=Oe(n,s);if(!v||(Y(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),o(m,d,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=De,window.lnCore.renderList=Fe);function O(e,t,n){const l=e.getAttribute(t);return l===null?n:l}function Z(e,t,n){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?n:l}function ee(e,t,n=!1){const l=e.getAttribute(t);if(l===null)return!!n;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const l=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&l.has(a)?a:t};return $.set(n,o),o}function re(e,t,n){const l=parseFloat(e.getAttribute(t));return isNaN(l)?n:l}function oe(e,t,n){const l=e.getAttribute(t);if(!l)return n;try{return JSON.parse(l)}catch{return n}}function ie(e,t,n,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{o?console.warn(r,o):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const l in n){const[o,s,i]=n[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const l=e[n];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=ne(l.values,l.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=O;break}o||(o=O),t[l.prop]=[o,n,l.fallback]}return t}function Ne(e){const t={};for(const n in e){const l=e[n];l&&l.effect&&(t[n]=l.effect)}return Object.keys(t).length?t:null}function Be(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=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=O,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function E(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 ae(e,t,n,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:l};if(e.matches&&e.matches(s)&&E(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)E(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 ce(){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 $e(e){const t=ce(),n=e.observed||[];for(let l=0;l<n.length;l++){const o=n[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Be(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ue(e,t,n,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,l):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,l)}}function He(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,l=ce(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&B(i)){const a=l.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let d=0;d<a.length;d++)ie(a[d].spec,r,t,a[d].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=l.byReactive.get(t);a&&ue(a,i,t,e.oldValue),l.reactiveWildcard.length&&ue(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const r=o[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{He(t[n])}catch(l){console.error("[ln-core] mutation handler failed",t[n].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function V(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ve(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=j();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let y=0;y<d.length;y++)E(d[y],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d){if(!i)s.matches&&s.matches(d)&&V(s,r);else if(s.matches&&s.matches(d)&&V(s,r),s.querySelectorAll){const y=s.querySelectorAll(d);for(let m=0;m<y.length;m++)V(y[m],r)}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const l=t[n];if(l.type==="childList")try{Ve(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function We(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),de()}function fe(e,t,n,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,r=o.onInit||null,d=o.onAttrChange||null,y=o.effects||null,m=o.attributes||null,v=m?Ne(m):y,k=m?new Set(Object.keys(m)):null,q=o.persist||null;function S(f){const c=f||document.body;if(ae(c,e,t,n),m&&P())for(const g in m){const w=m[g],h=Array.from(c.querySelectorAll("["+g+"]"));c.matches&&c.matches("["+g+"]")&&h.push(c);for(let b=0;b<h.length;b++){const p=h[b];B(p)&&ie(w,p.getAttribute(g),g,l,p)}}r&&r(c)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let c;for(;(c=f.exec(e))!==null;)x.push(c[1])}else x.push(e);$e({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:k,persist:q}),je();const Q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,F=o.subtreeQuery||(Q?e:"["+e+"]"),I={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:F};H().push(I),a&&F&&j().push(I),de(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=We);function u(){Me()>0?T(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),S}function he(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ge(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},l=ge(t);if(!l)return n;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,d=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function U(e){if(!e)return null;const t=W();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ge(location.hash)!==o&&(location.hash=o)}function Ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function D(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Qe(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 K(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=U,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=Ue,window.lnCore.resolveHashNamespace=D,window.lnCore.hashSortEncode=Ke,window.lnCore.hashSortDecode=Qe,window.lnCore.hashFilterEncode=be,window.lnCore.hashFilterDecode=K);function Pe(){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=Pe);function pe(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let l=0;l<t.length;l++)if(String(t[l]).trim().toLowerCase()===n)return!0;return!1}function Je(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Ge(e,t,n){if(!t||typeof t!="object")return!0;const l=Object.keys(t);if(l.length===0)return!0;for(let o=0;o<l.length;o++){const s=t[l[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!pe(i,s.values))return!1}return!0}function ye(e,t,n,l){if(l!=null&&!isNaN(l))return parseInt(l,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const r=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let r=0;r<o.length;r++){const d=o[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let i=0;i<o.length;i++){const a=o[i],d=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(y&&y===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function ze(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let l=0;l<e.length;l++){const o=e[l];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function me(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",l="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",r="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},v=se(m);function k(u){return u.hasAttribute(s)||!u.getAttribute(l)}function q(u){const f=u.dom.querySelectorAll("["+n+"]"),c=[];for(let w=0;w<f.length;w++){const h=f[w];c.push({key:h.getAttribute(n),value:h.getAttribute(l)||"",checked:h.checked,isReset:k(h)})}const g=ze(c);return{key:g.key,values:g.values,targetId:u.targetId}}function S(u,f,c){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const b=g[h];k(b)?b.checked=!w:w&&b.getAttribute(n)===f&&c.indexOf(b.getAttribute(l))!==-1?b.checked=!0:b.checked=!1}}function x(u){this.dom=u,le(this,u,v);const f=u.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=D(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=he(function(){c._render()});this._queueRender=g;const w=he(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=w;function h(){if(!c.targetId)return;const p=document.getElementById(c.targetId);p&&!p.hasAttribute(d)&&p.setAttribute(d,c.targetId)}this._ensureTargetMarked=h,h(),T(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const p=U(c.nsKey),C=K(p);C&&C.key&&C.values.length>0?S(c.dom,C.key,C.values):S(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const p=U(this.nsKey),C=K(p);C&&C.key&&C.values.length>0&&(S(u,C.key,C.values),T(function(){c._destroyed||c._render()}),b=!0)}if(!b){const p=me(u.getAttribute(r));if(p.length>0){const C=u.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(u,_,p),T(function(){c._destroyed||c._render()}),b=!0)}}if(!b){const p=u.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!k(p[C])){T(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const c=f.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(k(c)){for(let w=0;w<g.length;w++)k(g[w])||(g[w].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!1);let w=!1;for(let h=0;h<g.length;h++)if(k(g[h])){w=!0;break}if(w){let h=!0;for(let b=0;b<g.length;b++)if(!k(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)k(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let h=0;h<g.length;h++)if(!k(g[h])&&g[h].checked){w=!0;break}if(!w)for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,f=q(this),c=this._lastSnapshot;if(!(!c||c.key!==f.key||Je(c.values,f.values)))return;f.key===null||f.values.length;const w=document.getElementById(u.targetId),h={key:f.key,values:f.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let b=!1;w&&w!==u.dom&&ke(w,"ln-filter:change",h).defaultPrevented&&(b=!0);const p=c&&c.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:u.targetId};L(u.dom,"ln-filter:reset",A),w&&w!==u.dom&&L(w,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=Xe(f.values);if(_?this.dom.setAttribute(r,_):this.dom.removeAttribute(r),this.hashEnabled){const A=be(f.key,f.values);we(this.nsKey,A)}b||u._applyDomFilter(w)},x.prototype._applyDomFilter=function(u){const f=u||document.getElementById(this.targetId);if(!f)return;const c=q(this),g=c.key===null||c.values.length===0,w=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(w)this._filterTableRows(c,w);else{const h=f.children;for(let b=0;b<h.length;b++){const p=h[b],C=g?null:p.getAttribute("data-"+c.key),_=!g&&C!==null&&!pe(C,c.values),A=p.hasAttribute(o);_&&!A?p.setAttribute(o,"true"):!_&&A&&p.removeAttribute(o)}}};function Q(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return J(f||u)}function F(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,f){if(!f){const p=document.getElementById(this.targetId);if(!p||(f=p.tagName==="TABLE"?p:p.querySelector?p.querySelector("table"):null,!f))return}const c=ye(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),w=u.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&w.length>0?h[g]={col:c,values:w.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let p=0;p<b.length;p++){const C=b[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(F(A))continue;const Ce={};for(let N=0;N<A.cells.length;N++)Ce[N]=Q(A.cells[N]);const Ae=!Ge(Ce,h,A),ve=A.hasAttribute(o);Ae&&!ve?A.setAttribute(o,"true"):!Ae&&ve&&A.removeAttribute(o)}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&y.has(f)){const c=y.get(f),g=ye(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&c[w]&&(delete c[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(c).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,f){const c=u[t];if(!(!c||c._destroyed))if(f===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=D(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(f===r){const g=me(u.getAttribute(r)),w=u.querySelector("["+n+"]"),h=w?w.getAttribute(n):null;h&&(S(u,h,g),c._render())}else f===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}fe(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(u,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(d)?(g=u,c=u.getAttribute(d)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const w=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<w.length;h++){const b=w[h][t];b&&!b._destroyed&&q(b).values.length>0&&b._queueDomFilter()}},persist:{attr:r,hashActive:function(u){return!!D(u,"filter")}}})})()})();
|
|
1
|
+
(function(){"use strict";function P(){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 B(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 l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!B(l))return}e.apply(console,t)}}function L(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function ke(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function _e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Se(e,t){const n=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(l&&r.matches&&r.matches(l)))if(r.type==="checkbox")n&&i[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&o[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);o[r.name]=r.value===""||isNaN(d)?null:d}else o[r.name]=r.value}return o}function xe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ie(e,t){const n=e.elements,l=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(r).split(",").map(function(y){return y.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=xe(r);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<i.options.length;d++)i.options[d].selected=r.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ie,window.lnCore.serializeForm=Se,window.lnCore.resolveFormMethod=_e);const G={};function Ee(e,t){G[e]=t}function Te(e){return G[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ee,window.lnCore.getDataMapper=Te);function qe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function Re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Le,window.lnCore.getLocaleFallback=Re,window.lnCore.ensureLocaleObserver=qe);const M={};function Oe(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();t[v]!=null&&a.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();v in t&&a.classList.toggle(m,!!t[v])}}return e}function Fe(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 l=0;l<n.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[l],t??null),n[l].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)X(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 Y(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(i,a){return t[a]!==void 0?t[a]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function De(e,t,n,l,o,s){const i={};for(let r=0;r<e.children.length;r++){const d=e.children[r],y=d.getAttribute("data-ln-render-key");y&&(i[y]=d)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],y=String(l(d));let m=i[y];if(m)o(m,d,r);else{const v=Oe(n,s);if(!v||(Y(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),o(m,d,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=Fe,window.lnCore.renderList=De);function O(e,t,n){const l=e.getAttribute(t);return l===null?n:l}function Z(e,t,n){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?n:l}function ee(e,t,n=!1){const l=e.getAttribute(t);if(l===null)return!!n;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const l=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&l.has(a)?a:t};return $.set(n,o),o}function re(e,t,n){const l=parseFloat(e.getAttribute(t));return isNaN(l)?n:l}function oe(e,t,n){const l=e.getAttribute(t);if(!l)return n;try{return JSON.parse(l)}catch{return n}}function ie(e,t,n,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{o?console.warn(r,o):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const l in n){const[o,s,i]=n[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const l=e[n];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=ne(l.values,l.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=O;break}o||(o=O),t[l.prop]=[o,n,l.fallback]}return t}function Ne(e){const t={};for(const n in e){const l=e[n];l&&l.effect&&(t[n]=l.effect)}return Object.keys(t).length?t:null}function Be(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=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=O,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function E(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 ae(e,t,n,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:l};if(e.matches&&e.matches(s)&&E(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)E(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 ce(){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 $e(e){const t=ce(),n=e.observed||[];for(let l=0;l<n.length;l++){const o=n[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Be(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ue(e,t,n,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,l):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,l)}}function He(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,l=ce(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&B(i)){const a=l.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let d=0;d<a.length;d++)ie(a[d].spec,r,t,a[d].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=l.byReactive.get(t);a&&ue(a,i,t,e.oldValue),l.reactiveWildcard.length&&ue(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const r=o[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{He(t[n])}catch(l){console.error("[ln-core] mutation handler failed",t[n].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function V(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ve(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=j();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let y=0;y<d.length;y++)E(d[y],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d){if(!i)s.matches&&s.matches(d)&&V(s,r);else if(s.matches&&s.matches(d)&&V(s,r),s.querySelectorAll){const y=s.querySelectorAll(d);for(let m=0;m<y.length;m++)V(y[m],r)}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const l=t[n];if(l.type==="childList")try{Ve(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function We(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),de()}function fe(e,t,n,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,r=o.onInit||null,d=o.onAttrChange||null,y=o.effects||null,m=o.attributes||null,v=m?Ne(m):y,k=m?new Set(Object.keys(m)):null,q=o.persist||null;function S(f){const c=f||document.body;if(ae(c,e,t,n),m&&P())for(const g in m){const w=m[g],h=Array.from(c.querySelectorAll("["+g+"]"));c.matches&&c.matches("["+g+"]")&&h.push(c);for(let b=0;b<h.length;b++){const p=h[b];B(p)&&ie(w,p.getAttribute(g),g,l,p)}}r&&r(c)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let c;for(;(c=f.exec(e))!==null;)x.push(c[1])}else x.push(e);$e({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:k,persist:q}),je();const Q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=o.subtreeQuery||(Q?e:"["+e+"]"),I={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:D};H().push(I),a&&D&&j().push(I),de(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=We);function u(){Me()>0?T(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),S}function he(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ge(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},l=ge(t);if(!l)return n;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,d=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function U(e){if(!e)return null;const t=W();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ge(location.hash)!==o&&(location.hash=o)}function Ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function F(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Qe(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 K(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=U,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=Ue,window.lnCore.resolveHashNamespace=F,window.lnCore.hashSortEncode=Ke,window.lnCore.hashSortDecode=Qe,window.lnCore.hashFilterEncode=be,window.lnCore.hashFilterDecode=K);function Pe(){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=Pe);function pe(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let l=0;l<t.length;l++)if(String(t[l]).trim().toLowerCase()===n)return!0;return!1}function Je(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Ge(e,t,n){if(!t||typeof t!="object")return!0;const l=Object.keys(t);if(l.length===0)return!0;for(let o=0;o<l.length;o++){const s=t[l[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!pe(i,s.values))return!1}return!0}function ye(e,t,n,l){if(l!=null&&!isNaN(l))return parseInt(l,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const r=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let r=0;r<o.length;r++){const d=o[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let i=0;i<o.length;i++){const a=o[i],d=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(y&&y===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function ze(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let l=0;l<e.length;l++){const o=e[l];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function me(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",l="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",r="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},v=se(m);function k(u){return u.hasAttribute(s)||!u.getAttribute(l)}function q(u){const f=u.dom.querySelectorAll("["+n+"]"),c=[];for(let w=0;w<f.length;w++){const h=f[w];c.push({key:h.getAttribute(n),value:h.getAttribute(l)||"",checked:h.checked,isReset:k(h)})}const g=ze(c);return{key:g.key,values:g.values,targetId:u.targetId}}function S(u,f,c){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const b=g[h];k(b)?b.checked=!w:w&&b.getAttribute(n)===f&&c.indexOf(b.getAttribute(l))!==-1?b.checked=!0:b.checked=!1}}function x(u){this.dom=u,le(this,u,v);const f=u.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=F(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=he(function(){c._render()});this._queueRender=g;const w=he(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=w;function h(){if(!c.targetId)return;const p=document.getElementById(c.targetId);p&&!p.hasAttribute(d)&&p.setAttribute(d,c.targetId)}this._ensureTargetMarked=h,h(),T(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const p=U(c.nsKey),C=K(p);C&&C.key&&C.values.length>0?S(c.dom,C.key,C.values):S(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const p=U(this.nsKey),C=K(p);C&&C.key&&C.values.length>0&&(S(u,C.key,C.values),T(function(){c._destroyed||c._render()}),b=!0)}if(!b){const p=me(u.getAttribute(r));if(p.length>0){const C=u.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(u,_,p),T(function(){c._destroyed||c._render()}),b=!0)}}if(!b){const p=u.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!k(p[C])){T(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const c=f.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(k(c)){for(let w=0;w<g.length;w++)k(g[w])||(g[w].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!1);let w=!1;for(let h=0;h<g.length;h++)if(k(g[h])){w=!0;break}if(w){let h=!0;for(let b=0;b<g.length;b++)if(!k(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)k(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let h=0;h<g.length;h++)if(!k(g[h])&&g[h].checked){w=!0;break}if(!w)for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,f=q(this),c=this._lastSnapshot;if(!(!c||c.key!==f.key||Je(c.values,f.values)))return;f.key===null||f.values.length;const w=document.getElementById(u.targetId),h={key:f.key,values:f.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let b=!1;w&&w!==u.dom&&ke(w,"ln-filter:change",h).defaultPrevented&&(b=!0);const p=c&&c.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:u.targetId};L(u.dom,"ln-filter:reset",A),w&&w!==u.dom&&L(w,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=Xe(f.values);if(_?this.dom.setAttribute(r,_):this.dom.removeAttribute(r),this.hashEnabled){const A=be(f.key,f.values);we(this.nsKey,A)}b||u._applyDomFilter(w)},x.prototype._applyDomFilter=function(u){const f=u||document.getElementById(this.targetId);if(!f)return;const c=q(this),g=c.key===null||c.values.length===0,w=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(w)this._filterTableRows(c,w);else{const h=f.children;for(let b=0;b<h.length;b++){const p=h[b],C=g?null:p.getAttribute("data-"+c.key),_=!g&&C!==null&&!pe(C,c.values),A=p.hasAttribute(o);_&&!A?p.setAttribute(o,"true"):!_&&A&&p.removeAttribute(o)}}};function Q(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return J(f||u)}function D(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,f){if(!f){const p=document.getElementById(this.targetId);if(!p||(f=p.tagName==="TABLE"?p:p.querySelector?p.querySelector("table"):null,!f))return}const c=ye(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),w=u.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&w.length>0?h[g]={col:c,values:w.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let p=0;p<b.length;p++){const C=b[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(D(A))continue;const Ce={};for(let N=0;N<A.cells.length;N++)Ce[N]=Q(A.cells[N]);const Ae=!Ge(Ce,h,A),ve=A.hasAttribute(o);Ae&&!ve?A.setAttribute(o,"true"):!Ae&&ve&&A.removeAttribute(o)}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&y.has(f)){const c=y.get(f),g=ye(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&c[w]&&(delete c[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(c).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,f){const c=u[t];if(!(!c||c._destroyed))if(f===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=F(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(f===r){const g=me(u.getAttribute(r)),w=u.querySelector("["+n+"]"),h=w?w.getAttribute(n):null;h&&(S(u,h,g),c._render())}else f===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}fe(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(u,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(d)?(g=u,c=u.getAttribute(d)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const w=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<w.length;h++){const b=w[h][t];b&&!b._destroyed&&q(b).values.length>0&&b._queueDomFilter()}},persist:{attr:r,hashActive:function(u){return!!F(u,"filter")}}})})()})();
|
|
@@ -5,4 +5,9 @@
|
|
|
5
5
|
[data-ln-form]:not(form) {
|
|
6
6
|
@include dev-inline-error("data-ln-form belongs only on <form> elements");
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
// 2. Host Element Check: data-ln-autoresize belongs only on <textarea>
|
|
10
|
+
[data-ln-autoresize]:not(textarea) {
|
|
11
|
+
@include dev-inline-error("data-ln-autoresize belongs only on <textarea> elements");
|
|
12
|
+
}
|
|
8
13
|
}
|