@livenetworks/ashlar 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-accordion/src/ln-accordion.js +1 -0
- package/components/ln-couchdb-connector/README.md +4 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +18 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +15 -6
- package/components/ln-data-store/README.md +3 -2
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/src/data-store-model.js +29 -0
- package/components/ln-data-store/src/ln-data-store.js +57 -10
- package/components/ln-date/README.md +4 -0
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +3 -3
- package/components/ln-fill/README.md +14 -11
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-fill/src/ln-fill.js +0 -6
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +4 -4
- package/components/ln-modal/README.md +33 -14
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-modal/ln-modal.schema.json +8 -1
- package/components/ln-modal/src/ln-modal.js +39 -8
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/src/ln-options.js +1 -0
- package/components/ln-popover/README.md +4 -0
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/src/ln-popover.js +9 -0
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/src/ln-table.js +2 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +3 -3
- package/components/ln-tabs/README.md +2 -2
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/src/ln-tabs.js +1 -0
- package/ln-ashlar.html-data.json +9 -1
- package/package.json +1 -1
- package/web-types.json +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function q(){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 N(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===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 t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<e.length;o++)if(e[o]&&e[o].nodeType===1){r=e[o];break}if(!N(r))return}t.apply(console,e)}}function P(t,e,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function M(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){M(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function Z(t,e,{get:n,set:r}){Object.defineProperty(t,"value",{get:function(){return n?n.call(this):e.get.call(this)},set:function(o){r?r.call(this,o,l=>e.set.call(this,l)):e.set.call(this,o)},configurable:!0})}const j={};function tt(t,e){j[t]=e}function et(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=tt,window.lnCore.getDataMapper=et);function L(t){const e=t?t.closest("[lang]"):null,n=(e?e.getAttribute("lang")||e.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 H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,M(function(){new MutationObserver(function(){P(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function U(t,e){if(!t||typeof e!="object")return;const n=t.toLowerCase().split("-")[0];W[n]=e}function T(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return W[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=U,window.lnCore.getLocaleFallback=T,window.lnCore.ensureLocaleObserver=H);const F={};function nt(t,e){F[t]||(F[t]=document.querySelector('[data-ln-template="'+t+'"]'));const n=F[t];return n?n.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function K(t,e){if(!t||!e)return t;const n=t.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],c=u.getAttribute("data-ln-field");e[c]!=null&&(u.textContent=e[c])}const r=t.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const u=r[s],c=u.getAttribute("data-ln-attr").split(",");for(let i=0;i<c.length;i++){const a=c[i].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),h=a[1].trim();e[h]!=null&&u.setAttribute(d,e[h])}}const o=t.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const u=o[s],c=u.getAttribute("data-ln-show");c in e&&u.classList.toggle("hidden",!e[c])}const l=t.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const u=l[s],c=u.getAttribute("data-ln-class").split(",");for(let i=0;i<c.length;i++){const a=c[i].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),h=a[1].trim();h in e&&u.classList.toggle(d,!!e[h])}}return t}function it(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const n=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],e??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)K(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let n=0;n<e.length;n++)e[n].textContent=""}})));function Y(t,e){if(!t||!e)return t;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return e[u]!==void 0?e[u]:""}))}const r=function(l,s){return e[s]!==void 0?e[s]:""},o=Array.from(t.querySelectorAll("*"));t.nodeType===1&&o.push(t);for(let l=0;l<o.length;l++){const s=o[l],u=s.attributes;for(let c=0;c<u.length;c++){const i=u[c];i.value.indexOf("{{")!==-1&&s.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function rt(t,e,n,r,o,l){const s={};for(let c=0;c<t.children.length;c++){const i=t.children[c],a=i.getAttribute("data-ln-render-key");a&&(s[a]=i)}const u=document.createDocumentFragment();for(let c=0;c<e.length;c++){const i=e[c],a=String(r(i));let d=s[a];if(d)o(d,i,c);else{const h=nt(n,l);if(!h||(Y(h,i),d=h.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),o(d,i,c)}u.appendChild(d)}t.textContent="",t.appendChild(u)}function ot(t,e){const n={},r=t.querySelectorAll("["+e+"]");for(let o=0;o<r.length;o++)n[r[o].getAttribute(e)]=r[o].textContent,r[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=K,window.lnCore.lnFill=it,window.lnCore.renderList=rt);function Q(t,e,n,r,o){if(!t||e===null)return!0;const l=r||"ln-component",s=t.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||e===""&&t.fallback!==void 0)return!0;const u=c=>{o?console.warn(c,o):console.warn(c)};if(s==="boolean"){const c=e.trim().toLowerCase();return c!==""&&c!=="true"&&c!=="false"&&c!=="1"&&c!=="0"?(u(`[${l}] Invalid value "${e}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const c=t.values||[];return c.includes(e)?!0:(u(`[${l}] Invalid value "${e}" for attribute "${n}". Allowed: ${c.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(e))return u(`[${l}] Invalid integer "${e}" for attribute "${n}". Fallback: ${t.fallback}.`),!1;const c=parseInt(e,10);return t.min!==void 0&&c<t.min?(u(`[${l}] Value ${c} for attribute "${n}" is less than min (${t.min}).`),!1):t.max!==void 0&&c>t.max?(u(`[${l}] Value ${c} for attribute "${n}" is greater than max (${t.max}).`),!1):!0}if(s==="float")return isNaN(Number(e))?(u(`[${l}] Invalid float "${e}" for attribute "${n}". Fallback: ${t.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(e),!0}catch(c){return u(`[${l}] Invalid JSON for attribute "${n}": ${c.message}. Fallback: ${t.fallback}.`),!1}return!0}function lt(t){const e={};for(const n in t){const r=t[n];r&&r.effect&&(e[n]=r.effect)}return Object.keys(e).length?e:null}function st(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const n in t.effects)e.add(n);if(t.onAttrChange&&t.declared)for(const n of t.declared)e.add(n);return e}function R(t,e,n,r){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",s=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&s.push(t);for(const u of s)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,e);try{u[n]=new r(u)}catch(c){console.error("["+n+"] init failed",u,c)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function at(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ct(t){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(t):setTimeout(t,0)):t()}function G(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function ut(t){const e=G(),n=t.observed||[];for(let r=0;r<n.length;r++){const o=n[r];e.byAttr.has(o)||e.byAttr.set(o,[]),e.byAttr.get(o).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const o=e.byDeclaredAttr.get(r);o.some(l=>l.componentTag===t.componentTag)||o.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=st(t);if(r===null)e.reactiveWildcard.push(t);else for(const o of r)e.byReactive.has(o)||e.byReactive.set(o,[]),e.byReactive.get(o).push(t)}t.persist&&e.persist.push(t)}function J(t,e,n,r){for(let o=0;o<t.length;o++){const l=t[o];if(!e[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(e,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(e,n,r)}}function dt(t){const e=t.target,n=t.attributeName;if(t.oldValue===e.getAttribute(n))return;const r=G(),o=r.byAttr.get(n);if(q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(e)){const l=r.byDeclaredAttr.get(n),s=e.getAttribute(n);for(let u=0;u<l.length;u++)Q(l[u].spec,s,n,l[u].componentTag,e)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,e,{oldValue:t.oldValue,newValue:e.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&J(l,e,n,t.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,e,n,t.oldValue)}if(o)for(let l=0;l<o.length;l++){const s=o[l];if(s.handler){s.handler(e,n,t.oldValue);continue}s.onAttributeChange&&e[s.attribute]?s.onAttributeChange(e,n):(R(e,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(e))}}function ft(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,M(function(){new MutationObserver(function(e){for(let n=0;n<e.length;n++)try{dt(e[n])}catch(r){console.error("[ln-core] mutation handler failed",e[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ht(t){const e=X();if(e.length){if(t.target)for(let n=0;n<e.length;n++){const r=e[n];if(r.onSubtreeChange){const o=r.query,l=t.target.nodeType===1?t.target.matches(o)?t.target:t.target.closest(o):t.target.parentElement?t.target.parentElement.closest(o):null;l&&r.onSubtreeChange(l,t)}}for(let n=0;n<t.addedNodes.length;n++){const r=t.addedNodes[n];if(r.nodeType===1)for(let o=0;o<e.length;o++){const l=e[o];R(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let n=0;n<t.removedNodes.length;n++){const r=t.removedNodes[n];if(r.nodeType===1)for(let o=0;o<e.length;o++){const l=e[o],s=l.query,u=Array.from(r.querySelectorAll(s));r.matches&&r.matches(s)&&u.push(r);for(let c=0;c<u.length;c++){const i=u[c];if(!document.contains(i)){const a=i[l.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",i,d)}delete i[l.attribute]}}}}}}function mt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,M(function(){new MutationObserver(function(e){for(let n=0;n<e.length;n++){const r=e[n];if(r.type==="childList")try{ht(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function gt(t,e,n,r,o={}){const l=o.extraAttributes||[],s=o.onAttributeChange||null,u=o.onSubtreeChange||null,c=o.onInit||null,i=o.onAttrChange||null,a=o.effects||null,d=o.attributes||null,h=d?lt(d):a,b=d?new Set(Object.keys(d)):null,p=o.persist||null;function w(m){const g=m||document.body;if(R(g,t,e,n),d&&q())for(const y in d){const A=d[y],v=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&v.push(g);for(let D=0;D<v.length;D++){const k=v[D];N(k)&&Q(A,k.getAttribute(y),y,r,k)}}c&&c(g)}const C=[];if(t.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let g;for(;(g=m.exec(t))!==null;)C.push(g[1])}else C.push(t);ut({selector:t,attribute:e,componentTag:r,attributes:d,ComponentFn:n,onInit:c,observed:C.concat(l),onAttributeChange:s,onAttrChange:i,effects:h,declared:b,persist:p}),ft();const O=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";X().push({selector:t,attribute:e,ComponentFn:n,onInit:c,onSubtreeChange:u,query:O}),mt(),window[e]=w;function f(){at()>0?ct(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),w}function z(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,n={},r=z(e);if(!r)return n;const o=r.split("&");for(let l=0;l<o.length;l++){const s=o[l];if(!s)continue;const u=s.indexOf(":"),c=u>-1?s.slice(0,u):s,i=u>-1?s.slice(u+1):"";if(c)try{n[c]=decodeURIComponent(i)}catch{n[c]=i}}return n}function pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function wt(t,e){if(!t)return;const n=$();e==null?delete n[t]:n[t]=String(e);const o=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");z(location.hash)!==o&&(location.hash=o)}function bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function yt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const n=t.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function Ct(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function _t(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function At(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function vt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const n=t.slice(0,e),r=t.slice(e+1),o=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=pt,window.lnCore.hashSet=wt,window.lnCore.hashLinkClick=bt,window.lnCore.resolveHashNamespace=yt,window.lnCore.hashSortEncode=Ct,window.lnCore.hashSortDecode=_t,window.lnCore.hashFilterEncode=At,window.lnCore.hashFilterDecode=vt);function _(t){if(t==null||t==="")return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;const e=Number(t);if(!isNaN(e)&&e>0){const n=e<1e11?e*1e3:e,r=new Date(n);return isNaN(r.getTime())?null:r}if(typeof t=="string"){const n=t.trim();if(!n)return null;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(r){const l=+r[1],s=+r[2],u=+r[3],c=new Date(l,s-1,u);return c.getFullYear()!==l||c.getMonth()!==s-1||c.getDate()!==u?null:c}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function E(t){if(!t||!(t instanceof Date)||isNaN(t.getTime()))return"";const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return e+"-"+n+"-"+r}const B=/^(short|medium|long)(\s+datetime)?$/,St={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 Et(t){return!t||t===""?{dateStyle:"medium"}:String(t).trim().match(B)?St[t.trim()]:null}function x(t){if(!t||typeof t!="string")return null;const e=t.trim();if(e.length<6)return null;let n,r;if(e.indexOf(".")!==-1)n=".",r=e.split(".");else if(e.indexOf("/")!==-1)n="/",r=e.split("/");else if(e.indexOf("-")!==-1)n="-",r=e.split("-");else return null;if(r.length!==3)return null;const o=[];for(let i=0;i<3;i++){const a=parseInt(r[i],10);if(isNaN(a))return null;o.push(a)}let l,s,u;n==="."?(l=o[0],s=o[1],u=o[2]):n==="/"?(s=o[0],l=o[1],u=o[2]):r[0].length===4?(u=o[0],s=o[1],l=o[2]):(l=o[0],s=o[1],u=o[2]),u<100&&(u+=u<50?2e3:1900);const c=new Date(u,s-1,l);return c.getFullYear()!==u||c.getMonth()!==s-1||c.getDate()!==l?null:c}function V(t,e,n,r){if(!t||!(t instanceof Date)||isNaN(t.getTime())||!e||typeof e!="string")return"";const o=t.getDate(),l=t.getMonth(),s=t.getFullYear(),u=t.getHours(),c=t.getMinutes();let i,a;const d=(n||"").toLowerCase().split("-")[0];let h=!1;try{const w=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];h=!!(r&&w!==d)}catch{h=!!r}if(h&&r&&r.monthsLong)i=r.monthsLong[l];else try{i=new Intl.DateTimeFormat(n,{month:"long"}).format(t)}catch{i=String(l+1)}if(h&&r&&r.monthsShort)a=r.monthsShort[l];else try{a=new Intl.DateTimeFormat(n,{month:"short"}).format(t)}catch{a=String(l+1)}const b={yyyy:String(s),yy:String(s).slice(-2),MMMM:i,MMM:a,MM:String(l+1).padStart(2,"0"),M:String(l+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(u).padStart(2,"0"),mm:String(c).padStart(2,"0")};return e.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(p){return b[p]!==void 0?b[p]:p})}function I(t,e,n,r){if(!t||!(t instanceof Date)||isNaN(t.getTime()))return"";const o=Et(e);if(o)try{const l=new Intl.DateTimeFormat(n,o),s=(n||"").toLowerCase().split("-")[0],u=l.resolvedOptions().locale.toLowerCase().split("-")[0];return r&&u!==s?V(t,"dd.MM.yyyy",n,r):l.format(t)}catch{return V(t,"dd.MM.yyyy",n,r)}return V(t,e||"dd.MM.yyyy",n,r)}(function(){const t="data-ln-date",e="lnDate";if(window[e]!==void 0)return;function n(i){const a=i[e];if(a){if(a.isTextElement)a._initTextElement();else if(a.value){const d=_(a.value);d&&a._displayFormatted(d)}}}const r={"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 l(i,a,d){P(i.dom,"ln-date:change",{value:a,formatted:i.dom.value,date:d}),i.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function s(i,a,d,h){i._setHiddenRaw(a),o.set.call(i._picker,a),i._lastISO=a,h!==void 0?(i._isFormatting=!0,i.dom.value=h,i._isFormatting=!1):d&&i._displayFormatted(d),l(i,a,d)}function u(i){i._setHiddenRaw(""),o.set.call(i._picker,""),i._isFormatting=!0,i.dom.value="",i._isFormatting=!1,i._lastISO="",l(i,"",null)}function c(i){if(i[e])return i[e];i[e]=this,this.dom=i;const a=this;if(this._onLocaleChange=function(){if(a.isTextElement)a._formatTextContent();else if(a.value){const f=_(a.value);f&&a._displayFormatted(f)}},H(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),i.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const d=i.value,h=i.name,b=i.closest(".form-element, form")||i.parentNode;if(b){const f=b.querySelectorAll("[data-ln-date-dict]");for(let m=0;m<f.length;m++){const g=f[m].getAttribute("data-ln-date-dict");if(g){const y=ot(f[m],"data-ln-date-dict-key");y["months-long"]&&(y.monthsLong=y["months-long"].split(",").map(A=>A.trim())),y["months-short"]&&(y.monthsShort=y["months-short"].split(",").map(A=>A.trim())),U(g,y)}}}const p=document.createElement("span");p.setAttribute("data-ln-date-field",""),i.parentNode.insertBefore(p,i),p.appendChild(i),this._wrapper=p;const w=document.createElement("input");w.type="hidden",w.name=h,i.removeAttribute("name"),i.hasAttribute("data-ln-fill-as")&&w.setAttribute("data-ln-fill-as",i.getAttribute("data-ln-fill-as")),i.insertAdjacentElement("afterend",w),this._hidden=w;const C=document.createElement("input");C.type="date",C.tabIndex=-1,C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),C.setAttribute("aria-label",i.getAttribute("data-ln-date-label")||"Date picker"),C.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",w.insertAdjacentElement("afterend",C),this._picker=C,i.type="text";const S=document.createElement("button");S.type="button",S.setAttribute("aria-label",i.getAttribute("data-ln-date-label")||"Open date picker"),S.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',C.insertAdjacentElement("afterend",S),this._btn=S,this._lastISO="",Object.defineProperty(w,"value",{get:function(){return o.get.call(w)},set:function(f){if(o.set.call(w,f),f&&f!==""){const m=_(f);m&&s(a,f,m)}else f===""&&u(a)}}),Z(i,o,{get:function(){return o.get.call(i)},set:function(f,m){if(a._isFormatting){m(f);return}if(!f||f===""){m(""),u(a);return}const g=_(f)||x(f);if(g){const y=E(g),A=i.getAttribute(t)||"",v=L(i),D=T(v),k=I(g,A,v,D);m(k),s(a,y,g,k)}else m(String(f)),u(a)}}),this._onPickerChange=function(){const f=C.value;if(f){const m=_(f);m&&s(a,f,m)}else u(a)},C.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=a.dom.value.trim();if(f===""){a._lastISO!==""&&u(a);return}if(a._lastISO){const g=_(a._lastISO);if(g){const y=a.dom.getAttribute(t)||"",A=L(a.dom),v=T(A);if(f===I(g,y,A,v))return}}const m=x(f);if(m){const g=E(m);s(a,g,m)}else if(a._lastISO){const g=_(a._lastISO);g&&a._displayFormatted(g)}else a.dom.value=""},i.addEventListener("blur",this._onBlur),this._onBtnClick=function(){a._openPicker()},S.addEventListener("click",this._onBtnClick);const O=i.form;if(O&&(this._form=O,this._onFormReset=function(){setTimeout(function(){const f=a.dom.value;if(f){const m=_(f)||x(f);if(m){const g=E(m);s(a,g,m);return}}u(a)},0)},O.addEventListener("reset",this._onFormReset)),d&&d!==""){const f=_(d);f&&s(a,d,f)}return this}c.prototype._initTextElement=function(){const i=this.dom,a=i.getAttribute("data-ln-value"),d=i.getAttribute("data-ln-date"),h=i.getAttribute("datetime");let b=null;i.tagName==="TIME"&&h!==null&&h!==""?b=h:a!==null&&a!==""?b=a:h!==null&&h!==""?b=h:d!==null&&d!==""&&d!=="true"&&!B.test(d)?b=d:b=i.textContent.trim();const p=_(b)||x(b);if(p&&!isNaN(p.getTime())){const w=E(p);this._rawValue=w,i.tagName!=="TIME"&&!i.hasAttribute("data-ln-value")&&i.setAttribute("data-ln-value",w),this._formatTextContent()}else this._rawValue=null},c.prototype._formatTextContent=function(){if(this._rawValue){const i=_(this._rawValue);if(i){let d=this.dom.getAttribute("data-ln-date-format");if(!d){const p=this.dom.getAttribute("data-ln-date");p&&B.test(p)&&(d=p)}const h=L(this.dom),b=T(h);this.dom.textContent=I(i,d||"medium",h,b)}}},c.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},c.prototype._setHiddenRaw=function(i){o.set.call(this._hidden,i)},c.prototype._displayFormatted=function(i){const a=this.dom.getAttribute(t)||"",d=L(this.dom),h=T(d);this._isFormatting=!0,this.dom.value=I(i,a,d,h),this._isFormatting=!1},Object.defineProperty(c.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(i){if(this.isTextElement){if(!i||i===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const d=_(i)||x(i);if(!d)return;const h=E(d);this._rawValue=h,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",h):this.dom.setAttribute("data-ln-value",h),this._formatTextContent();return}if(!i||i===""){u(this);return}const a=_(i);a&&s(this,i,a)}}),Object.defineProperty(c.prototype,"date",{get:function(){const i=this.value;return i?_(i):null},set:function(i){if(!i||!(i instanceof Date)||isNaN(i.getTime())){this.value="";return}this.value=E(i)}}),Object.defineProperty(c.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),c.prototype.destroy=function(){if(!this.dom[e])return;if(this.isTextElement){delete this.dom[e];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 i=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",i&&(this.dom.value=i),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),delete this.dom[e]},gt(t,e,c,"ln-date",{attributes:r,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
|
|
1
|
+
(function(){"use strict";function q(){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 N(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===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 t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<e.length;o++)if(e[o]&&e[o].nodeType===1){r=e[o];break}if(!N(r))return}t.apply(console,e)}}function P(t,e,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function M(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){M(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function Z(t,e,{get:n,set:r}){Object.defineProperty(t,"value",{get:function(){return n?n.call(this):e.get.call(this)},set:function(o){r?r.call(this,o,l=>e.set.call(this,l)):e.set.call(this,o)},configurable:!0})}const j={};function tt(t,e){j[t]=e}function et(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=tt,window.lnCore.getDataMapper=et);function L(t){const e=t?t.closest("[lang]"):null,n=(e?e.getAttribute("lang")||e.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 H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,M(function(){new MutationObserver(function(){P(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function U(t,e){if(!t||typeof e!="object")return;const n=t.toLowerCase().split("-")[0];W[n]=e}function T(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return W[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=U,window.lnCore.getLocaleFallback=T,window.lnCore.ensureLocaleObserver=H);const F={};function nt(t,e){F[t]||(F[t]=document.querySelector('[data-ln-template="'+t+'"]'));const n=F[t];return n?n.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function K(t,e){if(!t||!e)return t;const n=t.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],c=u.getAttribute("data-ln-field");e[c]!=null&&(u.textContent=e[c])}const r=t.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const u=r[s],c=u.getAttribute("data-ln-attr").split(",");for(let i=0;i<c.length;i++){const a=c[i].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),h=a[1].trim();e[h]!=null&&u.setAttribute(d,e[h])}}const o=t.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const u=o[s],c=u.getAttribute("data-ln-show");c in e&&u.classList.toggle("hidden",!e[c])}const l=t.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const u=l[s],c=u.getAttribute("data-ln-class").split(",");for(let i=0;i<c.length;i++){const a=c[i].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),h=a[1].trim();h in e&&u.classList.toggle(d,!!e[h])}}return t}function it(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const n=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],e??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)K(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let n=0;n<e.length;n++)e[n].textContent=""}})));function Y(t,e){if(!t||!e)return t;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return e[u]!==void 0?e[u]:""}))}const r=function(l,s){return e[s]!==void 0?e[s]:""},o=Array.from(t.querySelectorAll("*"));t.nodeType===1&&o.push(t);for(let l=0;l<o.length;l++){const s=o[l],u=s.attributes;for(let c=0;c<u.length;c++){const i=u[c];i.value.indexOf("{{")!==-1&&s.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function rt(t,e,n,r,o,l){const s={};for(let c=0;c<t.children.length;c++){const i=t.children[c],a=i.getAttribute("data-ln-render-key");a&&(s[a]=i)}const u=document.createDocumentFragment();for(let c=0;c<e.length;c++){const i=e[c],a=String(r(i));let d=s[a];if(d)o(d,i,c);else{const h=nt(n,l);if(!h||(Y(h,i),d=h.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),o(d,i,c)}u.appendChild(d)}t.textContent="",t.appendChild(u)}function ot(t,e){const n={},r=t.querySelectorAll("["+e+"]");for(let o=0;o<r.length;o++)n[r[o].getAttribute(e)]=r[o].textContent,r[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=K,window.lnCore.lnFill=it,window.lnCore.renderList=rt);function Q(t,e,n,r,o){if(!t||e===null)return!0;const l=r||"ln-component",s=t.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||e===""&&t.fallback!==void 0)return!0;const u=c=>{o?console.warn(c,o):console.warn(c)};if(s==="boolean"){const c=e.trim().toLowerCase();return c!==""&&c!=="true"&&c!=="false"&&c!=="1"&&c!=="0"?(u(`[${l}] Invalid value "${e}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const c=t.values||[];return c.includes(e)?!0:(u(`[${l}] Invalid value "${e}" for attribute "${n}". Allowed: ${c.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(e))return u(`[${l}] Invalid integer "${e}" for attribute "${n}". Fallback: ${t.fallback}.`),!1;const c=parseInt(e,10);return t.min!==void 0&&c<t.min?(u(`[${l}] Value ${c} for attribute "${n}" is less than min (${t.min}).`),!1):t.max!==void 0&&c>t.max?(u(`[${l}] Value ${c} for attribute "${n}" is greater than max (${t.max}).`),!1):!0}if(s==="float")return isNaN(Number(e))?(u(`[${l}] Invalid float "${e}" for attribute "${n}". Fallback: ${t.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(e),!0}catch(c){return u(`[${l}] Invalid JSON for attribute "${n}": ${c.message}. Fallback: ${t.fallback}.`),!1}return!0}function lt(t){const e={};for(const n in t){const r=t[n];r&&r.effect&&(e[n]=r.effect)}return Object.keys(e).length?e:null}function st(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const n in t.effects)e.add(n);if(t.onAttrChange&&t.declared)for(const n of t.declared)e.add(n);return e}function R(t,e,n,r){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",s=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&s.push(t);for(const u of s)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,e);try{u[n]=new r(u)}catch(c){console.error("["+n+"] init failed",u,c)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function at(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ct(t){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(t):setTimeout(t,0)):t()}function G(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function ut(t){const e=G(),n=t.observed||[];for(let r=0;r<n.length;r++){const o=n[r];e.byAttr.has(o)||e.byAttr.set(o,[]),e.byAttr.get(o).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const o=e.byDeclaredAttr.get(r);o.some(l=>l.componentTag===t.componentTag)||o.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=st(t);if(r===null)e.reactiveWildcard.push(t);else for(const o of r)e.byReactive.has(o)||e.byReactive.set(o,[]),e.byReactive.get(o).push(t)}t.persist&&e.persist.push(t)}function J(t,e,n,r){for(let o=0;o<t.length;o++){const l=t[o];if(!e[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(e,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(e,n,r)}}function dt(t){const e=t.target,n=t.attributeName;if(t.oldValue===e.getAttribute(n))return;const r=G(),o=r.byAttr.get(n);if(q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(e)){const l=r.byDeclaredAttr.get(n),s=e.getAttribute(n);for(let u=0;u<l.length;u++)Q(l[u].spec,s,n,l[u].componentTag,e)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,e,{oldValue:t.oldValue,newValue:e.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&J(l,e,n,t.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,e,n,t.oldValue)}if(o)for(let l=0;l<o.length;l++){const s=o[l];if(s.handler){s.handler(e,n,t.oldValue);continue}s.onAttributeChange&&e[s.attribute]?s.onAttributeChange(e,n):(R(e,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(e))}}function ft(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,M(function(){new MutationObserver(function(e){for(let n=0;n<e.length;n++)try{dt(e[n])}catch(r){console.error("[ln-core] mutation handler failed",e[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ht(t){const e=X();if(e.length){if(t.target)for(let n=0;n<e.length;n++){const r=e[n];if(r.onSubtreeChange){const o=r.query,l=t.target.nodeType===1?t.target.matches(o)?t.target:t.target.closest(o):t.target.parentElement?t.target.parentElement.closest(o):null;l&&r.onSubtreeChange(l,t)}}for(let n=0;n<t.addedNodes.length;n++){const r=t.addedNodes[n];if(r.nodeType===1)for(let o=0;o<e.length;o++){const l=e[o];R(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let n=0;n<t.removedNodes.length;n++){const r=t.removedNodes[n];if(r.nodeType===1)for(let o=0;o<e.length;o++){const l=e[o],s=l.query,u=Array.from(r.querySelectorAll(s));r.matches&&r.matches(s)&&u.push(r);for(let c=0;c<u.length;c++){const i=u[c];if(!document.contains(i)){const a=i[l.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",i,d)}delete i[l.attribute]}}}}}}function mt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,M(function(){new MutationObserver(function(e){for(let n=0;n<e.length;n++){const r=e[n];if(r.type==="childList")try{ht(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function gt(t,e,n,r,o={}){const l=o.extraAttributes||[],s=o.onAttributeChange||null,u=o.onSubtreeChange||null,c=o.onInit||null,i=o.onAttrChange||null,a=o.effects||null,d=o.attributes||null,h=d?lt(d):a,b=d?new Set(Object.keys(d)):null,p=o.persist||null;function w(m){const g=m||document.body;if(R(g,t,e,n),d&&q())for(const y in d){const A=d[y],v=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&v.push(g);for(let D=0;D<v.length;D++){const k=v[D];N(k)&&Q(A,k.getAttribute(y),y,r,k)}}c&&c(g)}const C=[];if(t.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let g;for(;(g=m.exec(t))!==null;)C.push(g[1])}else C.push(t);ut({selector:t,attribute:e,componentTag:r,attributes:d,ComponentFn:n,onInit:c,observed:C.concat(l),onAttributeChange:s,onAttrChange:i,effects:h,declared:b,persist:p}),ft();const O=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";X().push({selector:t,attribute:e,ComponentFn:n,onInit:c,onSubtreeChange:u,query:O}),mt(),window[e]=w;function f(){at()>0?ct(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),w}function z(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,n={},r=z(e);if(!r)return n;const o=r.split("&");for(let l=0;l<o.length;l++){const s=o[l];if(!s)continue;const u=s.indexOf(":"),c=u>-1?s.slice(0,u):s,i=u>-1?s.slice(u+1):"";if(c)try{n[c]=decodeURIComponent(i)}catch{n[c]=i}}return n}function pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function wt(t,e){if(!t)return;const n=$();e==null?delete n[t]:n[t]=String(e);const o=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");z(location.hash)!==o&&(location.hash=o)}function bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function yt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const n=t.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function Ct(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function _t(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function At(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function vt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const n=t.slice(0,e),r=t.slice(e+1),o=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=pt,window.lnCore.hashSet=wt,window.lnCore.hashLinkClick=bt,window.lnCore.resolveHashNamespace=yt,window.lnCore.hashSortEncode=Ct,window.lnCore.hashSortDecode=_t,window.lnCore.hashFilterEncode=At,window.lnCore.hashFilterDecode=vt);function _(t){if(t==null||t==="")return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;const e=Number(t);if(!isNaN(e)&&e>0){const n=e<1e11?e*1e3:e,r=new Date(n);return isNaN(r.getTime())?null:r}if(typeof t=="string"){const n=t.trim();if(!n)return null;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(r){const l=+r[1],s=+r[2],u=+r[3],c=new Date(l,s-1,u);return c.getFullYear()!==l||c.getMonth()!==s-1||c.getDate()!==u?null:c}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function E(t){if(!t||!(t instanceof Date)||isNaN(t.getTime()))return"";const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return e+"-"+n+"-"+r}const B=/^(short|medium|long)(\s+datetime)?$/,St={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 Et(t){return!t||t===""?{dateStyle:"medium"}:String(t).trim().match(B)?St[t.trim()]:null}function x(t){if(!t||typeof t!="string")return null;const e=t.trim();if(e.length<6)return null;let n,r;if(e.indexOf(".")!==-1)n=".",r=e.split(".");else if(e.indexOf("/")!==-1)n="/",r=e.split("/");else if(e.indexOf("-")!==-1)n="-",r=e.split("-");else return null;if(r.length!==3)return null;const o=[];for(let i=0;i<3;i++){const a=parseInt(r[i],10);if(isNaN(a))return null;o.push(a)}let l,s,u;n==="."?(l=o[0],s=o[1],u=o[2]):n==="/"?(s=o[0],l=o[1],u=o[2]):r[0].length===4?(u=o[0],s=o[1],l=o[2]):(l=o[0],s=o[1],u=o[2]),u<100&&(u+=u<50?2e3:1900);const c=new Date(u,s-1,l);return c.getFullYear()!==u||c.getMonth()!==s-1||c.getDate()!==l?null:c}function V(t,e,n,r){if(!t||!(t instanceof Date)||isNaN(t.getTime())||!e||typeof e!="string")return"";const o=t.getDate(),l=t.getMonth(),s=t.getFullYear(),u=t.getHours(),c=t.getMinutes();let i,a;const d=(n||"").toLowerCase().split("-")[0];let h=!1;try{const w=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];h=!!(r&&w!==d)}catch{h=!!r}if(h&&r&&r.monthsLong)i=r.monthsLong[l];else try{i=new Intl.DateTimeFormat(n,{month:"long"}).format(t)}catch{i=String(l+1)}if(h&&r&&r.monthsShort)a=r.monthsShort[l];else try{a=new Intl.DateTimeFormat(n,{month:"short"}).format(t)}catch{a=String(l+1)}const b={yyyy:String(s),yy:String(s).slice(-2),MMMM:i,MMM:a,MM:String(l+1).padStart(2,"0"),M:String(l+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(u).padStart(2,"0"),mm:String(c).padStart(2,"0")};return e.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(p){return b[p]!==void 0?b[p]:p})}function I(t,e,n,r){if(!t||!(t instanceof Date)||isNaN(t.getTime()))return"";const o=Et(e);if(o)try{const l=new Intl.DateTimeFormat(n,o),s=(n||"").toLowerCase().split("-")[0],u=l.resolvedOptions().locale.toLowerCase().split("-")[0];return r&&u!==s?V(t,"dd.MM.yyyy",n,r):l.format(t)}catch{return V(t,"dd.MM.yyyy",n,r)}return V(t,e||"dd.MM.yyyy",n,r)}(function(){const t="data-ln-date",e="lnDate";if(window[e]!==void 0)return;function n(i){const a=i[e];if(a){if(a.isTextElement)a._initTextElement();else if(a.value){const d=_(a.value);d&&a._displayFormatted(d)}}}const r={"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 l(i,a,d){P(i.dom,"ln-date:change",{value:a,formatted:i.dom.value,date:d}),i.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function s(i,a,d,h){i._setHiddenRaw(a),o.set.call(i._picker,a),i._lastISO=a,h!==void 0?(i._isFormatting=!0,i.dom.value=h,i._isFormatting=!1):d&&i._displayFormatted(d),l(i,a,d)}function u(i){i._setHiddenRaw(""),o.set.call(i._picker,""),i._isFormatting=!0,i.dom.value="",i._isFormatting=!1,i._lastISO="",l(i,"",null)}function c(i){if(i[e])return i[e];i[e]=this,this.dom=i;const a=this;if(this._onLocaleChange=function(){if(a.isTextElement)a._formatTextContent();else if(a.value){const f=_(a.value);f&&a._displayFormatted(f)}},H(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),i.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const d=i.value,h=i.name,b=i.closest(".form-element, form")||i.parentNode;if(b){const f=b.querySelectorAll("[data-ln-date-dict]");for(let m=0;m<f.length;m++){const g=f[m].getAttribute("data-ln-date-dict");if(g){const y=ot(f[m],"data-ln-date-dict-key");y["months-long"]&&(y.monthsLong=y["months-long"].split(",").map(A=>A.trim())),y["months-short"]&&(y.monthsShort=y["months-short"].split(",").map(A=>A.trim())),U(g,y)}}}const p=document.createElement("span");p.setAttribute("data-ln-date-field",""),i.parentNode.insertBefore(p,i),p.appendChild(i),this._wrapper=p;const w=document.createElement("input");w.type="hidden",w.name=h,i.removeAttribute("name"),i.hasAttribute("data-ln-fill-as")&&w.setAttribute("data-ln-fill-as",i.getAttribute("data-ln-fill-as")),i.insertAdjacentElement("afterend",w),this._hidden=w;const C=document.createElement("input");C.type="date",C.tabIndex=-1,C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),C.setAttribute("aria-label",i.getAttribute("data-ln-date-label")||"Date picker"),C.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",w.insertAdjacentElement("afterend",C),this._picker=C,i.type="text";const S=document.createElement("button");S.type="button",S.setAttribute("aria-label",i.getAttribute("data-ln-date-label")||"Open date picker"),S.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',C.insertAdjacentElement("afterend",S),this._btn=S,this._lastISO="",Object.defineProperty(w,"value",{get:function(){return o.get.call(w)},set:function(f){if(o.set.call(w,f),f&&f!==""){const m=_(f);m&&s(a,f,m)}else f===""&&u(a)}}),Z(i,o,{get:function(){return o.get.call(i)},set:function(f,m){if(a._isFormatting){m(f);return}if(!f||f===""){m(""),u(a);return}const g=_(f)||x(f);if(g){const y=E(g),A=i.getAttribute(t)||"",v=L(i),D=T(v),k=I(g,A,v,D);m(k),s(a,y,g,k)}else m(String(f)),u(a)}}),this._onPickerChange=function(){const f=C.value;if(f){const m=_(f);m&&s(a,f,m)}else u(a)},C.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=a.dom.value.trim();if(f===""){a._lastISO!==""&&u(a);return}if(a._lastISO){const g=_(a._lastISO);if(g){const y=a.dom.getAttribute(t)||"",A=L(a.dom),v=T(A);if(f===I(g,y,A,v))return}}const m=x(f);if(m){const g=E(m);s(a,g,m)}else if(a._lastISO){const g=_(a._lastISO);g&&a._displayFormatted(g)}else a.dom.value=""},i.addEventListener("blur",this._onBlur),this._onBtnClick=function(){a._openPicker()},S.addEventListener("click",this._onBtnClick);const O=i.form;if(O&&(this._form=O,this._onFormReset=function(){setTimeout(function(){const f=a.dom.value;if(f){const m=_(f)||x(f);if(m){const g=E(m);s(a,g,m);return}}u(a)},0)},O.addEventListener("reset",this._onFormReset)),d&&d!==""){const f=_(d);f&&s(a,d,f)}return this}c.prototype._initTextElement=function(){const i=this.dom,a=i.getAttribute("data-ln-value"),d=i.getAttribute("data-ln-date"),h=i.getAttribute("datetime");let b=null;i.tagName==="TIME"&&h!==null&&h!==""?b=h:a!==null&&a!==""?b=a:h!==null&&h!==""?b=h:d!==null&&d!==""&&d!=="true"&&!B.test(d)?b=d:b=i.textContent.trim();const p=_(b)||x(b);if(p&&!isNaN(p.getTime())){const w=E(p);this._rawValue=w,i.tagName!=="TIME"&&!i.hasAttribute("data-ln-value")&&i.setAttribute("data-ln-value",w),this._formatTextContent()}else this._rawValue=null},c.prototype._formatTextContent=function(){if(this._rawValue){const i=_(this._rawValue);if(i){let d=this.dom.getAttribute("data-ln-date-format");if(!d){const p=this.dom.getAttribute("data-ln-date");p&&B.test(p)&&(d=p)}const h=L(this.dom),b=T(h);this.dom.textContent=I(i,d||"medium",h,b)}}},c.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},c.prototype._setHiddenRaw=function(i){o.set.call(this._hidden,i)},c.prototype._displayFormatted=function(i){const a=this.dom.getAttribute(t)||"",d=L(this.dom),h=T(d);this._isFormatting=!0,this.dom.value=I(i,a,d,h),this._isFormatting=!1},Object.defineProperty(c.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(i){if(this.isTextElement){if(!i||i===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const d=_(i)||x(i);if(!d)return;const h=E(d);this._rawValue=h,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",h):this.dom.setAttribute("data-ln-value",h),this._formatTextContent();return}if(!i||i===""){u(this);return}const a=_(i);a&&s(this,i,a)}}),Object.defineProperty(c.prototype,"date",{get:function(){const i=this.value;return i?_(i):null},set:function(i){if(!i||!(i instanceof Date)||isNaN(i.getTime())){this.value="";return}this.value=E(i)}}),Object.defineProperty(c.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),c.prototype.destroy=function(){if(!this.dom[e])return;if(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[e];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 i=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",i&&(this.dom.value=i),delete this.dom[e]},gt(t,e,c,"ln-date",{attributes:r,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
|
|
@@ -448,6 +448,9 @@ import {
|
|
|
448
448
|
|
|
449
449
|
_component.prototype.destroy = function () {
|
|
450
450
|
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
451
|
+
if (this._onLocaleChange) {
|
|
452
|
+
document.removeEventListener('ln-core:locale-change', this._onLocaleChange);
|
|
453
|
+
}
|
|
451
454
|
if (this.isTextElement) {
|
|
452
455
|
delete this.dom[DOM_ATTRIBUTE];
|
|
453
456
|
return;
|
|
@@ -470,9 +473,6 @@ import {
|
|
|
470
473
|
this.dom.name = this._hidden.name;
|
|
471
474
|
this.dom.type = 'date';
|
|
472
475
|
if (isoVal) this.dom.value = isoVal;
|
|
473
|
-
if (this._onLocaleChange) {
|
|
474
|
-
document.removeEventListener('ln-core:locale-change', this._onLocaleChange);
|
|
475
|
-
}
|
|
476
476
|
delete this.dom[DOM_ATTRIBUTE];
|
|
477
477
|
};
|
|
478
478
|
|
|
@@ -89,28 +89,31 @@ No payload attributes → `lnFill(form, null)` → form resets (calls `this.rese
|
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
## 4. Composing with `data-ln-modal-for`
|
|
92
|
+
## 4. Composing with `data-ln-modal-for` and `data-ln-modal-mode`
|
|
93
93
|
|
|
94
|
-
`ln-fill` intentionally does NOT call `e.preventDefault()`. A trigger may
|
|
95
|
-
carry both `data-ln-fill-form` and `data-ln-modal-for` — both document
|
|
96
|
-
listeners fire on the same click independently.
|
|
94
|
+
`ln-fill` intentionally does NOT call `e.preventDefault()`. A trigger may carry both `data-ln-fill-form` and `data-ln-modal-for` (as well as `data-ln-modal-mode="new|edit"`) — both document listeners fire on the same click independently. Triggers can be authored on `<button>` elements or `<a href="#...">` anchor links.
|
|
97
95
|
|
|
98
96
|
```html
|
|
99
|
-
<!-- One button
|
|
100
|
-
<button
|
|
97
|
+
<!-- One button opens the modal in "edit" mode AND fills the form -->
|
|
98
|
+
<button type="button"
|
|
101
99
|
data-ln-modal-for="event-modal"
|
|
100
|
+
data-ln-modal-mode="edit"
|
|
102
101
|
data-ln-fill-form="event-form"
|
|
103
102
|
data-ln-fill-event-id="42"
|
|
104
103
|
data-ln-fill-title="Annual Conference"
|
|
105
104
|
>Edit</button>
|
|
105
|
+
|
|
106
|
+
<!-- New button opens the modal in "new" mode AND resets the form -->
|
|
107
|
+
<button type="button"
|
|
108
|
+
data-ln-modal-for="event-modal"
|
|
109
|
+
data-ln-modal-mode="new"
|
|
110
|
+
data-ln-fill-form="event-form"
|
|
111
|
+
>New Event</button>
|
|
106
112
|
```
|
|
107
113
|
|
|
108
114
|
Order of side-effects per click (both listeners are on `document`):
|
|
109
|
-
1. `ln-modal` click listener → opens modal
|
|
110
|
-
2. `ln-fill` click listener →
|
|
111
|
-
|
|
112
|
-
### Double-Fill Prevention for Hash-Bound triggers
|
|
113
|
-
If a clickable trigger is an anchor link that points to a hash segment (i.e., its `href` attribute contains `#`, such as `<a href="#event-modal:42" ...>`), `ln-fill`'s click listener will **ignore** the click. The fill process is instead delegated entirely to the `ln-ui-coordinator`, which will map the resulting hash change and `ln-modal:open` event to an `ln-fill:request` event. This prevents redundant, parallel form-filling operations.
|
|
115
|
+
1. `ln-modal` click listener → transfers `data-ln-modal-mode` and opens modal (`data-ln-modal="open"`).
|
|
116
|
+
2. `ln-fill` click listener → extracts attributes and calls `lnCore.lnFill(form, record)` (or `lnFill(form, null)` when no attributes are present, resetting the form for "new" mode).
|
|
114
117
|
|
|
115
118
|
---
|
|
116
119
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function S(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 n=e.closest("[data-ln-debug]");return!(!n||typeof document<"u"&&n===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(...n){if(typeof n[0]=="string"&&(n[0].startsWith("[ln-")||n[0].startsWith("[lnCore"))){let u=null;for(let s=1;s<n.length;s++)if(n[s]&&n[s].nodeType===1){u=n[s];break}if(!S(u))return}e.apply(console,n)}}function A(e,n,r){const u=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",n,e,u),e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:u}))}function p(e,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const C={};function _(e,n){C[e]=n}function k(e){return C[e]||{ingress:n=>n,egress:n=>n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=_,window.lnCore.getDataMapper=k);function E(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const g={};function L(e,n){if(!e||typeof n!="object")return;const r=e.toLowerCase().split("-")[0];g[r]=n}function F(e){if(!e)return null;const n=e.toLowerCase().split("-")[0];return g[n]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=L,window.lnCore.getLocaleFallback=F,window.lnCore.ensureLocaleObserver=E);const w={};function v(e,n){w[e]||(w[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=w[e];return r?r.content.cloneNode(!0):(console.warn("["+(n||"ln-core")+'] Template "'+e+'" not found'),null)}function b(e,n){if(!e||!n)return e;const r=e.querySelectorAll("[data-ln-field]");for(let t=0;t<r.length;t++){const i=r[t],o=i.getAttribute("data-ln-field");n[o]!=null&&(i.textContent=n[o])}const u=e.querySelectorAll("[data-ln-attr]");for(let t=0;t<u.length;t++){const i=u[t],o=i.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();n[a]!=null&&i.setAttribute(f,n[a])}}const s=e.querySelectorAll("[data-ln-show]");for(let t=0;t<s.length;t++){const i=s[t],o=i.getAttribute("data-ln-show");o in n&&i.classList.toggle("hidden",!n[o])}const l=e.querySelectorAll("[data-ln-class]");for(let t=0;t<l.length;t++){const i=l[t],o=i.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();a in n&&i.classList.toggle(f,!!n[a])}}return e}function
|
|
1
|
+
(function(){"use strict";function S(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 n=e.closest("[data-ln-debug]");return!(!n||typeof document<"u"&&n===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(...n){if(typeof n[0]=="string"&&(n[0].startsWith("[ln-")||n[0].startsWith("[lnCore"))){let u=null;for(let s=1;s<n.length;s++)if(n[s]&&n[s].nodeType===1){u=n[s];break}if(!S(u))return}e.apply(console,n)}}function A(e,n,r){const u=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",n,e,u),e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:u}))}function p(e,n){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,n)}),console.warn("["+n+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const C={};function _(e,n){C[e]=n}function k(e){return C[e]||{ingress:n=>n,egress:n=>n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=_,window.lnCore.getDataMapper=k);function E(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const g={};function L(e,n){if(!e||typeof n!="object")return;const r=e.toLowerCase().split("-")[0];g[r]=n}function F(e){if(!e)return null;const n=e.toLowerCase().split("-")[0];return g[n]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=L,window.lnCore.getLocaleFallback=F,window.lnCore.ensureLocaleObserver=E);const w={};function v(e,n){w[e]||(w[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=w[e];return r?r.content.cloneNode(!0):(console.warn("["+(n||"ln-core")+'] Template "'+e+'" not found'),null)}function b(e,n){if(!e||!n)return e;const r=e.querySelectorAll("[data-ln-field]");for(let t=0;t<r.length;t++){const i=r[t],o=i.getAttribute("data-ln-field");n[o]!=null&&(i.textContent=n[o])}const u=e.querySelectorAll("[data-ln-attr]");for(let t=0;t<u.length;t++){const i=u[t],o=i.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();n[a]!=null&&i.setAttribute(f,n[a])}}const s=e.querySelectorAll("[data-ln-show]");for(let t=0;t<s.length;t++){const i=s[t],o=i.getAttribute("data-ln-show");o in n&&i.classList.toggle("hidden",!n[o])}const l=e.querySelectorAll("[data-ln-class]");for(let t=0;t<l.length;t++){const i=l[t],o=i.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();a in n&&i.classList.toggle(f,!!n[a])}}return e}function D(e,n){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,n??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let u=0;u<r.length;u++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[u],n??null),r[u].dispatchEvent(new CustomEvent("ln-fill",{detail:n??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)b(e.target,e.detail);else{const n=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++)n[r].textContent=""}})));function m(e,n){if(!e||!n)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(t,i){return n[i]!==void 0?n[i]:""}))}const u=function(l,t){return n[t]!==void 0?n[t]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let l=0;l<s.length;l++){const t=s[l],i=t.attributes;for(let o=0;o<i.length;o++){const c=i[o];c.value.indexOf("{{")!==-1&&t.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,u))}}return e}function x(e,n,r,u,s,l){const t={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(t[d]=c)}const i=document.createDocumentFragment();for(let o=0;o<n.length;o++){const c=n[o],d=String(u(c));let f=t[d];if(f)s(f,c,o);else{const a=v(r,l);if(!a||(m(a,c),f=a.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),s(f,c,o)}i.appendChild(f)}e.textContent="",e.appendChild(i)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=m,window.lnCore.fill=b,window.lnCore.lnFill=D,window.lnCore.renderList=x),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function y(e){return(e||"").replace(/^#/,"")}function h(e){const n=e===void 0?location.hash:e,r={},u=y(n);if(!u)return r;const s=u.split("&");for(let l=0;l<s.length;l++){const t=s[l];if(!t)continue;const i=t.indexOf(":"),o=i>-1?t.slice(0,i):t,c=i>-1?t.slice(i+1):"";if(o)try{r[o]=decodeURIComponent(c)}catch{r[o]=c}}return r}function O(e){if(!e)return null;const n=h();return e in n?n[e]:null}function B(e,n){if(!e)return;const r=h();n==null?delete r[e]:r[e]=String(n);const s=Object.keys(r).map(function(l){const t=r[l];return t===""?l:l+":"+encodeURIComponent(t)}).join("&");y(location.hash)!==s&&(location.hash=s)}function I(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function T(e,n){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const u=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return u?n?u+"-"+n:u:n||null}function q(e,n){return!n||n==="none"||e===null||e===void 0?null:String(e)+"."+n}function W(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 M(e,n){return!e||!Array.isArray(n)||n.length===0?null:e+":"+n.map(encodeURIComponent).join(",")}function j(e){if(!e||typeof e!="string")return null;const n=e.indexOf(":");if(n===-1)return null;const r=e.slice(0,n),u=e.slice(n+1),s=u?u.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=h,window.lnCore.hashGet=O,window.lnCore.hashSet=B,window.lnCore.hashLinkClick=I,window.lnCore.resolveHashNamespace=T,window.lnCore.hashSortEncode=q,window.lnCore.hashSortDecode=W,window.lnCore.hashFilterEncode=M,window.lnCore.hashFilterDecode=j),(function(){const e="lnFill";if(window[e]!==void 0)return;const n={lnFillForm:!0,lnFillStore:!0};function r(s){const l={},t=s.dataset;for(const i in t){if(!i.startsWith("lnFill")||n[i])continue;const o=i.slice(6);o&&(l[o.charAt(0).toLowerCase()+o.slice(1)]=t[i])}return l}function u(s,l){const t=window.CSS&&CSS.escape?CSS.escape(l):l,i=document.querySelectorAll('[data-ln-fill-id="'+t+'"]');if(i.length===0)return null;for(let o=0;o<i.length;o++){const c=i[o].getAttribute("data-ln-fill-form");if(c){const d=document.getElementById(c);if(d&&s.contains(d))return i[o]}}return i[0]}document.addEventListener("click",function(s){if(s.ctrlKey||s.metaKey||s.button===1)return;const l=s.target.closest("[data-ln-fill-form]");if(!l)return;const t=l.getAttribute("data-ln-fill-form"),i=document.getElementById(t);if(!i)return;const o=r(l),c=Object.keys(o).length>0;window.lnCore.lnFill(i,c?o:null)}),document.addEventListener("ln-fill:request",function(s){const l=s.detail;if(!l)return;const t=s.target,i=l.id;if(i==null){window.lnCore.lnFill(t,null);return}const o=u(t,i);if(!o)return;const c=r(o);window.lnCore.lnFill(t,c)}),window[e]=!0})()})();
|
|
@@ -50,12 +50,6 @@ import { } from '../../ln-core';
|
|
|
50
50
|
const trigger = e.target.closest('[data-ln-fill-form]');
|
|
51
51
|
if (!trigger) return;
|
|
52
52
|
|
|
53
|
-
// Prevent double fill: if this trigger is a hash-bound anchor (e.g. href="#user-modal:142"),
|
|
54
|
-
// we skip the click-based fill. The resulting hash change will trigger ln-modal:open,
|
|
55
|
-
// and the ln-ui-coordinator will request the fill via ln-fill:request.
|
|
56
|
-
const href = trigger.getAttribute('href');
|
|
57
|
-
if (href && href.indexOf('#') !== -1) return;
|
|
58
|
-
|
|
59
53
|
// No e.preventDefault() — the same click may also be handled by
|
|
60
54
|
// [data-ln-modal-for] listener in ln-modal. Leave it alone.
|
|
61
55
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function X(){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 j(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const i=t.closest("[data-ln-debug]");return!(!i||typeof document<"u"&&i===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 t=console.warn;console.warn=function(...i){if(typeof i[0]=="string"&&(i[0].startsWith("[ln-")||i[0].startsWith("[lnCore"))){let s=null;for(let a=1;a<i.length;a++)if(i[a]&&i[a].nodeType===1){s=i[a];break}if(!j(s))return}t.apply(console,i)}}function D(t,i,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",i,t,s),t.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:s}))}function ut(t,i,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const s={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};s[r]=t.name,D(t.dom,i,s)}function $(t,i){if(!document.body){document.addEventListener("DOMContentLoaded",function(){$(t,i)}),console.warn("["+i+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function Z(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}const tt={};function ht(t,i){tt[t]=i}function ft(t){return tt[t]||{ingress:i=>i,egress:i=>i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ht,window.lnCore.getDataMapper=ft);function et(t){const i=t?t.closest("[lang]"):null,r=(i?i.getAttribute("lang")||i.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function _t(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,$(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const nt={};function pt(t,i){if(!t||typeof i!="object")return;const r=t.toLowerCase().split("-")[0];nt[r]=i}function gt(t){if(!t)return null;const i=t.toLowerCase().split("-")[0];return nt[i]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pt,window.lnCore.getLocaleFallback=gt,window.lnCore.ensureLocaleObserver=_t);const G={};function it(t,i){G[t]||(G[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=G[t];return r?r.content.cloneNode(!0):(console.warn("["+(i||"ln-core")+'] Template "'+t+'" not found'),null)}function lt(t,i,r){if(t){const s=t.querySelector('[data-ln-template="'+i+'"]');if(s)return s.content.cloneNode(!0)}return it(i,r)}function P(t,i){if(!t||!i)return t;const r=t.querySelectorAll("[data-ln-field]");for(let u=0;u<r.length;u++){const h=r[u],f=h.getAttribute("data-ln-field");i[f]!=null&&(h.textContent=i[f])}const s=t.querySelectorAll("[data-ln-attr]");for(let u=0;u<s.length;u++){const h=s[u],f=h.getAttribute("data-ln-attr").split(",");for(let g=0;g<f.length;g++){const b=f[g].trim().split(":");if(b.length!==2)continue;const w=b[0].trim(),L=b[1].trim();i[L]!=null&&h.setAttribute(w,i[L])}}const a=t.querySelectorAll("[data-ln-show]");for(let u=0;u<a.length;u++){const h=a[u],f=h.getAttribute("data-ln-show");f in i&&h.classList.toggle("hidden",!i[f])}const d=t.querySelectorAll("[data-ln-class]");for(let u=0;u<d.length;u++){const h=d[u],f=h.getAttribute("data-ln-class").split(",");for(let g=0;g<f.length;g++){const b=f[g].trim().split(":");if(b.length!==2)continue;const w=b[0].trim(),L=b[1].trim();L in i&&h.classList.toggle(w,!!i[L])}}return t}function mt(t,i){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,i??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:i??null,bubbles:!0})));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],i??null),r[s].dispatchEvent(new CustomEvent("ln-fill",{detail:i??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)P(t.target,t.detail);else{const i=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<i.length;r++)i[r].textContent=""}})));function Y(t,i){if(!t||!i)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const d=r.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(u,h){return i[h]!==void 0?i[h]:""}))}const s=function(d,u){return i[u]!==void 0?i[u]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let d=0;d<a.length;d++){const u=a[d],h=u.attributes;for(let f=0;f<h.length;f++){const g=h[f];g.value.indexOf("{{")!==-1&&u.setAttribute(g.name,g.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function bt(t,i,r,s,a,d){const u={};for(let f=0;f<t.children.length;f++){const g=t.children[f],b=g.getAttribute("data-ln-render-key");b&&(u[b]=g)}const h=document.createDocumentFragment();for(let f=0;f<i.length;f++){const g=i[f],b=String(s(g));let w=u[b];if(w)a(w,g,f);else{const L=it(r,d);if(!L||(Y(L,g),w=L.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",b),a(w,g,f)}h.appendChild(w)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=P,window.lnCore.lnFill=mt,window.lnCore.renderList=bt);function z(t,i,r){const s=t.getAttribute(i);return s===null?r:s}function wt(t,i,r){const s=parseInt(t.getAttribute(i),10);return isNaN(s)?r:s}function rt(t,i,r=!1){const s=t.getAttribute(i);if(s===null)return!!r;const a=s.trim().toLowerCase();return!(a==="false"||a==="0")}function yt(t,i){return(t.getAttribute(i)||"").split(",").map(r=>r.trim()).filter(Boolean)}const K=new Map;function Ct(t,i){const r=(t?t.join("|"):"")+"::"+i;if(K.has(r))return K.get(r);const s=new Set(t||[]),a=function(d,u){const h=d.getAttribute(u);return h!==null&&s.has(h)?h:i};return K.set(r,a),a}function vt(t,i,r){const s=parseFloat(t.getAttribute(i));return isNaN(s)?r:s}function St(t,i,r){const s=t.getAttribute(i);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function st(t,i,r,s,a){if(!t||i===null)return!0;const d=s||"ln-component",u=t.type;if(u==="trigger"||u==="marker"||u==="string"||u==="list"||!u||i===""&&t.fallback!==void 0)return!0;const h=f=>{a?console.warn(f,a):console.warn(f)};if(u==="boolean"){const f=i.trim().toLowerCase();return f!==""&&f!=="true"&&f!=="false"&&f!=="1"&&f!=="0"?(h(`[${d}] Invalid value "${i}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(u==="enum"){const f=t.values||[];return f.includes(i)?!0:(h(`[${d}] Invalid value "${i}" for attribute "${r}". Allowed: ${f.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(u==="integer"){if(!/^-?\d+$/.test(i))return h(`[${d}] Invalid integer "${i}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const f=parseInt(i,10);return t.min!==void 0&&f<t.min?(h(`[${d}] Value ${f} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&f>t.max?(h(`[${d}] Value ${f} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(u==="float")return isNaN(Number(i))?(h(`[${d}] Invalid float "${i}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(u==="json")try{return JSON.parse(i),!0}catch(f){return h(`[${d}] Invalid JSON for attribute "${r}": ${f.message}. Fallback: ${t.fallback}.`),!1}return!0}function At(t,i,r){for(const s in r){const[a,d,u]=r[s];Object.defineProperty(t,s,{get:function(){return a(i,d,u)},enumerable:!0,configurable:!0})}return t}function Et(t){const i={};for(const r in t){const s=t[r];if(!s||!s.prop)continue;let a=s.read;if(!a&&s.type)switch(s.type){case"enum":a=Ct(s.values,s.fallback);break;case"integer":a=wt;break;case"float":a=vt;break;case"boolean":a=rt;break;case"list":a=yt;break;case"json":a=St;break;case"string":default:a=z;break}a||(a=z),i[s.prop]=[a,r,s.fallback]}return i}function Dt(t){const i={};for(const r in t){const s=t[r];s&&s.effect&&(i[r]=s.effect)}return Object.keys(i).length?i:null}function Lt(t){if(t.onAttrChange&&!t.declared)return null;const i=new Set;if(t.effects)for(const r in t.effects)i.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)i.add(r);return i}function Q(t,i,r,s){if(t.nodeType!==1)return;const d=i.indexOf("[")!==-1||i.indexOf(".")!==-1||i.indexOf("#")!==-1?i:"["+i+"]",u=Array.from(t.querySelectorAll(d));t.matches&&t.matches(d)&&u.push(t);for(const h of u)if(!h[r]){window.lnCore._persistSink&&h.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(h,i);try{h[r]=new s(h)}catch(f){console.error("["+r+"] init failed",h,f)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function kt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Tt(t){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(t):setTimeout(t,0)):t()}function ot(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function It(t){const i=ot(),r=t.observed||[];for(let s=0;s<r.length;s++){const a=r[s];i.byAttr.has(a)||i.byAttr.set(a,[]),i.byAttr.get(a).push(t)}if(i.byDeclaredAttr=i.byDeclaredAttr||new Map,t.attributes)for(const s in t.attributes){i.byDeclaredAttr.has(s)||i.byDeclaredAttr.set(s,[]);const a=i.byDeclaredAttr.get(s);a.some(d=>d.componentTag===t.componentTag)||a.push({spec:t.attributes[s],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){i.reactive.push(t);const s=Lt(t);if(s===null)i.reactiveWildcard.push(t);else for(const a of s)i.byReactive.has(a)||i.byReactive.set(a,[]),i.byReactive.get(a).push(t)}t.persist&&i.persist.push(t)}function at(t,i,r,s){for(let a=0;a<t.length;a++){const d=t[a];if(!i[d.attribute])continue;const u=d.effects&&d.effects[r];u?u(i,r,s):d.onAttrChange&&(!d.declared||d.declared.has(r))&&d.onAttrChange(i,r,s)}}function Ft(t){const i=t.target,r=t.attributeName;if(t.oldValue===i.getAttribute(r))return;const s=ot(),a=s.byAttr.get(r);if(X()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(r)&&j(i)){const d=s.byDeclaredAttr.get(r),u=i.getAttribute(r);for(let h=0;h<d.length;h++)st(d[h].spec,u,r,d[h].componentTag,i)}if(window.lnCore._debugSink&&(r.indexOf("data-ln-")===0||a)&&window.lnCore._debugSink("attr",r,i,{oldValue:t.oldValue,newValue:i.getAttribute(r)}),r.indexOf("data-ln-")===0){const d=s.byReactive.get(r);d&&at(d,i,r,t.oldValue),s.reactiveWildcard.length&&at(s.reactiveWildcard,i,r,t.oldValue)}if(a)for(let d=0;d<a.length;d++){const u=a[d];if(u.handler){u.handler(i,r,t.oldValue);continue}u.onAttributeChange&&i[u.attribute]?u.onAttributeChange(i,r):(Q(i,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(i))}}function qt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(i){for(let r=0;r<i.length;r++)try{Ft(i[r])}catch(s){console.error("[ln-core] mutation handler failed",i[r].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ct(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function xt(t){const i=ct();if(i.length){if(t.target)for(let r=0;r<i.length;r++){const s=i[r];if(s.onSubtreeChange){const a=s.query,d=t.target.nodeType===1?t.target.matches(a)?t.target:t.target.closest(a):t.target.parentElement?t.target.parentElement.closest(a):null;d&&s.onSubtreeChange(d,t)}}for(let r=0;r<t.addedNodes.length;r++){const s=t.addedNodes[r];if(s.nodeType===1)for(let a=0;a<i.length;a++){const d=i[a];Q(s,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(s)}}for(let r=0;r<t.removedNodes.length;r++){const s=t.removedNodes[r];if(s.nodeType===1)for(let a=0;a<i.length;a++){const d=i[a],u=d.query,h=Array.from(s.querySelectorAll(u));s.matches&&s.matches(u)&&h.push(s);for(let f=0;f<h.length;f++){const g=h[f];if(!document.contains(g)){const b=g[d.attribute];if(b&&typeof b.destroy=="function")try{b.destroy()}catch(w){console.error("["+d.attribute+"] destroy failed",g,w)}delete g[d.attribute]}}}}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){new MutationObserver(function(i){for(let r=0;r<i.length;r++){const s=i[r];if(s.type==="childList")try{xt(s)}catch(a){console.error("[ln-core] lifecycle handler failed",s.target,a)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Rt(t,i,r,s,a={}){const d=a.extraAttributes||[],u=a.onAttributeChange||null,h=a.onSubtreeChange||null,f=a.onInit||null,g=a.onAttrChange||null,b=a.effects||null,w=a.attributes||null,L=w?Dt(w):b,F=w?new Set(Object.keys(w)):null,q=a.persist||null;function M(e){const n=e||document.body;if(Q(n,t,i,r),w&&X())for(const l in w){const o=w[l],c=Array.from(n.querySelectorAll("["+l+"]"));n.matches&&n.matches("["+l+"]")&&c.push(n);for(let _=0;_<c.length;_++){const p=c[_];j(p)&&st(o,p.getAttribute(l),l,s,p)}}f&&f(n)}const I=[];if(t.indexOf("[")!==-1){const e=/\[([\w-]+)/g;let n;for(;(n=e.exec(t))!==null;)I.push(n[1])}else I.push(t);It({selector:t,attribute:i,componentTag:s,attributes:w,ComponentFn:r,onInit:f,observed:I.concat(d),onAttributeChange:u,onAttrChange:g,effects:L,declared:F,persist:q}),qt();const N=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";ct().push({selector:t,attribute:i,ComponentFn:r,onInit:f,onSubtreeChange:h,query:N}),Ot(),window[i]=M;function C(){kt()>0?Tt(function(){M(document.body)}):M(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",C):C(),M}function Ht(t){let i=!1;for(let r=0;r<t.length;r++){const s=t[r];if(!(s===""||s==null)&&(i=!0,!Number.isFinite(Number(s))))return"string"}return i?"number":"string"}function Mt(t,i,r,s){if(r==="number"){const u=parseFloat(t),h=parseFloat(i);return(isNaN(u)?0:u)-(isNaN(h)?0:h)}const a=t!=null?String(t):"",d=i!=null?String(i):"";return s?s.compare(a,d):a<d?-1:a>d?1:0}function Nt(t,i){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function Wt(t){t=t||{};let i=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,s=t.threshold!=null?t.threshold:25,a=t.fetchDebounce!=null?t.fetchDebounce:120;const d=typeof t.requestPage=="function"?t.requestPage:function(){},u=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,f=new Map,g=new Set;let b=0,w=0,L=0,F={sort:null,filters:{},search:""},q=null,M=0,I=0,x=!1;function N(l){f.set(l,++M)}function C(){return!!(F&&(F.search||F.filters&&Object.keys(F.filters).length))}function e(){if(h.size<=i)return;const l=Array.from(h.keys()).sort(function(c,_){return(f.get(c)||0)-(f.get(_)||0)});let o=0;for(;h.size>i&&o<l.length;)h.delete(l[o]),f.delete(l[o]),o++}function n(l,o){g.add(l),d(F,l,o)}return{get:function(l){return h.get(l)},has:function(l){return h.has(l)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return b},get grandTotal(){return w},get queryGen(){return L},get size(){return h.size},ensure:function(l,o){clearTimeout(q),I=l;for(let m=l;m<o;m++)h.has(m)&&N(m);if(b<=0)return;const c=Math.max(0,l-s),_=Math.min(b,o+s),p=Math.floor(c/r),S=Math.floor(Math.max(0,_-1)/r);let E=-1;for(let m=p;m<=S;m++){const y=m*r,k=Math.min(r,b-y);let W=!1;const B=Math.max(y,c),R=Math.min(y+k,_);for(let O=B;O<R;O++)if(!h.has(O)){W=!0;break}if(W&&!g.has(y)){E=y;break}}E!==-1&&(q=setTimeout(function(){n(E,r)},a))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==L)return!1;const o=l.offset||0,c=l.data||[];let _=0;for(let p=0;p<c.length;p++)c[p]!=null&&_++;if(_===0&&(l.provisional||l.filtered>0))return g.delete(o),!1;x&&(h.clear(),f.clear(),x=!1),l.provisional||(w=l.total!=null?l.total:w,b=l.filtered!=null?l.filtered:l.data?l.data.length:b);for(let p=0;p<c.length;p++)c[p]!=null&&(h.set(o+p,c[p]),N(o+p));return g.delete(o),e(),u(),!0},requestInitial:function(l){l&&(F=l),n(0,r)},invalidate:function(l){L++,g.clear(),clearTimeout(q),l&&(F=l),x=!0,n(0,r)},revalidate:function(){L++,g.clear(),clearTimeout(q),x=!0;const l=Math.max(0,Math.floor(I/r)*r);n(l,r)},release:function(l){g.delete(l)},destroy:function(){clearTimeout(q),h.clear(),f.clear(),g.clear()},configure:function(l){l=l||{};let o=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==i){const c=l.windowSize<i;i=l.windowSize,c&&e(),o=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(s=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(a=l.fetchDebounce),o&&u()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(w=l,C()||(b=l),u())}}}function dt(t){return(t||"").replace(/^#/,"")}function J(t){const i=t===void 0?location.hash:t,r={},s=dt(i);if(!s)return r;const a=s.split("&");for(let d=0;d<a.length;d++){const u=a[d];if(!u)continue;const h=u.indexOf(":"),f=h>-1?u.slice(0,h):u,g=h>-1?u.slice(h+1):"";if(f)try{r[f]=decodeURIComponent(g)}catch{r[f]=g}}return r}function Bt(t){if(!t)return null;const i=J();return t in i?i[t]:null}function Vt(t,i){if(!t)return;const r=J();i==null?delete r[t]:r[t]=String(i);const a=Object.keys(r).map(function(d){const u=r[d];return u===""?d:d+":"+encodeURIComponent(u)}).join("&");dt(location.hash)!==a&&(location.hash=a)}function $t(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(t,i){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?i?s+"-"+i:s:i||null}function Ut(t,i){return!i||i==="none"||t===null||t===void 0?null:String(t)+"."+i}function jt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Gt(t,i){return!t||!Array.isArray(i)||i.length===0?null:t+":"+i.map(encodeURIComponent).join(",")}function Pt(t){if(!t||typeof t!="string")return null;const i=t.indexOf(":");if(i===-1)return null;const r=t.slice(0,i),s=t.slice(i+1),a=s?s.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:r,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=J,window.lnCore.hashGet=Bt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=$t,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=Ut,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Gt,window.lnCore.hashFilterDecode=Pt),(function(){const t="data-ln-list",i="lnList",r="data-ln-list-empty";if(window[i]!==void 0)return;function f(e,n){if(!e||!e.isDataDriven)return;const l=e.dom.hasAttribute("data-ln-list-window");if(l&&!e._windowed)e._enterWindowedMode(),e._kickWindowInitial();else if(!l&&e._windowed)e._exitWindowedMode();else if(l&&e._windowed){const o=parseInt(n,10);o>0&&e._cache.configure({windowSize:o})}}function g(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>0&&e._cache.configure({pageSize:l})}function b(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>=0&&e._cache.configure({threshold:l})}function w(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>=0&&e._cache.setGrandTotal(l)}const L={"data-ln-list":{prop:"name",type:"string",read:z,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:z,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:rt,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:f,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:g,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:b,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:w,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},F=Et(L);function q(e,n){if(e==null||isNaN(e))return"";try{return new Intl.NumberFormat(et(n)).format(e)}catch{return String(e)}}function M(e){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const o=getComputedStyle(n).overflowY;if(o==="auto"||o==="scroll")return n;n=n.parentElement}return null}function I(e){const n=e._scrollContainer||M(e.dom);return{container:n,top:n?n.scrollTop:window.scrollY}}function x(e){e.container?e.container.scrollTop=e.top:window.scrollTo(window.scrollX,e.top)}function N(e){if(!e)return 0;const n=getComputedStyle(e),l=parseFloat(n.marginTop)||0,o=parseFloat(n.marginBottom)||0;return e.offsetHeight+l+o}function C(e){this.dom=e,At(this,e,F),this.tbody=e.querySelector("[data-ln-list-body]")||e,this.isDataDriven=e.hasAttribute("data-ln-list-source"),this._totalSpan=e.querySelector("[data-ln-list-total]"),this._filteredSpan=e.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==e?this._filteredSpan.parentElement:null),this._selectedSpan=e.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==e?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const n=this;return this._onSetSearch=function(l){const o=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();n.isDataDriven?(n.currentSearch=o,D(e,"ln-list:search",{list:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=o.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},e.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(l){l.preventDefault(),n._onSetSearch(l)},e.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",D(e,"ln-list:clear-filters",{list:n.name}),n._requestData()):(n._searchTerm="",n._filters={},n._sortField=null,n._sortDir=null,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},e.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,e.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(l){const o=l.detail||{},c=o.data||[],_=o.total!=null?o.total:c.length;if(!(n._hasInitialSeed&&!n.isLoaded&&c.length===0&&_===0)){if(n._windowed){n._cache.ingest(o)&&!o.provisional&&e.classList.remove("ln-list--loading");return}n._data=c,n._lastTotal=_,n._lastFiltered=o.filtered!=null?o.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._hasInitialSeed=!1,e.classList.remove("ln-list--loading"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),D(e,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount})}},e.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(l){const o=l.detail&&l.detail.loading;e.classList.toggle("ln-list--loading",!!o),o&&(n.isLoaded=!1)},e.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!n._windowed||!n._cache||n._cache.release(l.detail&&l.detail.offset)},e.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!n._windowed||!n._cache||n._cache.revalidate()},e.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!n._windowed||!n._cache||n._requestData()},e.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(l){l.detail.field!=null&&(l.preventDefault(),n.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},n._requestData())},e.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const o=l.target.closest("[data-ln-item]");if(!o)return;const c=o.getAttribute("data-ln-item-id"),_=o._lnRecord||{};D(e,"ln-list:item-click",{list:n.name,id:c,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const o=l.target.closest("[data-ln-item-action]");if(!o)return;const c=o.closest("[data-ln-item]");if(!c)return;const _=o.getAttribute("data-ln-item-action"),p=c.getAttribute("data-ln-item-id"),S=c._lnRecord||{};D(e,"ln-list:item-action",{list:n.name,id:p,action:_,record:S})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(e,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){n.tbody.children.length>0&&(n._emptyObserver.disconnect(),n._emptyObserver=null,n._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(l){if(l.preventDefault(),!l.detail)return;const o=l.detail.key,c=l.detail.values||[];if(o){if(c.length===0)delete n._filters[o];else{const _=[];for(let p=0;p<c.length;p++)_.push(c[p].toLowerCase());n._filters[o]=_}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},e.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(l){if(l.detail&&l.detail.field==null)return;l.preventDefault();const o=l.detail&&l.detail.direction==="none"?null:l.detail&&l.detail.direction;n._sortField=o===null?null:l.detail&&l.detail.field,n._sortDir=o,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:sorted",{field:n._sortField,direction:l.detail&&l.detail.direction,matched:n._filteredData.length,total:n._data.length})},e.addEventListener("ln-sort:change",this._onSort)),this}C.prototype._parseChildren=function(){const e=Array.from(this.tbody.children).filter(n=>!n.classList.contains("ln-list__spacer"));this._data=[],e.length>0&&(this._itemHeight=N(e[0])||50);for(let n=0;n<e.length;n++){const l=e[n],o=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),c=l.textContent.trim().toLowerCase();let _=null;if(this.isDataDriven){_={},o!=null&&(_.id=o);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const y=E[m],k=y.getAttribute("data-ln-list-field");k&&(_[k]=Z(y))}}const p={},S=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<S.length;E++){const m=S[E],y=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");y&&(p[y]=Z(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const y=m.name.slice(5);y&&(p[y]=m.value)}}this._data.push({html:l.outerHTML,id:o,searchText:c,fields:p,..._||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},C.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const e=this._searchTerm,n=e?e.split(/\s+/).filter(Boolean):[],l=this._filters||{},o=Object.keys(l).length>0;if(n.length===0&&!o?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(c){if(n.length>0&&!n.every(function(p){return c.searchText&&c.searchText.indexOf(p)!==-1}))return!1;if(o)for(const _ in l){const p=l[_];if(p&&p.length>0){const S=c.fields&&c.fields[_]!==void 0?c.fields[_]:c[_]!==void 0?c[_]:null,E=S!=null?String(S).toLowerCase():"";if(p.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const c=this._sortField,_=this._sortDir==="desc"?-1:1,p=typeof Intl<"u"?new Intl.Collator(et(this.dom),{sensitivity:"base"}):null,S=this._filteredData.map(function(m){return m.fields&&m.fields[c]!==void 0?m.fields[c]:m[c]}),E=Ht(S);this._filteredData.sort(function(m,y){const k=m.fields&&m.fields[c]!==void 0?m.fields[c]:m[c],W=y.fields&&y.fields[c]!==void 0?y.fields[c]:y[c];return Mt(k,W,E,p)*_})}}},C.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const e=this._lastTotal,n=this.visibleCount;if(e===0||this._filteredData.length===0||n===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const e=this._filteredData.length;e===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):e>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},C.prototype._renderAll=function(){if(this.isDataDriven){const e=this._filteredData,n=document.createDocumentFragment();for(let o=0;o<e.length;o++){const c=this._buildItem(e[o]);c&&n.appendChild(c)}const l=I(this);this.tbody.replaceChildren(n),x(l),this._selectable&&this._updateSelectAll()}else{const e=[],n=this._filteredData;for(let o=0;o<n.length;o++)e.push(n[o].html);const l=I(this);this.tbody.innerHTML=e.join(""),x(l),this._selectable&&this._restoreSelection()}},C.prototype._readGridLayout=function(){const e=getComputedStyle(this.tbody),n=e.gridTemplateColumns;let l=1;if(n&&n!=="none"){const c=n.trim().split(/\s+/).filter(Boolean);c.length>0&&(l=c.length)}const o=parseFloat(e.rowGap);return{columns:l,rowGap:isNaN(o)?0:o}},C.prototype._measureItemHeight=function(){if(this._windowed){const e=this._cache.peek(),n=e?this._buildItem(e):this._buildPlaceholderItem();n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=N(n)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const e=this._buildItem(this._data[0]);e&&(this.tbody.textContent="",this.tbody.appendChild(e),this._itemHeight=N(e)||50,this.tbody.textContent="")}}else{const e=this.tbody.children;e.length>0&&(this._itemHeight=N(e[0])||50)}},C.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const e=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=M(this.dom);const n=this._scrollContainer||window;this._scrollHandler=function(){e._rafId||(e._rafId=requestAnimationFrame(function(){e._rafId=null,e._windowed?e._renderWindowed():e._renderVirtual()}))},this._resizeHandler=function(){e._itemHeight=0,e._measureItemHeight(),e._vStart=-1,e._vEnd=-1,e._windowed?e._renderWindowed():e._renderVirtual()},n.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},C.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},C.prototype._renderVirtual=function(){const e=this._filteredData,n=e.length,l=this._itemHeight;if(!l||!n)return;const o=this._scrollContainer;let c,_;if(o){const T=this.tbody.getBoundingClientRect(),A=o.getBoundingClientRect(),v=o===this.tbody?0:T.top-A.top+o.scrollTop;c=o.scrollTop-v,_=o.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;c=window.scrollY-A,_=window.innerHeight}const p=this._readGridLayout(),S=p.columns,E=p.rowGap,m=l+E,y=Math.ceil(n/S);let k=Math.max(0,Math.floor(c/m)-15);k=Math.min(k,y);const W=Math.ceil(_/m)+30,B=Math.min(k+W,y),R=Math.min(k*S,n),O=Math.min(B*S,n);if(R===this._vStart&&O===this._vEnd)return;this._vStart=R,this._vEnd=O;const V=k*m,H=(y-B)*m;if(this.isDataDriven){const T=document.createDocumentFragment();if(V>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=V+"px",T.appendChild(v)}for(let v=R;v<O;v++){const U=this._buildItem(e[v]);U&&T.appendChild(U)}if(H>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=H+"px",T.appendChild(v)}const A=I(this);this.tbody.replaceChildren(T),x(A),this._selectable&&this._updateSelectAll()}else{let T="";V>0&&(T+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${V}px"></${this.isUl?"li":"div"}>`);for(let v=R;v<O;v++)T+=e[v].html;H>0&&(T+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=T,x(A),this._selectable&&this._restoreSelection()}},C.prototype._buildPlaceholderItem=function(){const e=document.createElement(this.isUl?"li":"div");return e.className="ln-list__placeholder",e.setAttribute("aria-hidden","true"),e.style.height=this._itemHeight+"px",e},C.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const e=this._itemHeight;if(!e)return;const n=this._scrollContainer;let l,o;if(n){const A=this.tbody.getBoundingClientRect(),v=n.getBoundingClientRect(),U=n===this.tbody?0:A.top-v.top+n.scrollTop;l=n.scrollTop-U,o=n.clientHeight}else{const v=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-v,o=window.innerHeight}const c=this._readGridLayout(),_=c.columns,p=c.rowGap,S=e+p,E=this._cache.logicalTotal,m=Math.ceil(E/_);let y=Math.max(0,Math.floor(l/S)-15);y=Math.min(y,m);const k=Math.ceil(o/S)+30,W=Math.min(y+k,m),B=Math.min(y*_,E),R=Math.min(W*_,E),O=y*S,V=(m-W)*S,H=document.createDocumentFragment();if(O>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=O+"px",H.appendChild(A)}for(let A=B;A<R;A++)if(this._cache.has(A)){const v=this._buildItem(this._cache.get(A));v&&H.appendChild(v)}else H.appendChild(this._buildPlaceholderItem());if(V>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=V+"px",H.appendChild(A)}const T=I(this);this.tbody.replaceChildren(H),x(T),this._vStart=B,this._vEnd=R,this._cache.ensure(B,R)},C.prototype._showEmptyState=function(){let e=null;if(this.isDataDriven){const n=this._lastTotal!=null?this._lastTotal:this._data.length,o=this.visibleCount===0&&n>0,c=o?this.name+"-empty-filtered":this.name+"-empty";if(e=lt(this.dom,c,"ln-list"),!e){const _=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(_){const p=o?"search":"initial",S=_.content.querySelector(`[data-ln-empty-when="${p}"]`)||_.content.firstElementChild;S&&(e=document.importNode(S,!0))}}}else{const n=this.dom.querySelector(`template[${r}]`);if(n){const l=n.content.firstElementChild;l&&(e=document.importNode(l,!0))}}if(e)if(e.tagName==="LI"||e.tagName==="TR")this.tbody.replaceChildren(e);else{const n=document.createElement(this.isUl?"li":"div");n.appendChild(e),this.tbody.replaceChildren(n)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},C.prototype._buildItem=function(e){let n=lt(this.dom,this.name+"-row","ln-list");if(!n){const o=this.dom.querySelector("template[data-ln-item]");o&&(n=document.importNode(o.content,!0))}let l=n?n.querySelector("[data-ln-item]")||n.firstElementChild:null;if(l)Y(l,e),P(l,e);else if(e&&e.html){const o=document.createElement(this.isUl?"ul":"div");o.innerHTML=e.html,l=o.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),e&&typeof e=="object"){for(const o in e)if(o!=="html"&&e[o]!=null){const c=document.createElement("span");c.setAttribute("data-ln-field",o),c.textContent=String(e[o]),l.appendChild(c)}}if(l._lnRecord=e,e&&e.id!=null&&(l.setAttribute("data-ln-item-id",e.id),this._selectable&&this.selectedIds.has(String(e.id)))){l.classList.add("ln-item-selected");const o=l.querySelector("[data-ln-item-select]");o&&(o.checked=!0)}return l},C.prototype._restoreSelection=function(){if(!this.tbody)return;const e=this.tbody.querySelectorAll("[data-ln-item]");for(let n=0;n<e.length;n++){const l=e[n].getAttribute("data-ln-item-id"),o=l!=null&&this.selectedIds.has(String(l));e[n].classList.toggle("ln-item-selected",o);const c=e[n].querySelector("[data-ln-item-select]");c&&(c.checked=o)}this._updateSelectAll()},C.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const e=this;this._onSelectionChange=function(n){const l=n.target.closest("[data-ln-item-select]");if(!l)return;const o=l.closest("[data-ln-item]");if(!o)return;const c=o.getAttribute("data-ln-item-id");c!=null&&(l.checked?(e.selectedIds.add(String(c)),o.classList.add("ln-item-selected")):(e.selectedIds.delete(String(c)),o.classList.remove("ln-item-selected")),e._updateSelectAll(),e._updateFooter(),D(e.dom,"ln-list:select",{list:e.name,selectedIds:e.selectedIds,count:e.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const n=e._selectAllCheckbox.checked,l=e.tbody.querySelectorAll("[data-ln-item]");for(let o=0;o<l.length;o++){const c=l[o],_=c.getAttribute("data-ln-item-id"),p=c.querySelector("[data-ln-item-select]");_!=null&&(n?(e.selectedIds.add(String(_)),c.classList.add("ln-item-selected")):(e.selectedIds.delete(String(_)),c.classList.remove("ln-item-selected")),p&&(p.checked=n))}D(e.dom,"ln-list:select-all",{list:e.name,selected:n}),D(e.dom,"ln-list:select",{list:e.name,selectedIds:e.selectedIds,count:e.selectedIds.size}),e._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},C.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const e=this.tbody.querySelectorAll("[data-ln-item]");let n=e.length>0;for(let l=0;l<e.length;l++){const o=e[l].getAttribute("data-ln-item-id");if(o!=null&&!this.selectedIds.has(String(o))){n=!1;break}}this._selectAllCheckbox.checked=n},C.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}ut(this,"ln-list:request-data","list")},C.prototype._enterWindowedMode=function(){const e=this,n=this.dom,l=parseInt(n.getAttribute("data-ln-list-window"),10),o=parseInt(n.getAttribute("data-ln-list-window-page"),10),c=parseInt(n.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!e._windowed||!e._cache||(e.totalCount=e._cache.grandTotal,e.visibleCount=e._cache.logicalTotal,e._lastTotal=e._cache.grandTotal,e.isLoaded=!0,e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter(),D(n,"ln-list:rendered",{list:e.name,total:e.totalCount,visible:e.visibleCount}))},this._renderBatch=Nt(this._onCacheChange),this._cache=Wt({windowSize:l>0?l:1e3,pageSize:o>0?o:200,threshold:c>=0?c:25,fetchDebounce:120,requestPage:function(_,p,S){D(n,"ln-list:request-data",{list:e.name,sort:_.sort,filters:_.filters,search:_.search,offset:p,limit:S,queryGen:e._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},C.prototype._kickWindowInitial=function(){if(this._data.length>0){const e=parseInt(this.dom.getAttribute("data-ln-list-count"),10),n=e>0?e:this._data.length;this._cache.ingest({data:this._data,offset:0,total:n,filtered:n})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},C.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},C.prototype._updateFooter=function(){let e=0,n=0;this.isDataDriven?(e=this._lastTotal!=null?this._lastTotal:this._data.length,n=this.visibleCount):(e=this._data.length,n=this._filteredData.length);const l=n<e;if(this._totalSpan&&(this._totalSpan.textContent=q(e,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(n,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?q(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},C.prototype.destroy=function(){this.dom[i]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[i])},Rt(t,i,C,"ln-list",{attributes:L})})()})();
|
|
1
|
+
(function(){"use strict";function X(){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 j(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const i=t.closest("[data-ln-debug]");return!(!i||typeof document<"u"&&i===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 t=console.warn;console.warn=function(...i){if(typeof i[0]=="string"&&(i[0].startsWith("[ln-")||i[0].startsWith("[lnCore"))){let s=null;for(let a=1;a<i.length;a++)if(i[a]&&i[a].nodeType===1){s=i[a];break}if(!j(s))return}t.apply(console,i)}}function D(t,i,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",i,t,s),t.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:s}))}function ut(t,i,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const s={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};s[r]=t.name,D(t.dom,i,s)}function $(t,i){if(!document.body){document.addEventListener("DOMContentLoaded",function(){$(t,i)}),console.warn("["+i+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function Z(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}const tt={};function ht(t,i){tt[t]=i}function ft(t){return tt[t]||{ingress:i=>i,egress:i=>i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ht,window.lnCore.getDataMapper=ft);function et(t){const i=t?t.closest("[lang]"):null,r=(i?i.getAttribute("lang")||i.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function _t(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,$(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const nt={};function pt(t,i){if(!t||typeof i!="object")return;const r=t.toLowerCase().split("-")[0];nt[r]=i}function gt(t){if(!t)return null;const i=t.toLowerCase().split("-")[0];return nt[i]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pt,window.lnCore.getLocaleFallback=gt,window.lnCore.ensureLocaleObserver=_t);const G={};function it(t,i){G[t]||(G[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=G[t];return r?r.content.cloneNode(!0):(console.warn("["+(i||"ln-core")+'] Template "'+t+'" not found'),null)}function lt(t,i,r){if(t){const s=t.querySelector('[data-ln-template="'+i+'"]');if(s)return s.content.cloneNode(!0)}return it(i,r)}function P(t,i){if(!t||!i)return t;const r=t.querySelectorAll("[data-ln-field]");for(let u=0;u<r.length;u++){const h=r[u],f=h.getAttribute("data-ln-field");i[f]!=null&&(h.textContent=i[f])}const s=t.querySelectorAll("[data-ln-attr]");for(let u=0;u<s.length;u++){const h=s[u],f=h.getAttribute("data-ln-attr").split(",");for(let g=0;g<f.length;g++){const b=f[g].trim().split(":");if(b.length!==2)continue;const w=b[0].trim(),L=b[1].trim();i[L]!=null&&h.setAttribute(w,i[L])}}const a=t.querySelectorAll("[data-ln-show]");for(let u=0;u<a.length;u++){const h=a[u],f=h.getAttribute("data-ln-show");f in i&&h.classList.toggle("hidden",!i[f])}const d=t.querySelectorAll("[data-ln-class]");for(let u=0;u<d.length;u++){const h=d[u],f=h.getAttribute("data-ln-class").split(",");for(let g=0;g<f.length;g++){const b=f[g].trim().split(":");if(b.length!==2)continue;const w=b[0].trim(),L=b[1].trim();L in i&&h.classList.toggle(w,!!i[L])}}return t}function mt(t,i){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,i??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:i??null,bubbles:!0})));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],i??null),r[s].dispatchEvent(new CustomEvent("ln-fill",{detail:i??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)P(t.target,t.detail);else{const i=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<i.length;r++)i[r].textContent=""}})));function Y(t,i){if(!t||!i)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const d=r.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(u,h){return i[h]!==void 0?i[h]:""}))}const s=function(d,u){return i[u]!==void 0?i[u]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let d=0;d<a.length;d++){const u=a[d],h=u.attributes;for(let f=0;f<h.length;f++){const g=h[f];g.value.indexOf("{{")!==-1&&u.setAttribute(g.name,g.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function bt(t,i,r,s,a,d){const u={};for(let f=0;f<t.children.length;f++){const g=t.children[f],b=g.getAttribute("data-ln-render-key");b&&(u[b]=g)}const h=document.createDocumentFragment();for(let f=0;f<i.length;f++){const g=i[f],b=String(s(g));let w=u[b];if(w)a(w,g,f);else{const L=it(r,d);if(!L||(Y(L,g),w=L.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",b),a(w,g,f)}h.appendChild(w)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=P,window.lnCore.lnFill=mt,window.lnCore.renderList=bt);function z(t,i,r){const s=t.getAttribute(i);return s===null?r:s}function wt(t,i,r){const s=parseInt(t.getAttribute(i),10);return isNaN(s)?r:s}function rt(t,i,r=!1){const s=t.getAttribute(i);if(s===null)return!!r;const a=s.trim().toLowerCase();return!(a==="false"||a==="0")}function yt(t,i){return(t.getAttribute(i)||"").split(",").map(r=>r.trim()).filter(Boolean)}const K=new Map;function Ct(t,i){const r=(t?t.join("|"):"")+"::"+i;if(K.has(r))return K.get(r);const s=new Set(t||[]),a=function(d,u){const h=d.getAttribute(u);return h!==null&&s.has(h)?h:i};return K.set(r,a),a}function vt(t,i,r){const s=parseFloat(t.getAttribute(i));return isNaN(s)?r:s}function St(t,i,r){const s=t.getAttribute(i);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function st(t,i,r,s,a){if(!t||i===null)return!0;const d=s||"ln-component",u=t.type;if(u==="trigger"||u==="marker"||u==="string"||u==="list"||!u||i===""&&t.fallback!==void 0)return!0;const h=f=>{a?console.warn(f,a):console.warn(f)};if(u==="boolean"){const f=i.trim().toLowerCase();return f!==""&&f!=="true"&&f!=="false"&&f!=="1"&&f!=="0"?(h(`[${d}] Invalid value "${i}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(u==="enum"){const f=t.values||[];return f.includes(i)?!0:(h(`[${d}] Invalid value "${i}" for attribute "${r}". Allowed: ${f.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(u==="integer"){if(!/^-?\d+$/.test(i))return h(`[${d}] Invalid integer "${i}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const f=parseInt(i,10);return t.min!==void 0&&f<t.min?(h(`[${d}] Value ${f} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&f>t.max?(h(`[${d}] Value ${f} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(u==="float")return isNaN(Number(i))?(h(`[${d}] Invalid float "${i}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(u==="json")try{return JSON.parse(i),!0}catch(f){return h(`[${d}] Invalid JSON for attribute "${r}": ${f.message}. Fallback: ${t.fallback}.`),!1}return!0}function At(t,i,r){for(const s in r){const[a,d,u]=r[s];Object.defineProperty(t,s,{get:function(){return a(i,d,u)},enumerable:!0,configurable:!0})}return t}function Et(t){const i={};for(const r in t){const s=t[r];if(!s||!s.prop)continue;let a=s.read;if(!a&&s.type)switch(s.type){case"enum":a=Ct(s.values,s.fallback);break;case"integer":a=wt;break;case"float":a=vt;break;case"boolean":a=rt;break;case"list":a=yt;break;case"json":a=St;break;case"string":default:a=z;break}a||(a=z),i[s.prop]=[a,r,s.fallback]}return i}function Dt(t){const i={};for(const r in t){const s=t[r];s&&s.effect&&(i[r]=s.effect)}return Object.keys(i).length?i:null}function Lt(t){if(t.onAttrChange&&!t.declared)return null;const i=new Set;if(t.effects)for(const r in t.effects)i.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)i.add(r);return i}function Q(t,i,r,s){if(t.nodeType!==1)return;const d=i.indexOf("[")!==-1||i.indexOf(".")!==-1||i.indexOf("#")!==-1?i:"["+i+"]",u=Array.from(t.querySelectorAll(d));t.matches&&t.matches(d)&&u.push(t);for(const h of u)if(!h[r]){window.lnCore._persistSink&&h.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(h,i);try{h[r]=new s(h)}catch(f){console.error("["+r+"] init failed",h,f)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function kt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Tt(t){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(t):setTimeout(t,0)):t()}function ot(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function It(t){const i=ot(),r=t.observed||[];for(let s=0;s<r.length;s++){const a=r[s];i.byAttr.has(a)||i.byAttr.set(a,[]),i.byAttr.get(a).push(t)}if(i.byDeclaredAttr=i.byDeclaredAttr||new Map,t.attributes)for(const s in t.attributes){i.byDeclaredAttr.has(s)||i.byDeclaredAttr.set(s,[]);const a=i.byDeclaredAttr.get(s);a.some(d=>d.componentTag===t.componentTag)||a.push({spec:t.attributes[s],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){i.reactive.push(t);const s=Lt(t);if(s===null)i.reactiveWildcard.push(t);else for(const a of s)i.byReactive.has(a)||i.byReactive.set(a,[]),i.byReactive.get(a).push(t)}t.persist&&i.persist.push(t)}function at(t,i,r,s){for(let a=0;a<t.length;a++){const d=t[a];if(!i[d.attribute])continue;const u=d.effects&&d.effects[r];u?u(i,r,s):d.onAttrChange&&(!d.declared||d.declared.has(r))&&d.onAttrChange(i,r,s)}}function Ft(t){const i=t.target,r=t.attributeName;if(t.oldValue===i.getAttribute(r))return;const s=ot(),a=s.byAttr.get(r);if(X()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(r)&&j(i)){const d=s.byDeclaredAttr.get(r),u=i.getAttribute(r);for(let h=0;h<d.length;h++)st(d[h].spec,u,r,d[h].componentTag,i)}if(window.lnCore._debugSink&&(r.indexOf("data-ln-")===0||a)&&window.lnCore._debugSink("attr",r,i,{oldValue:t.oldValue,newValue:i.getAttribute(r)}),r.indexOf("data-ln-")===0){const d=s.byReactive.get(r);d&&at(d,i,r,t.oldValue),s.reactiveWildcard.length&&at(s.reactiveWildcard,i,r,t.oldValue)}if(a)for(let d=0;d<a.length;d++){const u=a[d];if(u.handler){u.handler(i,r,t.oldValue);continue}u.onAttributeChange&&i[u.attribute]?u.onAttributeChange(i,r):(Q(i,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(i))}}function qt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(i){for(let r=0;r<i.length;r++)try{Ft(i[r])}catch(s){console.error("[ln-core] mutation handler failed",i[r].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ct(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function xt(t){const i=ct();if(i.length){if(t.target)for(let r=0;r<i.length;r++){const s=i[r];if(s.onSubtreeChange){const a=s.query,d=t.target.nodeType===1?t.target.matches(a)?t.target:t.target.closest(a):t.target.parentElement?t.target.parentElement.closest(a):null;d&&s.onSubtreeChange(d,t)}}for(let r=0;r<t.addedNodes.length;r++){const s=t.addedNodes[r];if(s.nodeType===1)for(let a=0;a<i.length;a++){const d=i[a];Q(s,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(s)}}for(let r=0;r<t.removedNodes.length;r++){const s=t.removedNodes[r];if(s.nodeType===1)for(let a=0;a<i.length;a++){const d=i[a],u=d.query,h=Array.from(s.querySelectorAll(u));s.matches&&s.matches(u)&&h.push(s);for(let f=0;f<h.length;f++){const g=h[f];if(!document.contains(g)){const b=g[d.attribute];if(b&&typeof b.destroy=="function")try{b.destroy()}catch(w){console.error("["+d.attribute+"] destroy failed",g,w)}delete g[d.attribute]}}}}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){new MutationObserver(function(i){for(let r=0;r<i.length;r++){const s=i[r];if(s.type==="childList")try{xt(s)}catch(a){console.error("[ln-core] lifecycle handler failed",s.target,a)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Rt(t,i,r,s,a={}){const d=a.extraAttributes||[],u=a.onAttributeChange||null,h=a.onSubtreeChange||null,f=a.onInit||null,g=a.onAttrChange||null,b=a.effects||null,w=a.attributes||null,L=w?Dt(w):b,F=w?new Set(Object.keys(w)):null,q=a.persist||null;function M(e){const n=e||document.body;if(Q(n,t,i,r),w&&X())for(const l in w){const o=w[l],c=Array.from(n.querySelectorAll("["+l+"]"));n.matches&&n.matches("["+l+"]")&&c.push(n);for(let _=0;_<c.length;_++){const p=c[_];j(p)&&st(o,p.getAttribute(l),l,s,p)}}f&&f(n)}const I=[];if(t.indexOf("[")!==-1){const e=/\[([\w-]+)/g;let n;for(;(n=e.exec(t))!==null;)I.push(n[1])}else I.push(t);It({selector:t,attribute:i,componentTag:s,attributes:w,ComponentFn:r,onInit:f,observed:I.concat(d),onAttributeChange:u,onAttrChange:g,effects:L,declared:F,persist:q}),qt();const N=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";ct().push({selector:t,attribute:i,ComponentFn:r,onInit:f,onSubtreeChange:h,query:N}),Ot(),window[i]=M;function C(){kt()>0?Tt(function(){M(document.body)}):M(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",C):C(),M}function Ht(t){let i=!1;for(let r=0;r<t.length;r++){const s=t[r];if(!(s===""||s==null)&&(i=!0,!Number.isFinite(Number(s))))return"string"}return i?"number":"string"}function Mt(t,i,r,s){if(r==="number"){const u=parseFloat(t),h=parseFloat(i);return(isNaN(u)?0:u)-(isNaN(h)?0:h)}const a=t!=null?String(t):"",d=i!=null?String(i):"";return s?s.compare(a,d):a<d?-1:a>d?1:0}function Nt(t,i){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function Wt(t){t=t||{};let i=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,s=t.threshold!=null?t.threshold:25,a=t.fetchDebounce!=null?t.fetchDebounce:120;const d=typeof t.requestPage=="function"?t.requestPage:function(){},u=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,f=new Map,g=new Set;let b=0,w=0,L=0,F={sort:null,filters:{},search:""},q=null,M=0,I=0,x=!1;function N(l){f.set(l,++M)}function C(){return!!(F&&(F.search||F.filters&&Object.keys(F.filters).length))}function e(){if(h.size<=i)return;const l=Array.from(h.keys()).sort(function(c,_){return(f.get(c)||0)-(f.get(_)||0)});let o=0;for(;h.size>i&&o<l.length;)h.delete(l[o]),f.delete(l[o]),o++}function n(l,o){g.add(l),d(F,l,o)}return{get:function(l){return h.get(l)},has:function(l){return h.has(l)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return b},get grandTotal(){return w},get queryGen(){return L},get size(){return h.size},ensure:function(l,o){clearTimeout(q),I=l;for(let m=l;m<o;m++)h.has(m)&&N(m);if(b<=0)return;const c=Math.max(0,l-s),_=Math.min(b,o+s),p=Math.floor(c/r),S=Math.floor(Math.max(0,_-1)/r);let E=-1;for(let m=p;m<=S;m++){const y=m*r,k=Math.min(r,b-y);let W=!1;const B=Math.max(y,c),R=Math.min(y+k,_);for(let O=B;O<R;O++)if(!h.has(O)){W=!0;break}if(W&&!g.has(y)){E=y;break}}E!==-1&&(q=setTimeout(function(){n(E,r)},a))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==L)return!1;const o=l.offset||0,c=l.data||[];let _=0;for(let p=0;p<c.length;p++)c[p]!=null&&_++;if(_===0&&(l.provisional||l.filtered>0))return g.delete(o),!1;x&&(h.clear(),f.clear(),x=!1),l.provisional||(w=l.total!=null?l.total:w,b=l.filtered!=null?l.filtered:l.data?l.data.length:b);for(let p=0;p<c.length;p++)c[p]!=null&&(h.set(o+p,c[p]),N(o+p));return g.delete(o),e(),u(),!0},requestInitial:function(l){l&&(F=l),n(0,r)},invalidate:function(l){L++,g.clear(),clearTimeout(q),l&&(F=l),x=!0,n(0,r)},revalidate:function(){L++,g.clear(),clearTimeout(q),x=!0;const l=Math.max(0,Math.floor(I/r)*r);n(l,r)},release:function(l){g.delete(l)},destroy:function(){clearTimeout(q),h.clear(),f.clear(),g.clear()},configure:function(l){l=l||{};let o=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==i){const c=l.windowSize<i;i=l.windowSize,c&&e(),o=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(s=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(a=l.fetchDebounce),o&&u()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(w=l,C()||(b=l),u())}}}function dt(t){return(t||"").replace(/^#/,"")}function J(t){const i=t===void 0?location.hash:t,r={},s=dt(i);if(!s)return r;const a=s.split("&");for(let d=0;d<a.length;d++){const u=a[d];if(!u)continue;const h=u.indexOf(":"),f=h>-1?u.slice(0,h):u,g=h>-1?u.slice(h+1):"";if(f)try{r[f]=decodeURIComponent(g)}catch{r[f]=g}}return r}function Bt(t){if(!t)return null;const i=J();return t in i?i[t]:null}function Vt(t,i){if(!t)return;const r=J();i==null?delete r[t]:r[t]=String(i);const a=Object.keys(r).map(function(d){const u=r[d];return u===""?d:d+":"+encodeURIComponent(u)}).join("&");dt(location.hash)!==a&&(location.hash=a)}function $t(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(t,i){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?i?s+"-"+i:s:i||null}function Ut(t,i){return!i||i==="none"||t===null||t===void 0?null:String(t)+"."+i}function jt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Gt(t,i){return!t||!Array.isArray(i)||i.length===0?null:t+":"+i.map(encodeURIComponent).join(",")}function Pt(t){if(!t||typeof t!="string")return null;const i=t.indexOf(":");if(i===-1)return null;const r=t.slice(0,i),s=t.slice(i+1),a=s?s.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:r,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=J,window.lnCore.hashGet=Bt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=$t,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=Ut,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Gt,window.lnCore.hashFilterDecode=Pt),(function(){const t="data-ln-list",i="lnList",r="data-ln-list-empty";if(window[i]!==void 0)return;function f(e,n){if(!e||!e.isDataDriven)return;const l=e.dom.hasAttribute("data-ln-list-window");if(l&&!e._windowed)e._enterWindowedMode(),e._kickWindowInitial();else if(!l&&e._windowed)e._exitWindowedMode();else if(l&&e._windowed){const o=parseInt(n,10);o>0&&e._cache.configure({windowSize:o})}}function g(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>0&&e._cache.configure({pageSize:l})}function b(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>=0&&e._cache.configure({threshold:l})}function w(e,n){if(!e||!e.isDataDriven||!e._windowed||!e._cache)return;const l=parseInt(n,10);l>=0&&e._cache.setGrandTotal(l)}const L={"data-ln-list":{prop:"name",type:"string",read:z,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:z,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:rt,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:f,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:g,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:b,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:w,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},F=Et(L);function q(e,n){if(e==null||isNaN(e))return"";try{return new Intl.NumberFormat(et(n)).format(e)}catch{return String(e)}}function M(e){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const o=getComputedStyle(n).overflowY;if(o==="auto"||o==="scroll")return n;n=n.parentElement}return null}function I(e){const n=e._scrollContainer||M(e.dom);return{container:n,top:n?n.scrollTop:window.scrollY}}function x(e){e.container?e.container.scrollTop=e.top:window.scrollTo(window.scrollX,e.top)}function N(e){if(!e)return 0;const n=getComputedStyle(e),l=parseFloat(n.marginTop)||0,o=parseFloat(n.marginBottom)||0;return e.offsetHeight+l+o}function C(e){this.dom=e,At(this,e,F),this.tbody=e.querySelector("[data-ln-list-body]")||e,this.isDataDriven=e.hasAttribute("data-ln-list-source"),this._totalSpan=e.querySelector("[data-ln-list-total]"),this._filteredSpan=e.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==e?this._filteredSpan.parentElement:null),this._selectedSpan=e.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==e?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const n=this;return this._onSetSearch=function(l){const o=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();n.isDataDriven?(n.currentSearch=o,D(e,"ln-list:search",{list:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=o.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},e.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(l){l.preventDefault(),n._onSetSearch(l)},e.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",D(e,"ln-list:clear-filters",{list:n.name}),n._requestData()):(n._searchTerm="",n._filters={},n._sortField=null,n._sortDir=null,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},e.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,e.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(l){const o=l.detail||{},c=o.data||[],_=o.total!=null?o.total:c.length;if(!(n._hasInitialSeed&&!n.isLoaded&&c.length===0&&_===0)){if(n._windowed){n._cache.ingest(o)&&!o.provisional&&e.classList.remove("ln-list--loading");return}n._data=c,n._lastTotal=_,n._lastFiltered=o.filtered!=null?o.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._hasInitialSeed=!1,e.classList.remove("ln-list--loading"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),D(e,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount})}},e.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(l){const o=l.detail&&l.detail.loading;e.classList.toggle("ln-list--loading",!!o),o&&(n.isLoaded=!1)},e.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!n._windowed||!n._cache||n._cache.release(l.detail&&l.detail.offset)},e.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!n._windowed||!n._cache||n._cache.revalidate()},e.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!n._windowed||!n._cache||n._requestData()},e.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(l){!l.detail||l.detail.field==null||(l.preventDefault(),n.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},n._requestData())},e.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const o=l.target.closest("[data-ln-item]");if(!o)return;const c=o.getAttribute("data-ln-item-id"),_=o._lnRecord||{};D(e,"ln-list:item-click",{list:n.name,id:c,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const o=l.target.closest("[data-ln-item-action]");if(!o)return;const c=o.closest("[data-ln-item]");if(!c)return;const _=o.getAttribute("data-ln-item-action"),p=c.getAttribute("data-ln-item-id"),S=c._lnRecord||{};D(e,"ln-list:item-action",{list:n.name,id:p,action:_,record:S})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(e,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){n.tbody.children.length>0&&(n._emptyObserver.disconnect(),n._emptyObserver=null,n._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(l){if(l.preventDefault(),!l.detail)return;const o=l.detail.key,c=l.detail.values||[];if(o){if(c.length===0)delete n._filters[o];else{const _=[];for(let p=0;p<c.length;p++)_.push(c[p].toLowerCase());n._filters[o]=_}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},e.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(l){if(!l.detail||l.detail.field==null)return;l.preventDefault();const o=l.detail.direction==="none"?null:l.detail.direction;n._sortField=o===null?null:l.detail.field,n._sortDir=o,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(e,"ln-list:sorted",{field:n._sortField,direction:l.detail&&l.detail.direction,matched:n._filteredData.length,total:n._data.length})},e.addEventListener("ln-sort:change",this._onSort)),this}C.prototype._parseChildren=function(){const e=Array.from(this.tbody.children).filter(n=>!n.classList.contains("ln-list__spacer"));this._data=[],e.length>0&&(this._itemHeight=N(e[0])||50);for(let n=0;n<e.length;n++){const l=e[n],o=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),c=l.textContent.trim().toLowerCase();let _=null;if(this.isDataDriven){_={},o!=null&&(_.id=o);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const y=E[m],k=y.getAttribute("data-ln-list-field");k&&(_[k]=Z(y))}}const p={},S=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<S.length;E++){const m=S[E],y=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");y&&(p[y]=Z(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const y=m.name.slice(5);y&&(p[y]=m.value)}}this._data.push({html:l.outerHTML,id:o,searchText:c,fields:p,..._||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},C.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const e=this._searchTerm,n=e?e.split(/\s+/).filter(Boolean):[],l=this._filters||{},o=Object.keys(l).length>0;if(n.length===0&&!o?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(c){if(n.length>0&&!n.every(function(p){return c.searchText&&c.searchText.indexOf(p)!==-1}))return!1;if(o)for(const _ in l){const p=l[_];if(p&&p.length>0){const S=c.fields&&c.fields[_]!==void 0?c.fields[_]:c[_]!==void 0?c[_]:null,E=S!=null?String(S).toLowerCase():"";if(p.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const c=this._sortField,_=this._sortDir==="desc"?-1:1,p=typeof Intl<"u"?new Intl.Collator(et(this.dom),{sensitivity:"base"}):null,S=this._filteredData.map(function(m){return m.fields&&m.fields[c]!==void 0?m.fields[c]:m[c]}),E=Ht(S);this._filteredData.sort(function(m,y){const k=m.fields&&m.fields[c]!==void 0?m.fields[c]:m[c],W=y.fields&&y.fields[c]!==void 0?y.fields[c]:y[c];return Mt(k,W,E,p)*_})}}},C.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const e=this._lastTotal,n=this.visibleCount;if(e===0||this._filteredData.length===0||n===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const e=this._filteredData.length;e===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):e>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},C.prototype._renderAll=function(){if(this.isDataDriven){const e=this._filteredData,n=document.createDocumentFragment();for(let o=0;o<e.length;o++){const c=this._buildItem(e[o]);c&&n.appendChild(c)}const l=I(this);this.tbody.replaceChildren(n),x(l),this._selectable&&this._updateSelectAll()}else{const e=[],n=this._filteredData;for(let o=0;o<n.length;o++)e.push(n[o].html);const l=I(this);this.tbody.innerHTML=e.join(""),x(l),this._selectable&&this._restoreSelection()}},C.prototype._readGridLayout=function(){const e=getComputedStyle(this.tbody),n=e.gridTemplateColumns;let l=1;if(n&&n!=="none"){const c=n.trim().split(/\s+/).filter(Boolean);c.length>0&&(l=c.length)}const o=parseFloat(e.rowGap);return{columns:l,rowGap:isNaN(o)?0:o}},C.prototype._measureItemHeight=function(){if(this._windowed){const e=this._cache.peek(),n=e?this._buildItem(e):this._buildPlaceholderItem();n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=N(n)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const e=this._buildItem(this._data[0]);e&&(this.tbody.textContent="",this.tbody.appendChild(e),this._itemHeight=N(e)||50,this.tbody.textContent="")}}else{const e=this.tbody.children;e.length>0&&(this._itemHeight=N(e[0])||50)}},C.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const e=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=M(this.dom);const n=this._scrollContainer||window;this._scrollHandler=function(){e._rafId||(e._rafId=requestAnimationFrame(function(){e._rafId=null,e._windowed?e._renderWindowed():e._renderVirtual()}))},this._resizeHandler=function(){e._itemHeight=0,e._measureItemHeight(),e._vStart=-1,e._vEnd=-1,e._windowed?e._renderWindowed():e._renderVirtual()},n.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},C.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},C.prototype._renderVirtual=function(){const e=this._filteredData,n=e.length,l=this._itemHeight;if(!l||!n)return;const o=this._scrollContainer;let c,_;if(o){const T=this.tbody.getBoundingClientRect(),A=o.getBoundingClientRect(),v=o===this.tbody?0:T.top-A.top+o.scrollTop;c=o.scrollTop-v,_=o.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;c=window.scrollY-A,_=window.innerHeight}const p=this._readGridLayout(),S=p.columns,E=p.rowGap,m=l+E,y=Math.ceil(n/S);let k=Math.max(0,Math.floor(c/m)-15);k=Math.min(k,y);const W=Math.ceil(_/m)+30,B=Math.min(k+W,y),R=Math.min(k*S,n),O=Math.min(B*S,n);if(R===this._vStart&&O===this._vEnd)return;this._vStart=R,this._vEnd=O;const V=k*m,H=(y-B)*m;if(this.isDataDriven){const T=document.createDocumentFragment();if(V>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=V+"px",T.appendChild(v)}for(let v=R;v<O;v++){const U=this._buildItem(e[v]);U&&T.appendChild(U)}if(H>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=H+"px",T.appendChild(v)}const A=I(this);this.tbody.replaceChildren(T),x(A),this._selectable&&this._updateSelectAll()}else{let T="";V>0&&(T+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${V}px"></${this.isUl?"li":"div"}>`);for(let v=R;v<O;v++)T+=e[v].html;H>0&&(T+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=T,x(A),this._selectable&&this._restoreSelection()}},C.prototype._buildPlaceholderItem=function(){const e=document.createElement(this.isUl?"li":"div");return e.className="ln-list__placeholder",e.setAttribute("aria-hidden","true"),e.style.height=this._itemHeight+"px",e},C.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const e=this._itemHeight;if(!e)return;const n=this._scrollContainer;let l,o;if(n){const A=this.tbody.getBoundingClientRect(),v=n.getBoundingClientRect(),U=n===this.tbody?0:A.top-v.top+n.scrollTop;l=n.scrollTop-U,o=n.clientHeight}else{const v=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-v,o=window.innerHeight}const c=this._readGridLayout(),_=c.columns,p=c.rowGap,S=e+p,E=this._cache.logicalTotal,m=Math.ceil(E/_);let y=Math.max(0,Math.floor(l/S)-15);y=Math.min(y,m);const k=Math.ceil(o/S)+30,W=Math.min(y+k,m),B=Math.min(y*_,E),R=Math.min(W*_,E),O=y*S,V=(m-W)*S,H=document.createDocumentFragment();if(O>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=O+"px",H.appendChild(A)}for(let A=B;A<R;A++)if(this._cache.has(A)){const v=this._buildItem(this._cache.get(A));v&&H.appendChild(v)}else H.appendChild(this._buildPlaceholderItem());if(V>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=V+"px",H.appendChild(A)}const T=I(this);this.tbody.replaceChildren(H),x(T),this._vStart=B,this._vEnd=R,this._cache.ensure(B,R)},C.prototype._showEmptyState=function(){let e=null;if(this.isDataDriven){const n=this._lastTotal!=null?this._lastTotal:this._data.length,o=this.visibleCount===0&&n>0,c=o?this.name+"-empty-filtered":this.name+"-empty";if(e=lt(this.dom,c,"ln-list"),!e){const _=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(_){const p=o?"search":"initial",S=_.content.querySelector(`[data-ln-empty-when="${p}"]`)||_.content.firstElementChild;S&&(e=document.importNode(S,!0))}}}else{const n=this.dom.querySelector(`template[${r}]`);if(n){const l=n.content.firstElementChild;l&&(e=document.importNode(l,!0))}}if(e)if(e.tagName==="LI"||e.tagName==="TR")this.tbody.replaceChildren(e);else{const n=document.createElement(this.isUl?"li":"div");n.appendChild(e),this.tbody.replaceChildren(n)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},C.prototype._buildItem=function(e){let n=lt(this.dom,this.name+"-row","ln-list");if(!n){const o=this.dom.querySelector("template[data-ln-item]");o&&(n=document.importNode(o.content,!0))}let l=n?n.querySelector("[data-ln-item]")||n.firstElementChild:null;if(l)Y(l,e),P(l,e);else if(e&&e.html){const o=document.createElement(this.isUl?"ul":"div");o.innerHTML=e.html,l=o.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),e&&typeof e=="object"){for(const o in e)if(o!=="html"&&e[o]!=null){const c=document.createElement("span");c.setAttribute("data-ln-field",o),c.textContent=String(e[o]),l.appendChild(c)}}if(l._lnRecord=e,e&&e.id!=null&&(l.setAttribute("data-ln-item-id",e.id),this._selectable&&this.selectedIds.has(String(e.id)))){l.classList.add("ln-item-selected");const o=l.querySelector("[data-ln-item-select]");o&&(o.checked=!0)}return l},C.prototype._restoreSelection=function(){if(!this.tbody)return;const e=this.tbody.querySelectorAll("[data-ln-item]");for(let n=0;n<e.length;n++){const l=e[n].getAttribute("data-ln-item-id"),o=l!=null&&this.selectedIds.has(String(l));e[n].classList.toggle("ln-item-selected",o);const c=e[n].querySelector("[data-ln-item-select]");c&&(c.checked=o)}this._updateSelectAll()},C.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const e=this;this._onSelectionChange=function(n){const l=n.target.closest("[data-ln-item-select]");if(!l)return;const o=l.closest("[data-ln-item]");if(!o)return;const c=o.getAttribute("data-ln-item-id");c!=null&&(l.checked?(e.selectedIds.add(String(c)),o.classList.add("ln-item-selected")):(e.selectedIds.delete(String(c)),o.classList.remove("ln-item-selected")),e._updateSelectAll(),e._updateFooter(),D(e.dom,"ln-list:select",{list:e.name,selectedIds:e.selectedIds,count:e.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const n=e._selectAllCheckbox.checked,l=e.tbody.querySelectorAll("[data-ln-item]");for(let o=0;o<l.length;o++){const c=l[o],_=c.getAttribute("data-ln-item-id"),p=c.querySelector("[data-ln-item-select]");_!=null&&(n?(e.selectedIds.add(String(_)),c.classList.add("ln-item-selected")):(e.selectedIds.delete(String(_)),c.classList.remove("ln-item-selected")),p&&(p.checked=n))}D(e.dom,"ln-list:select-all",{list:e.name,selected:n}),D(e.dom,"ln-list:select",{list:e.name,selectedIds:e.selectedIds,count:e.selectedIds.size}),e._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},C.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const e=this.tbody.querySelectorAll("[data-ln-item]");let n=e.length>0;for(let l=0;l<e.length;l++){const o=e[l].getAttribute("data-ln-item-id");if(o!=null&&!this.selectedIds.has(String(o))){n=!1;break}}this._selectAllCheckbox.checked=n},C.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}ut(this,"ln-list:request-data","list")},C.prototype._enterWindowedMode=function(){const e=this,n=this.dom,l=parseInt(n.getAttribute("data-ln-list-window"),10),o=parseInt(n.getAttribute("data-ln-list-window-page"),10),c=parseInt(n.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!e._windowed||!e._cache||(e.totalCount=e._cache.grandTotal,e.visibleCount=e._cache.logicalTotal,e._lastTotal=e._cache.grandTotal,e.isLoaded=!0,e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter(),D(n,"ln-list:rendered",{list:e.name,total:e.totalCount,visible:e.visibleCount}))},this._renderBatch=Nt(this._onCacheChange),this._cache=Wt({windowSize:l>0?l:1e3,pageSize:o>0?o:200,threshold:c>=0?c:25,fetchDebounce:120,requestPage:function(_,p,S){D(n,"ln-list:request-data",{list:e.name,sort:_.sort,filters:_.filters,search:_.search,offset:p,limit:S,queryGen:e._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},C.prototype._kickWindowInitial=function(){if(this._data.length>0){const e=parseInt(this.dom.getAttribute("data-ln-list-count"),10),n=e>0?e:this._data.length;this._cache.ingest({data:this._data,offset:0,total:n,filtered:n})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},C.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},C.prototype._updateFooter=function(){let e=0,n=0;this.isDataDriven?(e=this._lastTotal!=null?this._lastTotal:this._data.length,n=this.visibleCount):(e=this._data.length,n=this._filteredData.length);const l=n<e;if(this._totalSpan&&(this._totalSpan.textContent=q(e,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(n,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?q(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},C.prototype.destroy=function(){this.dom[i]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[i])},Rt(t,i,C,"ln-list",{attributes:L})})()})();
|
|
@@ -306,7 +306,7 @@ import { cloneTemplateScoped, dispatch, requestData, fill, fillTemplate, registe
|
|
|
306
306
|
|
|
307
307
|
// --- Sort ---
|
|
308
308
|
this._onSort = function (e) {
|
|
309
|
-
if (e.detail.field == null) return;
|
|
309
|
+
if (!e.detail || e.detail.field == null) return;
|
|
310
310
|
e.preventDefault();
|
|
311
311
|
self.currentSort = e.detail.direction === 'none' ? null : { field: e.detail.field, direction: e.detail.direction };
|
|
312
312
|
self._requestData();
|
|
@@ -418,10 +418,10 @@ import { cloneTemplateScoped, dispatch, requestData, fill, fillTemplate, registe
|
|
|
418
418
|
dom.addEventListener('ln-filter:change', this._onFilterChange);
|
|
419
419
|
|
|
420
420
|
this._onSort = function (e) {
|
|
421
|
-
if (e.detail
|
|
421
|
+
if (!e.detail || e.detail.field == null) return;
|
|
422
422
|
e.preventDefault();
|
|
423
|
-
const direction = e.detail
|
|
424
|
-
self._sortField = direction === null ? null :
|
|
423
|
+
const direction = e.detail.direction === 'none' ? null : e.detail.direction;
|
|
424
|
+
self._sortField = direction === null ? null : e.detail.field;
|
|
425
425
|
self._sortDir = direction;
|
|
426
426
|
self._applyFilterAndSort();
|
|
427
427
|
self._vStart = -1;
|