@livenetworks/ashlar 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-connector/ln-api-connector.schema.json +105 -96
- package/components/ln-api-connector/src/ln-api-connector.js +1 -0
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/attrs.js +13 -0
- package/components/ln-core/form.js +10 -0
- package/components/ln-core/lifecycle.js +6 -1
- package/components/ln-core/ln-core.schema.json +110 -109
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +7 -3
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/src/generated-attributes.js +3 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +161 -153
- package/components/ln-filter/src/ln-filter.js +77 -5
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/ln-form.schema.json +51 -45
- package/components/ln-form/src/ln-form.js +21 -0
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +26 -0
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/ln-options.schema.json +47 -41
- package/components/ln-options/src/ln-options.js +4 -4
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/src/ln-search.js +17 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-slug/src/ln-slug.js +25 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +13 -0
- package/package.json +2 -1
- package/web-types.json +22 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function O(){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 y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!y(i))return}e.apply(console,t)}}function C(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function j(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(s),s}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const D={};function N(e,t){D[e]=t}function P(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=N,window.lnCore.getDataMapper=P);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function H(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function U(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=U,window.lnCore.ensureLocaleObserver=V);const A={};function Q(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const l=n[o],r=l.getAttribute("data-ln-field");t[r]!=null&&(l.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const l=i[o],r=l.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&l.setAttribute(u,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let o=0;o<s.length;o++){const l=s[o],r=l.getAttribute("data-ln-show");r in t&&l.classList.toggle("hidden",!t[r])}const d=e.querySelectorAll("[data-ln-class]");for(let o=0;o<d.length;o++){const l=d[o],r=l.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&l.classList.toggle(u,!!t[f])}}return e}function K(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)T(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,l){return t[l]!==void 0?t[l]:""}))}const i=function(d,o){return t[o]!==void 0?t[o]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let d=0;d<s.length;d++){const o=s[d],l=o.attributes;for(let r=0;r<l.length;r++){const a=l[r];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Y(e,t,n,i,s,d){const o={};for(let r=0;r<e.children.length;r++){const a=e.children[r],c=a.getAttribute("data-ln-render-key");c&&(o[c]=a)}const l=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],c=String(i(a));let u=o[c];if(u)s(u,a,r);else{const f=Q(n,d);if(!f||($(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),s(u,a,r)}l.appendChild(u)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=K,window.lnCore.renderList=Y);function M(e,t,n,i,s){if(!e||t===null)return!0;const d=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const l=r=>{s?console.warn(r,s):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(l(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(l(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return l(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(l(`[${d}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(l(`[${d}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(l(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return l(`[${d}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function J(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function v(e,t,n,i){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(d));e.matches&&e.matches(d)&&o.push(e);for(const l of o)if(!l[n]){window.lnCore._persistSink&&l.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(l,t);try{l[n]=new i(l)}catch(r){console.error("["+n+"] init failed",l,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function X(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function z(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function R(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Z(e){const t=R(),n=e.observed||[];for(let i=0;i<n.length;i++){const s=n[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(d=>d.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=J(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function q(e,t,n,i){for(let s=0;s<e.length;s++){const d=e[s];if(!t[d.attribute])continue;const o=d.effects&&d.effects[n];o?o(t,n,i):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,i)}}function ee(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=R(),s=i.byAttr.get(n);if(O()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const d=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let l=0;l<d.length;l++)M(d[l].spec,o,n,d[l].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const d=i.byReactive.get(n);d&&q(d,t,n,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,t,n,e.oldValue)}if(s)for(let d=0;d<s.length;d++){const o=s[d];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(v(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ee(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ne(e){const t=B();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const s=i.query,d=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;d&&i.onSubtreeChange(d,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s];v(i,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s],o=d.query,l=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&l.push(i);for(let r=0;r<l.length;r++){const a=l[r];if(!document.contains(a)){const c=a[d.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(u){console.error("["+d.attribute+"] destroy failed",a,u)}delete a[d.attribute]}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{ne(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function oe(e,t,n,i,s={}){const d=s.extraAttributes||[],o=s.onAttributeChange||null,l=s.onSubtreeChange||null,r=s.onInit||null,a=s.onAttrChange||null,c=s.effects||null,u=s.attributes||null,f=u?G(u):c,h=u?new Set(Object.keys(u)):null,g=s.persist||null;function b(E){const w=E||document.body;if(v(w,e,t,n),u&&O())for(const p in u){const he=u[p],S=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&S.push(w);for(let k=0;k<S.length;k++){const L=S[k];y(L)&&M(he,L.getAttribute(p),p,i,L)}}r&&r(w)}const _=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)_.push(w[1])}else _.push(e);Z({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:_.concat(d),onAttributeChange:o,onAttrChange:a,effects:f,declared:h,persist:g}),te();const be=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";B().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:l,query:be}),re(),window[t]=b;function W(){X()>0?z(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W):W(),b}function F(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},i=F(t);if(!i)return n;const s=i.split("&");for(let d=0;d<s.length;d++){const o=s[d];if(!o)continue;const l=o.indexOf(":"),r=l>-1?o.slice(0,l):o,a=l>-1?o.slice(l+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ie(e){if(!e)return null;const t=x();return e in t?t[e]:null}function le(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const s=Object.keys(n).map(function(d){const o=n[d];return o===""?d:d+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==s&&(location.hash=s)}function se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ce(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 ue(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=ie,window.lnCore.hashSet=le,window.lnCore.hashLinkClick=se,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=ae,window.lnCore.hashSortDecode=ce,window.lnCore.hashFilterEncode=ue,window.lnCore.hashFilterDecode=fe);function we(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=we),(function(){const e="data-ln-sortable",t="lnSortable",n="data-ln-sortable-handle";if(window[t]!==void 0)return;const i={"data-ln-sortable":{effect:d,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function s(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const l=this;return this._onPointerDown=function(r){l.isEnabled&&l._handlePointerDown(r)},o.addEventListener("pointerdown",this._onPointerDown),this}s.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},s.prototype._handlePointerDown=function(o){let l=o.target.closest("["+n+"]"),r;if(l){for(r=l;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+n+"]"))return;for(r=o.target;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return;l=r}const c=Array.from(this.dom.children).indexOf(r);if(j(this.dom,"ln-sortable:before-drag",{item:r,index:c}).defaultPrevented)return;o.preventDefault(),l.setPointerCapture(o.pointerId),this._dragging=r,r.classList.add("ln-sortable--dragging"),r.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:r,index:c});const f=this,h=function(b){f._handlePointerMove(b)},g=function(b){f._handlePointerEnd(b),l.removeEventListener("pointermove",h),l.removeEventListener("pointerup",g),l.removeEventListener("pointercancel",g)};l.addEventListener("pointermove",h),l.addEventListener("pointerup",g),l.addEventListener("pointercancel",g)},s.prototype._handlePointerMove=function(o){if(!this._dragging)return;const l=Array.from(this.dom.children),r=this._dragging;for(const a of l)a.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const a of l){if(a===r)continue;const c=a.getBoundingClientRect(),u=c.top+c.height/2;if(o.clientY>=c.top&&o.clientY<u){a.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=c.bottom){a.classList.add("ln-sortable--drop-after");break}}},s.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const l=this._dragging,r=Array.from(this.dom.children),a=r.indexOf(l);let c=null,u=null;for(const f of r){if(f.classList.contains("ln-sortable--drop-before")){c=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){c=f,u="after";break}}for(const f of r)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(l.classList.remove("ln-sortable--dragging"),l.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),c&&c!==l){u==="before"?this.dom.insertBefore(l,c):this.dom.insertBefore(l,c.nextElementSibling);const h=Array.from(this.dom.children).indexOf(l);C(this.dom,"ln-sortable:reordered",{item:l,oldIndex:a,newIndex:h})}this._dragging=null};function d(o){const l=o[t];if(!l)return;const r=o.getAttribute(e)!=="disabled";r!==l.isEnabled&&(l.isEnabled=r,C(o,r?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}oe(e,t,s,"ln-sortable",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function I(){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 y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!y(i))return}e.apply(console,t)}}function m(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function Y(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function G(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,o={};if(n)for(let s=0;s<a.length;s++){const r=a[s];r.name&&r.type==="checkbox"&&!r.disabled&&(o[r.name]=(o[r.name]||0)+1)}for(let s=0;s<a.length;s++){const r=a[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&o[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&l[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);l[r.name]=r.value===""||isNaN(d)?null:d}else l[r.name]=r.value}return l}function X(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(e,t){const n=e.elements,i=[],l={};for(let a=0;a<n.length;a++){const o=n[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<n.length;a++){const o=n[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const r=t[s];if(o.type==="checkbox"){if(Array.isArray(r))o.checked=r.indexOf(o.value)!==-1;else if(l[o.name]>1){const d=String(r).split(",").map(function(c){return c.trim()});o.checked=d.indexOf(o.value)!==-1}else o.checked=X(r);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(r),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<o.options.length;d++)o.options[d].selected=r.indexOf(o.options[d].value)!==-1;i.push(o)}else o.value=r,o.tagName==="SELECT"&&r!=null&&o.setAttribute("data-ln-value",r),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=G,window.lnCore.resolveFormMethod=z);const T={};function ee(e,t){T[e]=t}function te(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const v={};function ie(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const s=n[o],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],r=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const c=r[d].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],r=s.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const c=r[d].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function M(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let r=0;r<s.length;r++){const d=s[r];d.value.indexOf("{{")!==-1&&o.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function se(e,t,n,i,l,a){const o={};for(let r=0;r<e.children.length;r++){const d=e.children[r],c=d.getAttribute("data-ln-render-key");c&&(o[c]=d)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],c=String(i(d));let u=o[c];if(u)l(u,d,r);else{const f=ie(n,a);if(!f||(M(f,d),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),l(u,d,r)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=F,window.lnCore.lnFill=le,window.lnCore.renderList=se);function A(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function B(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function N(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const x=new Map;function q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(x.has(n))return x.get(n);const i=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&i.has(s)?s:t};return x.set(n,l),l}function j(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function W(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function P(e,t,n,i,l){if(!e||t===null)return!0;const a=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=r=>{l?console.warn(r,l):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const i in n){const[l,a,o]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=q(i.values,i.fallback);break;case"integer":l=B;break;case"float":l=j;break;case"boolean":l=N;break;case"list":l=R;break;case"json":l=W;break;case"string":default:l=A;break}l||(l=A),t[i.prop]=[l,n,i.fallback]}return t}function ce(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function ue(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ae,window.lnCore.attrSpec=de,window.lnCore.attrStr=A,window.lnCore.attrInt=B,window.lnCore.attrBool=N,window.lnCore.attrList=R,window.lnCore.attrEnum=q,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function _(e,t,n,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&o.push(e);for(const s of o)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new i(s)}catch(r){console.error("["+n+"] init failed",s,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function U(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function be(e){const t=U(),n=e.observed||[];for(let i=0;i<n.length;i++){const l=n[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ue(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function V(e,t,n,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[n];o?o(t,n,i):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,i)}}function he(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=U(),l=i.byAttr.get(n);if(I()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const a=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let s=0;s<a.length;s++)P(a[s].spec,o,n,a[s].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=i.byReactive.get(n);a&&V(a,t,n,e.oldValue),i.reactiveWildcard.length&&V(i.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const o=l[a];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(_(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{he(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=H();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const l=i.query,a=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;a&&i.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];_(i,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],o=a.query,s=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&s.push(i);for(let r=0;r<s.length;r++){const d=s[r];if(!document.contains(d)){const c=d[a.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(u){console.error("["+a.attribute+"] destroy failed",d,u)}delete d[a.attribute]}}}}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{ge(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Q(e,t,n,i,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,r=l.onInit||null,d=l.onAttrChange||null,c=l.effects||null,u=l.attributes||null,f=u?ce(u):c,h=u?new Set(Object.keys(u)):null,p=l.persist||null;function b(E){const w=E||document.body;if(_(w,e,t,n),u&&I())for(const g in u){const De=u[g],L=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&L.push(w);for(let O=0;O<L.length;O++){const D=L[O];y(D)&&P(De,D.getAttribute(g),g,i,D)}}r&&r(w)}const S=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)S.push(w[1])}else S.push(e);be({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:S.concat(a),onAttributeChange:o,onAttrChange:d,effects:f,declared:h,persist:p}),pe();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Oe=l.subtreeQuery||(Le?e:"["+e+"]");H().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:s,query:Oe}),me(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function K(){fe()>0?we(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",K):K(),b}function J(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},i=J(t);if(!i)return n;const l=i.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),r=s>-1?o.slice(0,s):o,d=s>-1?o.slice(s+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function Ce(e){if(!e)return null;const t=k();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=k();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const o=n[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");J(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function Ee(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ee),(function(){const e="data-ln-sortable",t="lnSortable",n="data-ln-sortable-handle";if(window[t]!==void 0)return;const i={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function l(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(r){s.isEnabled&&s._handlePointerDown(r)},o.addEventListener("pointerdown",this._onPointerDown),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},l.prototype._handlePointerDown=function(o){let s=o.target.closest("["+n+"]"),r;if(s){for(r=s;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+n+"]"))return;for(r=o.target;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return;s=r}const c=Array.from(this.dom.children).indexOf(r);if(Y(this.dom,"ln-sortable:before-drag",{item:r,index:c}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=r,r.classList.add("ln-sortable--dragging"),r.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),m(this.dom,"ln-sortable:drag-start",{item:r,index:c});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),r=this._dragging;for(const d of s)d.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const d of s){if(d===r)continue;const c=d.getBoundingClientRect(),u=c.top+c.height/2;if(o.clientY>=c.top&&o.clientY<u){d.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=c.bottom){d.classList.add("ln-sortable--drop-after");break}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,r=Array.from(this.dom.children),d=r.indexOf(s);let c=null,u=null;for(const f of r){if(f.classList.contains("ln-sortable--drop-before")){c=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){c=f,u="after";break}}for(const f of r)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),c&&c!==s){u==="before"?this.dom.insertBefore(s,c):this.dom.insertBefore(s,c.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);m(this.dom,"ln-sortable:reordered",{item:s,oldIndex:d,newIndex:h})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const r=o.getAttribute(e)!=="disabled";r!==s.isEnabled&&(s.isEnabled=r,m(o,r?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}Q(e,t,l,"ln-sortable",{attributes:i})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function L(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!C(r))return}e.apply(console,t)}}function E(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function j(e,t){$[e]=t}function W(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function U(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function H(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=U,window.lnCore.getLocaleFallback=H,window.lnCore.ensureLocaleObserver=V);const y={};function J(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function I(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function Q(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)I(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function T(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],c=l.attributes;for(let s=0;s<c.length;s++){const u=c[s];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function K(e,t,n,r,o,i){const l={};for(let s=0;s<e.children.length;s++){const u=e.children[s],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const u=t[s],d=String(r(u));let a=l[d];if(a)o(a,u,s);else{const f=J(n,i);if(!f||(T(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),o(a,u,s)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=I,window.lnCore.lnFill=Q,window.lnCore.renderList=K);function p(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function P(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const m=new Map;function z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(m.has(n))return m.get(n);const r=new Set(e||[]),o=function(i,l){const c=i.getAttribute(l);return c!==null&&r.has(c)?c:t};return m.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function R(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=s=>{o?console.warn(s,o):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(c(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function te(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=z(r.values,r.fallback);break;case"integer":o=P;break;case"float":o=Y;break;case"boolean":o=G;break;case"list":o=X;break;case"json":o=Z;break;case"string":default:o=p;break}o||(o=p),t[r.prop]=[o,n,r.fallback]}return t}function ne(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function re(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function A(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ie(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function N(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function le(e){const t=N(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=re(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function q(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function se(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=N(),o=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)R(i[c].spec,l,n,i[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&q(i,t,n,e.oldValue),r.reactiveWildcard.length&&q(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(A(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ue(e){const t=F();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];A(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,c=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&c.push(r);for(let s=0;s<c.length;s++){const u=c[s];if(!document.contains(u)){const d=u[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+i.attribute+"] destroy failed",u,a)}delete u[i.attribute]}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ue(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function de(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,s=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,a=o.attributes||null,f=a?ne(a):d,_e=a?new Set(Object.keys(a)):null,Se=o.persist||null;function g(S){const w=S||document.body;if(A(w,e,t,n),a&&L())for(const b in a){const ke=a[b],v=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&v.push(w);for(let k=0;k<v.length;k++){const O=v[k];C(O)&&R(ke,O.getAttribute(b),b,r,O)}}s&&s(w)}const _=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)_.push(w[1])}else _.push(e);le({selector:e,attribute:t,componentTag:r,attributes:a,ComponentFn:n,onInit:s,observed:_.concat(i),onAttributeChange:l,onAttrChange:u,effects:f,declared:_e,persist:Se}),ce();const ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";F().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:ve}),ae(),window[t]=g;function B(){oe()>0?ie(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",B):B(),g}function M(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=M(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(u)}catch{n[s]=u}}return n}function fe(e){if(!e)return null;const t=x();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");M(location.hash)!==o&&(location.hash=o)}function be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function he(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function pe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ge(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 Ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ye(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=fe,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=be,window.lnCore.resolveHashNamespace=he,window.lnCore.hashSortEncode=pe,window.lnCore.hashSortDecode=ge,window.lnCore.hashFilterEncode=Ce,window.lnCore.hashFilterDecode=ye);function me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=me);function Ae(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t).trim(),r=e.slice(t+1).trim();if(!n)return null;const o={};return o[n]=[r],o}function xe(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const n={"data-ln-stat":{prop:"_storeName",type:"string",read:p,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:p,fallback:"",description:"JSON or key:value filter criteria for record counting"}},r=te(n);function o(i){return this.dom=i,ee(this,i,r),this._onSetCount=function(l){i.textContent=xe(l.detail&&l.detail.count),i.classList.remove("is-loading")},i.addEventListener("ln-stat:set-count",this._onSetCount),E(i,"ln-stat:request-count",{stat:this._storeName,filters:Ae(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},de(e,t,o,"ln-stat",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function L(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!C(r))return}e.apply(console,t)}}function E(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function G(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function X(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const u=String(l).split(",").map(function(a){return a.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=X(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<i.options.length;u++)i.options[u].selected=l.indexOf(i.options[u].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=G,window.lnCore.resolveFormMethod=z);const I={};function Z(e,t){I[e]=t}function ee(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Z,window.lnCore.getDataMapper=ee);function te(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ne,window.lnCore.getLocaleFallback=re,window.lnCore.ensureLocaleObserver=te);const m={};function oe(e,t){m[e]||(m[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=m[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function ie(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function le(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(i[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(r(u));let d=i[a];if(d)o(d,u,l);else{const f=oe(n,s);if(!f||(D(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),o(d,u,l)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=$,window.lnCore.lnFill=ie,window.lnCore.renderList=le);function h(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function F(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function N(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const r=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&r.has(c)?c:t};return y.set(n,o),o}function M(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function B(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function j(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function W(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=q(r.values,r.fallback);break;case"integer":o=F;break;case"float":o=M;break;case"boolean":o=N;break;case"list":o=R;break;case"json":o=B;break;case"string":default:o=h;break}o||(o=h),t[r.prop]=[o,n,r.fallback]}return t}function se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=W,window.lnCore.attrSpec=V,window.lnCore.attrStr=h,window.lnCore.attrInt=F,window.lnCore.attrBool=N,window.lnCore.attrList=R,window.lnCore.attrEnum=q,window.lnCore.attrFloat=M,window.lnCore.attrJson=B);function A(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ue(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function U(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=U(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ce(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function H(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=U(),o=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)j(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&H(s,t,n,e.oldValue),r.reactiveWildcard.length&&H(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(A(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];A(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const a=u[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",u,d)}delete u[s.attribute]}}}}}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{he(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Q(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,a=o.effects||null,d=o.attributes||null,f=d?se(d):a,Oe=d?new Set(Object.keys(d)):null,Le=o.persist||null;function g(_){const w=_||document.body;if(A(w,e,t,n),d&&L())for(const b in d){const Te=d[b],k=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&k.push(w);for(let S=0;S<k.length;S++){const O=k[S];C(O)&&j(Te,O.getAttribute(b),b,r,O)}}l&&l(w)}const v=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let w;for(;(w=_.exec(e))!==null;)v.push(w[1])}else v.push(e);de({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:l,observed:v.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:Oe,persist:Le}),we();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ie=o.subtreeQuery||(Ee?e:"["+e+"]");J().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:Ie}),be(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function P(){ue()>0?ae(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",P):P(),g}function K(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=K(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function pe(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");K(location.hash)!==o&&(location.hash=o)}function Ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function me(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(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 xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=pe,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=Ce,window.lnCore.resolveHashNamespace=me,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=ve);function _e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=_e);function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t).trim(),r=e.slice(t+1).trim();if(!n)return null;const o={};return o[n]=[r],o}function Se(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const n={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},r=V(n);function o(s){return this.dom=s,W(this,s,r),this._onSetCount=function(i){s.textContent=Se(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),E(s,"ln-stat:request-count",{stat:this._storeName,filters:ke(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},Q(e,t,o,"ln-stat",{attributes:n})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function z(){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 H(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 s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){r=e[s];break}if(!H(r))return}t.apply(console,e)}}function k(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function rt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,k(t.dom,e,r)}function F(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function $(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 j={};function ot(t,e){j[t]=e}function st(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ot,window.lnCore.getDataMapper=st);function at(t){const e=t?t.closest("[lang]"):null,l=(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 l?l.trim():"en-US"}function ct(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function dt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];U[l]=e}function ut(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return U[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=dt,window.lnCore.getLocaleFallback=ut,window.lnCore.ensureLocaleObserver=ct);const W={};function G(t,e){W[t]||(W[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=W[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function K(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return G(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let h=0;h<l.length;h++){const f=l[h],b=f.getAttribute("data-ln-field");e[b]!=null&&(f.textContent=e[b])}const r=t.querySelectorAll("[data-ln-attr]");for(let h=0;h<r.length;h++){const f=r[h],b=f.getAttribute("data-ln-attr").split(",");for(let w=0;w<b.length;w++){const S=b[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&f.setAttribute(A,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let h=0;h<s.length;h++){const f=s[h],b=f.getAttribute("data-ln-show");b in e&&f.classList.toggle("hidden",!e[b])}const u=t.querySelectorAll("[data-ln-class]");for(let h=0;h<u.length;h++){const f=u[h],b=f.getAttribute("data-ln-class").split(",");for(let w=0;w<b.length;w++){const S=b[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&f.classList.toggle(A,!!e[E])}}return t}function ht(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 l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[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)Q(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function M(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(h,f){return e[f]!==void 0?e[f]:""}))}const r=function(u,h){return e[h]!==void 0?e[h]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let u=0;u<s.length;u++){const h=s[u],f=h.attributes;for(let b=0;b<f.length;b++){const w=f[b];w.value.indexOf("{{")!==-1&&h.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function ft(t,e,l,r,s,u){const h={};for(let b=0;b<t.children.length;b++){const w=t.children[b],S=w.getAttribute("data-ln-render-key");S&&(h[S]=w)}const f=document.createDocumentFragment();for(let b=0;b<e.length;b++){const w=e[b],S=String(r(w));let A=h[S];if(A)s(A,w,b);else{const E=G(l,u);if(!E||(M(E,w),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),s(A,w,b)}f.appendChild(A)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=Q,window.lnCore.lnFill=ht,window.lnCore.renderList=ft);function O(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function bt(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function Y(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function pt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const N=new Map;function _t(t,e){const l=(t?t.join("|"):"")+"::"+e;if(N.has(l))return N.get(l);const r=new Set(t||[]),s=function(u,h){const f=u.getAttribute(h);return f!==null&&r.has(f)?f:e};return N.set(l,s),s}function wt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function gt(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function J(t,e,l,r,s){if(!t||e===null)return!0;const u=r||"ln-component",h=t.type;if(h==="trigger"||h==="marker"||h==="string"||h==="list"||!h||e===""&&t.fallback!==void 0)return!0;const f=b=>{s?console.warn(b,s):console.warn(b)};if(h==="boolean"){const b=e.trim().toLowerCase();return b!==""&&b!=="true"&&b!=="false"&&b!=="1"&&b!=="0"?(f(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(h==="enum"){const b=t.values||[];return b.includes(e)?!0:(f(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${b.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(h==="integer"){if(!/^-?\d+$/.test(e))return f(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const b=parseInt(e,10);return t.min!==void 0&&b<t.min?(f(`[${u}] Value ${b} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&b>t.max?(f(`[${u}] Value ${b} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(h==="float")return isNaN(Number(e))?(f(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(h==="json")try{return JSON.parse(e),!0}catch(b){return f(`[${u}] Invalid JSON for attribute "${l}": ${b.message}. Fallback: ${t.fallback}.`),!1}return!0}function mt(t,e,l){for(const r in l){const[s,u,h]=l[r];Object.defineProperty(t,r,{get:function(){return s(e,u,h)},enumerable:!0,configurable:!0})}return t}function yt(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=_t(r.values,r.fallback);break;case"integer":s=bt;break;case"float":s=wt;break;case"boolean":s=Y;break;case"list":s=pt;break;case"json":s=gt;break;case"string":default:s=O;break}s||(s=O),e[r.prop]=[s,l,r.fallback]}return e}function Ct(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=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 l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}function P(t,e,l,r){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",h=Array.from(t.querySelectorAll(u));t.matches&&t.matches(u)&&h.push(t);for(const f of h)if(!f[l]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,e);try{f[l]=new r(f)}catch(b){console.error("["+l+"] init failed",f,b)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function vt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function At(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 X(){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 Et(t){const e=X(),l=t.observed||[];for(let r=0;r<l.length;r++){const s=l[r];e.byAttr.has(s)||e.byAttr.set(s,[]),e.byAttr.get(s).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 s=e.byDeclaredAttr.get(r);s.some(u=>u.componentTag===t.componentTag)||s.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 s of r)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function Z(t,e,l,r){for(let s=0;s<t.length;s++){const u=t[s];if(!e[u.attribute])continue;const h=u.effects&&u.effects[l];h?h(e,l,r):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,r)}}function Dt(t){const e=t.target,l=t.attributeName;if(t.oldValue===e.getAttribute(l))return;const r=X(),s=r.byAttr.get(l);if(z()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(l)&&H(e)){const u=r.byDeclaredAttr.get(l),h=e.getAttribute(l);for(let f=0;f<u.length;f++)J(u[f].spec,h,l,u[f].componentTag,e)}if(window.lnCore._debugSink&&(l.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",l,e,{oldValue:t.oldValue,newValue:e.getAttribute(l)}),l.indexOf("data-ln-")===0){const u=r.byReactive.get(l);u&&Z(u,e,l,t.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,e,l,t.oldValue)}if(s)for(let u=0;u<s.length;u++){const h=s[u];if(h.handler){h.handler(e,l,t.oldValue);continue}h.onAttributeChange&&e[h.attribute]?h.onAttributeChange(e,l):(P(e,h.selector,h.attribute,h.ComponentFn),h.onInit&&h.onInit(e))}}function xt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Dt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function tt(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function kt(t){const e=tt();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange){const s=r.query,u=t.target.nodeType===1?t.target.matches(s)?t.target:t.target.closest(s):t.target.parentElement?t.target.parentElement.closest(s):null;u&&r.onSubtreeChange(u,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s];P(r,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(r)}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const u=e[s],h=u.query,f=Array.from(r.querySelectorAll(h));r.matches&&r.matches(h)&&f.push(r);for(let b=0;b<f.length;b++){const w=f[b];if(!document.contains(w)){const S=w[u.attribute];if(S&&typeof S.destroy=="function")try{S.destroy()}catch(A){console.error("["+u.attribute+"] destroy failed",w,A)}delete w[u.attribute]}}}}}}function Tt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{kt(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Lt(t,e,l,r,s={}){const u=s.extraAttributes||[],h=s.onAttributeChange||null,f=s.onSubtreeChange||null,b=s.onInit||null,w=s.onAttrChange||null,S=s.effects||null,A=s.attributes||null,E=A?Ct(A):S,q=A?new Set(Object.keys(A)):null,I=s.persist||null;function R(o){const d=o||document.body;if(P(d,t,e,l),A&&z())for(const a in A){const _=A[a],p=Array.from(d.querySelectorAll("["+a+"]"));d.matches&&d.matches("["+a+"]")&&p.push(d);for(let g=0;g<p.length;g++){const m=p[g];H(m)&&J(_,m.getAttribute(a),a,r,m)}}b&&b(d)}const v=[];if(t.indexOf("[")!==-1){const o=/\[([\w-]+)/g;let d;for(;(d=o.exec(t))!==null;)v.push(d[1])}else v.push(t);Et({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:b,observed:v.concat(u),onAttributeChange:h,onAttrChange:w,effects:E,declared:q,persist:I}),xt();const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";tt().push({selector:t,attribute:e,ComponentFn:l,onInit:b,onSubtreeChange:f,query:c}),Tt(),window[e]=R;function i(){vt()>0?At(function(){R(document.body)}):R(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),R}function qt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function It(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},h=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,b=new Map,w=new Set;let S=0,A=0,E=0,q={sort:null,filters:{},search:""},I=null,R=0,v=0,n=!1;function c(a){b.set(a,++R)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function o(){if(f.size<=e)return;const a=Array.from(f.keys()).sort(function(p,g){return(b.get(p)||0)-(b.get(g)||0)});let _=0;for(;f.size>e&&_<a.length;)f.delete(a[_]),b.delete(a[_]),_++}function d(a,_){w.add(a),u(q,a,_)}return{get:function(a){return f.get(a)},has:function(a){return f.has(a)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return f.size},ensure:function(a,_){clearTimeout(I),v=a;for(let D=a;D<_;D++)f.has(D)&&c(D);if(S<=0)return;const p=Math.max(0,a-r),g=Math.min(S,_+r),m=Math.floor(p/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let D=m;D<=T;D++){const y=D*l,C=Math.min(l,S-y);let x=!1;const zt=Math.max(y,p),$t=Math.min(y+C,g);for(let B=zt;B<$t;B++)if(!f.has(B)){x=!0;break}if(x&&!w.has(y)){L=y;break}}L!==-1&&(I=setTimeout(function(){d(L,l)},s))},ingest:function(a){if(a=a||{},a.queryGen!=null&&a.queryGen!==E)return!1;const _=a.offset||0,p=a.data||[];let g=0;for(let m=0;m<p.length;m++)p[m]!=null&&g++;if(g===0&&(a.provisional||a.filtered>0))return w.delete(_),!1;n&&(f.clear(),b.clear(),n=!1),a.provisional||(A=a.total!=null?a.total:A,S=a.filtered!=null?a.filtered:a.data?a.data.length:S);for(let m=0;m<p.length;m++)p[m]!=null&&(f.set(_+m,p[m]),c(_+m));return w.delete(_),o(),h(),!0},requestInitial:function(a){a&&(q=a),d(0,l)},invalidate:function(a){E++,w.clear(),clearTimeout(I),a&&(q=a),n=!0,d(0,l)},revalidate:function(){E++,w.clear(),clearTimeout(I),n=!0;const a=Math.max(0,Math.floor(v/l)*l);d(a,l)},release:function(a){w.delete(a)},destroy:function(){clearTimeout(I),f.clear(),b.clear(),w.clear()},configure:function(a){a=a||{};let _=!1;if(a.windowSize!=null&&a.windowSize>0&&a.windowSize!==e){const p=a.windowSize<e;e=a.windowSize,p&&o(),_=!0}a.pageSize!=null&&a.pageSize>0&&(l=a.pageSize),a.threshold!=null&&a.threshold>=0&&(r=a.threshold),a.fetchDebounce!=null&&a.fetchDebounce>=0&&(s=a.fetchDebounce),_&&h()},setGrandTotal:function(a){a==null||isNaN(a)||a<0||(A=a,i()||(S=a),h())}}}function et(t){return(t||"").replace(/^#/,"")}function V(t){const e=t===void 0?location.hash:t,l={},r=et(e);if(!r)return l;const s=r.split("&");for(let u=0;u<s.length;u++){const h=s[u];if(!h)continue;const f=h.indexOf(":"),b=f>-1?h.slice(0,f):h,w=f>-1?h.slice(f+1):"";if(b)try{l[b]=decodeURIComponent(w)}catch{l[b]=w}}return l}function Rt(t){if(!t)return null;const e=V();return t in e?e[t]:null}function Ft(t,e){if(!t)return;const l=V();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(u){const h=l[u];return h===""?u:u+":"+encodeURIComponent(h)}).join("&");et(location.hash)!==s&&(location.hash=s)}function Ot(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Ht(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.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 Wt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Mt(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 Nt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Pt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),s=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=Rt,window.lnCore.hashSet=Ft,window.lnCore.hashLinkClick=Ot,window.lnCore.resolveHashNamespace=Ht,window.lnCore.hashSortEncode=Wt,window.lnCore.hashSortDecode=Mt,window.lnCore.hashFilterEncode=Nt,window.lnCore.hashFilterDecode=Pt);function Vt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Vt);function nt(t,e,l,r,s=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const u=Math.max(0,t||0),h=Math.max(0,e||0),f=Math.floor(u/l),b=Math.ceil(h/l),w=Math.max(0,f-s),S=Math.min(r,f+b+s),A=w*l,E=Math.max(0,(r-S)*l);return{start:w,end:S,topPadding:A,bottomPadding:E}}function Bt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)r.has(t[f])&&s++;else s=r.size;const u=l>0&&s===l,h=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:u,isIndeterminate:h}}function it(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function lt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&r.add(e[s]);else for(let s=0;s<e.length;s++)r.delete(e[s]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function b(n,c){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const o=parseInt(c,10);o>0&&n._cache.configure({windowSize:o})}}function w(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>0&&n._cache.configure({pageSize:i})}function S(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.configure({threshold:i})}function A(n,c){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(c,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:O,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:O,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:b,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:w,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=yt(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,c){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(at(c)).format(n)}catch{return String(n)}}function R(n){let c=n.parentElement;for(;c&&c!==document.body&&c!==document.documentElement;){const o=getComputedStyle(c).overflowY;if(o==="auto"||o==="scroll")return c;c=c.parentElement}return null}function v(n){this.dom=n,mt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const c=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=c?Array.from(c.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(o){const d=(o.detail&&o.detail.query!=null?o.detail.query:o.detail&&o.detail.term!=null?o.detail.term:"").trim();i.isDataDriven?(i.currentSearch=d,k(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=d.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),k(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(o){o.preventDefault(),i._onSetSearch(o)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",k(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),k(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table: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,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(o){const d=o.detail||{},a=d.data||[],_=d.total!=null?d.total:a.length;if(!(i._hasInitialSeed&&!i.isLoaded&&a.length===0&&_===0)){if(i._windowed){i._cache.ingest(d)&&!d.provisional&&n.classList.remove("ln-table--loading");return}i._data=a,i._lastTotal=_,i._lastFiltered=d.filtered!=null?d.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),k(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(o){const d=o.detail&&o.detail.loading;n.classList.toggle("ln-table--loading",!!d),d&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(o){!i._windowed||!i._cache||i._cache.release(o.detail&&o.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(o){!o.detail||o.detail.field==null||(o.preventDefault(),i.currentSort=o.detail.direction==="none"?null:{field:o.detail.field,direction:o.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(o){if(o.target.closest("[data-ln-table-row-select]")||o.target.closest("[data-ln-table-row-action]")||o.target.closest("a")||o.target.closest("button")||o.ctrlKey||o.metaKey||o.button===1)return;const d=o.target.closest("[data-ln-table-row]");if(!d)return;const a=d.getAttribute("data-ln-table-row-id"),_=d._lnRecord||{};k(n,"ln-table:row-click",{table:i.name,id:a,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(o){const d=o.target.closest("[data-ln-table-row-action]");if(!d)return;const a=d.closest("[data-ln-table-row]");if(!a)return;const _=d.getAttribute("data-ln-table-row-action"),p=a.getAttribute("data-ln-table-row-id"),g=a._lnRecord||{};k(n,"ln-table:row-action",{table:i.name,id:p,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():k(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(o){if(!o.detail||o.detail.column==null)return;o.preventDefault();const d=o.detail.direction==="none"?null:o.detail.direction;i._sortCol=d===null?-1:o.detail.column,i._sortDir=d,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),k(n,"ln-table:sorted",{column:o.detail.column,direction:o.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(o){if(o.preventDefault(),!o.detail)return;const d=o.detail.key,a=o.detail.values||[];if(d){if(a.length===0)delete i._columnFilters[d];else{const _=[];for(let p=0;p<a.length;p++)_.push(a[p].toLowerCase());i._columnFilters[d]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),k(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,c=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const o=n[i],d=[],a=[],_=[];for(let g=0;g<o.cells.length;g++){const m=o.cells[g],T=m.textContent.trim();d[g]=$(m),a[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let p=null;if(this.isDataDriven){p={};const g=o.getAttribute("data-ln-table-row-id");g!=null&&(p.id=g);for(let m=0;m<c.length;m++){const T=c[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<o.cells.length){const D=o.cells[L];p[T]=$(D)}}}}this._data.push({values:d,rawTexts:a,html:o.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&p?p.id:void 0,...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(),k(this.dom,"ln-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(c){const i=document.createElement("col");i.style.width=c.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,c=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||c===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,c=document.createDocumentFragment();for(let i=0;i<n.length;i++){const o=this._buildRow(n[i]);if(!o)break;c.appendChild(o)}this.tbody.replaceChildren(c),this._selectable&&this._updateSelectAll()}else{const n=[],c=this._filteredData;for(let i=0;i<c.length;i++)n.push(c[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const o=this._cache?this._cache.peek():null;i=o?this._buildRow(o):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=R(this.dom):this._scrollContainer=null;const c=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},c.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,c=n.length,i=this._rowHeight;if(!i||!c)return;const o=this.thead?this.thead.offsetHeight:0,d=this._scrollContainer;let a,_;if(d){const y=this.table.getBoundingClientRect(),C=d.getBoundingClientRect(),x=y.top-C.top+d.scrollTop+o;a=d.scrollTop-x,_=d.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+o;a=window.scrollY-x,_=window.innerHeight}const p=nt(a,_,i,c,15),g=p.start,m=p.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=p.topPadding,D=p.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(D>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=D+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;D>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+D+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const c=document.createElement("td");return c.setAttribute("colspan",this.ths.length||1),c.style.height=this._rowHeight+"px",n.appendChild(c),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const c=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,o=this._scrollContainer;let d,a;if(o){const y=this.table.getBoundingClientRect(),C=o.getBoundingClientRect(),x=y.top-C.top+o.scrollTop+i;d=o.scrollTop-x,a=o.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;d=window.scrollY-x,a=window.innerHeight}const _=nt(d,a,n,c,15),p=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,D=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),D.appendChild(y)}for(let y=p;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&D.appendChild(C)}else D.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),D.appendChild(y)}this.tbody.replaceChildren(D),this._vStart=p,this._vEnd=g,this._cache.ensure(p,g)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let c=null,i=null;if(this.isDataDriven){const o=this._lastTotal!=null?this._lastTotal:this._data.length,a=this.visibleCount===0&&o>0,_=a?this.name+"-empty-filtered":this.name+"-empty";if(i=K(this.dom,_,"ln-table"),!i){const p=this.dom.querySelector("template[data-ln-table-empty]");if(p){const g=a?"search":"initial",m=p.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||p.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")c=i;else{const p=document.createElement("td");p.setAttribute("colspan",String(n)),p.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(p),c=g}}else{const o=this.dom.querySelector("template["+l+"]"),d=document.createElement("td");d.setAttribute("colspan",String(n)),o&&d.appendChild(document.importNode(o.content,!0));const a=document.createElement("tr");a.className="ln-table__empty",a.appendChild(d),c=a}c?this.tbody.replaceChildren(c):this.tbody.replaceChildren(),k(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,c){M(n,c);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let o=0;o<i.length;o++){const d=i[o],a=d.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<a.length;_++){const p=a[_].trim().split(":");if(p.length!==2)continue;const g=p[0].trim(),m=p[1].trim();c[g]!=null&&d.setAttribute(m,c[g])}}},v.prototype._buildRow=function(n){let c=K(this.dom,this.name+"-row","ln-table");if(!c){const o=this.dom.querySelector("template[data-ln-table-row]");o&&(c=document.importNode(o.content,!0))}let i=c?c.querySelector("[data-ln-table-row]")||c.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const o=document.createElement("tbody");o.innerHTML=n.html,i=o.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const o=this.ths;for(let d=0;d<o.length;d++){const a=o[d].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(a){const p=document.createElement("input");p.type="checkbox",p.setAttribute("data-ln-table-row-select",""),p.setAttribute("aria-label","Select row"),_.appendChild(p)}else{const p=o[d].getAttribute("data-ln-table-col");p&&n[p]!=null&&(_.textContent=String(n[p]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const o=i.querySelector("[data-ln-table-row-select]");o&&(o.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}rt(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,c=this.dom,i=parseInt(c.getAttribute("data-ln-table-window"),10),o=parseInt(c.getAttribute("data-ln-table-window-page"),10),d=parseInt(c.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),k(c,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=qt(this._onCacheChange),this._cache=It({windowSize:i>0?i:1e3,pageSize:o>0?o:200,threshold:d>=0?d:25,fetchDebounce:120,requestPage:function(a,_,p){k(c,"ln-table:request-data",{table:n.name,sort:a.sort,filters:a.filters,search:a.search,offset:_,limit:p,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const c=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:c,filtered:c})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.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._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),c=[];for(let o=0;o<n.length;o++){const d=n[o].getAttribute("data-ln-table-row-id");d!=null&&c.push(d)}const i=Bt(c,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let c=0;c<n.length;c++){const i=n[c].getAttribute("data-ln-table-row-id"),o=i!=null&&this.selectedIds.has(i);n[c].classList.toggle("ln-row-selected",o);const d=n[c].querySelector("[data-ln-table-row-select]");d&&(d.checked=o)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(c){const i=c.target.closest("[data-ln-table-row-select]");if(!i)return;const o=i.closest("[data-ln-table-row]");if(!o)return;const d=o.getAttribute("data-ln-table-row-id");d!=null&&(n.selectedIds=it(n.selectedIds,d,i.checked),o.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),k(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const c=document.createElement("input");c.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),o=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";c.setAttribute("aria-label",o),this._selectAllCheckbox.appendChild(c),this._selectAllCheckbox=c}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const c=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],o=[];for(let d=0;d<i.length;d++){const a=i[d].getAttribute("data-ln-table-row-id"),_=i[d].querySelector("[data-ln-table-row-select]");a!=null&&(o.push(a),i[d].classList.toggle("ln-row-selected",c),_&&(_.checked=c))}n.selectedIds=lt(n.selectedIds,o,c),n.selectedCount=n.selectedIds.size,k(n.dom,"ln-table:select-all",{table:n.name,selected:c}),k(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){const o=c[i].querySelector("[data-ln-table-row-select]"),d=c[i].getAttribute("data-ln-table-row-id");o&&o.checked&&d!=null&&(n.selectedIds=it(n.selectedIds,d,!0),c[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const c=n.querySelector('input[type="checkbox"]');c&&c.remove()}if(this._selectAllCheckbox=null,this.selectedIds=lt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const c=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<c.length;i++){c[i].classList.remove("ln-row-selected");const o=c[i].querySelector("[data-ln-table-row-select]");o&&(o.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,c=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,c=this.visibleCount):(n=this._data.length,c=this._filteredData.length);const i=c<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(c,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?I(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},Lt(t,e,v,"ln-table",{attributes:E})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function H(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 s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){r=e[s];break}if(!H(r))return}t.apply(console,e)}}function D(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function ft(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,D(t.dom,e,r)}function O(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function j(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()}function bt(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function pt(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,s={},h=t.elements,c={};if(l)for(let f=0;f<h.length;f++){const a=h[f];a.name&&a.type==="checkbox"&&!a.disabled&&(c[a.name]=(c[a.name]||0)+1)}for(let f=0;f<h.length;f++){const a=h[f];if(!(!a.name||a.disabled||a.type==="file"||a.type==="submit"||a.type==="button")&&!(r&&a.matches&&a.matches(r)))if(a.type==="checkbox")l&&c[a.name]===1?s[a.name]=a.checked:(s[a.name]||(s[a.name]=[]),a.checked&&s[a.name].push(a.value));else if(a.type==="radio")a.checked&&(s[a.name]=a.value);else if(a.type==="select-multiple"){s[a.name]=[];for(let w=0;w<a.options.length;w++)a.options[w].selected&&s[a.name].push(a.options[w].value)}else if(l&&a.type==="hidden")s[a.name]=a.value;else if(l&&(a.type==="number"||a.type==="range")){const w=Number(a.value);s[a.name]=a.value===""||isNaN(w)?null:w}else s[a.name]=a.value}return s}function wt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function _t(t,e){const l=t.elements,r=[],s={};for(let h=0;h<l.length;h++){const c=l[h];c.name&&c.type==="checkbox"&&(s[c.name]=(s[c.name]||0)+1)}for(let h=0;h<l.length;h++){const c=l[h];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const f=c.getAttribute("data-ln-fill-as")||c.name;if(!f||!(f in e))continue;const a=e[f];if(c.type==="checkbox"){if(Array.isArray(a))c.checked=a.indexOf(c.value)!==-1;else if(s[c.name]>1){const w=String(a).split(",").map(function(S){return S.trim()});c.checked=w.indexOf(c.value)!==-1}else c.checked=wt(a);r.push(c)}else if(c.type==="radio")c.checked=c.value===String(a),r.push(c);else if(c.type==="select-multiple"){if(Array.isArray(a))for(let w=0;w<c.options.length;w++)c.options[w].selected=a.indexOf(c.options[w].value)!==-1;r.push(c)}else c.value=a,c.tagName==="SELECT"&&a!=null&&c.setAttribute("data-ln-value",a),r.push(c)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=_t,window.lnCore.serializeForm=pt,window.lnCore.resolveFormMethod=bt);const U={};function gt(t,e){U[t]=e}function mt(t){return U[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=gt,window.lnCore.getDataMapper=mt);function yt(t){const e=t?t.closest("[lang]"):null,l=(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 l?l.trim():"en-US"}function Ct(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function St(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];G[l]=e}function vt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return G[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=St,window.lnCore.getLocaleFallback=vt,window.lnCore.ensureLocaleObserver=Ct);const N={};function K(t,e){N[t]||(N[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=N[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function Q(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return K(e,l)}function Y(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const f=l[c],a=f.getAttribute("data-ln-field");e[a]!=null&&(f.textContent=e[a])}const r=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<r.length;c++){const f=r[c],a=f.getAttribute("data-ln-attr").split(",");for(let w=0;w<a.length;w++){const S=a[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&f.setAttribute(A,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const f=s[c],a=f.getAttribute("data-ln-show");a in e&&f.classList.toggle("hidden",!e[a])}const h=t.querySelectorAll("[data-ln-class]");for(let c=0;c<h.length;c++){const f=h[c],a=f.getAttribute("data-ln-class").split(",");for(let w=0;w<a.length;w++){const S=a[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&f.classList.toggle(A,!!e[E])}}return t}function At(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 l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[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)Y(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function M(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const h=l.currentNode;h.textContent.indexOf("{{")!==-1&&(h.textContent=h.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,f){return e[f]!==void 0?e[f]:""}))}const r=function(h,c){return e[c]!==void 0?e[c]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let h=0;h<s.length;h++){const c=s[h],f=c.attributes;for(let a=0;a<f.length;a++){const w=f[a];w.value.indexOf("{{")!==-1&&c.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function Et(t,e,l,r,s,h){const c={};for(let a=0;a<t.children.length;a++){const w=t.children[a],S=w.getAttribute("data-ln-render-key");S&&(c[S]=w)}const f=document.createDocumentFragment();for(let a=0;a<e.length;a++){const w=e[a],S=String(r(w));let A=c[S];if(A)s(A,w,a);else{const E=K(l,h);if(!E||(M(E,w),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),s(A,w,a)}f.appendChild(A)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=Y,window.lnCore.lnFill=At,window.lnCore.renderList=Et);function F(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function J(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function W(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function X(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const P=new Map;function Z(t,e){const l=(t?t.join("|"):"")+"::"+e;if(P.has(l))return P.get(l);const r=new Set(t||[]),s=function(h,c){const f=h.getAttribute(c);return f!==null&&r.has(f)?f:e};return P.set(l,s),s}function tt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function et(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function nt(t,e,l,r,s){if(!t||e===null)return!0;const h=r||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const f=a=>{s?console.warn(a,s):console.warn(a)};if(c==="boolean"){const a=e.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(f(`[${h}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const a=t.values||[];return a.includes(e)?!0:(f(`[${h}] Invalid value "${e}" for attribute "${l}". Allowed: ${a.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return f(`[${h}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const a=parseInt(e,10);return t.min!==void 0&&a<t.min?(f(`[${h}] Value ${a} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&a>t.max?(f(`[${h}] Value ${a} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(f(`[${h}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(a){return f(`[${h}] Invalid JSON for attribute "${l}": ${a.message}. Fallback: ${t.fallback}.`),!1}return!0}function it(t,e,l){for(const r in l){const[s,h,c]=l[r];Object.defineProperty(t,r,{get:function(){return s(e,h,c)},enumerable:!0,configurable:!0})}return t}function lt(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=Z(r.values,r.fallback);break;case"integer":s=J;break;case"float":s=tt;break;case"boolean":s=W;break;case"list":s=X;break;case"json":s=et;break;case"string":default:s=F;break}s||(s=F),e[r.prop]=[s,l,r.fallback]}return e}function kt(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function xt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=it,window.lnCore.attrSpec=lt,window.lnCore.attrStr=F,window.lnCore.attrInt=J,window.lnCore.attrBool=W,window.lnCore.attrList=X,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=tt,window.lnCore.attrJson=et);function V(t,e,l,r){if(t.nodeType!==1)return;const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c=Array.from(t.querySelectorAll(h));t.matches&&t.matches(h)&&c.push(t);for(const f of c)if(!f[l]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,e);try{f[l]=new r(f)}catch(a){console.error("["+l+"] init failed",f,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Dt(){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 rt(){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 Lt(t){const e=rt(),l=t.observed||[];for(let r=0;r<l.length;r++){const s=l[r];e.byAttr.has(s)||e.byAttr.set(s,[]),e.byAttr.get(s).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 s=e.byDeclaredAttr.get(r);s.some(h=>h.componentTag===t.componentTag)||s.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=xt(t);if(r===null)e.reactiveWildcard.push(t);else for(const s of r)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function ot(t,e,l,r){for(let s=0;s<t.length;s++){const h=t[s];if(!e[h.attribute])continue;const c=h.effects&&h.effects[l];c?c(e,l,r):h.onAttrChange&&(!h.declared||h.declared.has(l))&&h.onAttrChange(e,l,r)}}function It(t){const e=t.target,l=t.attributeName;if(t.oldValue===e.getAttribute(l))return;const r=rt(),s=r.byAttr.get(l);if($()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(l)&&H(e)){const h=r.byDeclaredAttr.get(l),c=e.getAttribute(l);for(let f=0;f<h.length;f++)nt(h[f].spec,c,l,h[f].componentTag,e)}if(window.lnCore._debugSink&&(l.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",l,e,{oldValue:t.oldValue,newValue:e.getAttribute(l)}),l.indexOf("data-ln-")===0){const h=r.byReactive.get(l);h&&ot(h,e,l,t.oldValue),r.reactiveWildcard.length&&ot(r.reactiveWildcard,e,l,t.oldValue)}if(s)for(let h=0;h<s.length;h++){const c=s[h];if(c.handler){c.handler(e,l,t.oldValue);continue}c.onAttributeChange&&e[c.attribute]?c.onAttributeChange(e,l):(V(e,c.selector,c.attribute,c.ComponentFn),c.onInit&&c.onInit(e))}}function qt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{It(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function st(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Rt(t){const e=st();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange){const s=r.query,h=t.target.nodeType===1?t.target.matches(s)?t.target:t.target.closest(s):t.target.parentElement?t.target.parentElement.closest(s):null;h&&r.onSubtreeChange(h,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const h=e[s];V(r,h.selector,h.attribute,h.ComponentFn),h.onInit&&h.onInit(r)}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1)for(let s=0;s<e.length;s++){const h=e[s],c=h.query,f=Array.from(r.querySelectorAll(c));r.matches&&r.matches(c)&&f.push(r);for(let a=0;a<f.length;a++){const w=f[a];if(!document.contains(w)){const S=w[h.attribute];if(S&&typeof S.destroy=="function")try{S.destroy()}catch(A){console.error("["+h.attribute+"] destroy failed",w,A)}delete w[h.attribute]}}}}}}function Ft(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Rt(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function at(t,e,l,r,s={}){const h=s.extraAttributes||[],c=s.onAttributeChange||null,f=s.onSubtreeChange||null,a=s.onInit||null,w=s.onAttrChange||null,S=s.effects||null,A=s.attributes||null,E=A?kt(A):S,I=A?new Set(Object.keys(A)):null,q=s.persist||null;function R(o){const b=o||document.body;if(V(b,t,e,l),A&&$())for(const d in A){const _=A[d],p=Array.from(b.querySelectorAll("["+d+"]"));b.matches&&b.matches("["+d+"]")&&p.push(b);for(let g=0;g<p.length;g++){const m=p[g];H(m)&&nt(_,m.getAttribute(d),d,r,m)}}a&&a(b)}const v=[];if(t.indexOf("[")!==-1){const o=/\[([\w-]+)/g;let b;for(;(b=o.exec(t))!==null;)v.push(b[1])}else v.push(t);Lt({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:a,observed:v.concat(h),onAttributeChange:c,onAttrChange:w,effects:E,declared:I,persist:q}),qt();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=s.subtreeQuery||(n?t:"["+t+"]");st().push({selector:t,attribute:e,ComponentFn:l,onInit:a,onSubtreeChange:f,query:u}),Ft(),window[e]=R,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=at);function i(){Dt()>0?Tt(function(){R(document.body)}):R(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),R}function Ot(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Ht(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const h=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,a=new Map,w=new Set;let S=0,A=0,E=0,I={sort:null,filters:{},search:""},q=null,R=0,v=0,n=!1;function u(d){a.set(d,++R)}function i(){return!!(I&&(I.search||I.filters&&Object.keys(I.filters).length))}function o(){if(f.size<=e)return;const d=Array.from(f.keys()).sort(function(p,g){return(a.get(p)||0)-(a.get(g)||0)});let _=0;for(;f.size>e&&_<d.length;)f.delete(d[_]),a.delete(d[_]),_++}function b(d,_){w.add(d),h(I,d,_)}return{get:function(d){return f.get(d)},has:function(d){return f.has(d)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return f.size},ensure:function(d,_){clearTimeout(q),v=d;for(let k=d;k<_;k++)f.has(k)&&u(k);if(S<=0)return;const p=Math.max(0,d-r),g=Math.min(S,_+r),m=Math.floor(p/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=m;k<=T;k++){const y=k*l,C=Math.min(l,S-y);let x=!1;const Gt=Math.max(y,p),Kt=Math.min(y+C,g);for(let z=Gt;z<Kt;z++)if(!f.has(z)){x=!0;break}if(x&&!w.has(y)){L=y;break}}L!==-1&&(q=setTimeout(function(){b(L,l)},s))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,p=d.data||[];let g=0;for(let m=0;m<p.length;m++)p[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return w.delete(_),!1;n&&(f.clear(),a.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,S=d.filtered!=null?d.filtered:d.data?d.data.length:S);for(let m=0;m<p.length;m++)p[m]!=null&&(f.set(_+m,p[m]),u(_+m));return w.delete(_),o(),c(),!0},requestInitial:function(d){d&&(I=d),b(0,l)},invalidate:function(d){E++,w.clear(),clearTimeout(q),d&&(I=d),n=!0,b(0,l)},revalidate:function(){E++,w.clear(),clearTimeout(q),n=!0;const d=Math.max(0,Math.floor(v/l)*l);b(d,l)},release:function(d){w.delete(d)},destroy:function(){clearTimeout(q),f.clear(),a.clear(),w.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const p=d.windowSize<e;e=d.windowSize,p&&o(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(r=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(s=d.fetchDebounce),_&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(S=d),c())}}}function ct(t){return(t||"").replace(/^#/,"")}function B(t){const e=t===void 0?location.hash:t,l={},r=ct(e);if(!r)return l;const s=r.split("&");for(let h=0;h<s.length;h++){const c=s[h];if(!c)continue;const f=c.indexOf(":"),a=f>-1?c.slice(0,f):c,w=f>-1?c.slice(f+1):"";if(a)try{l[a]=decodeURIComponent(w)}catch{l[a]=w}}return l}function Nt(t){if(!t)return null;const e=B();return t in e?e[t]:null}function Mt(t,e){if(!t)return;const l=B();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(h){const c=l[h];return c===""?h:h+":"+encodeURIComponent(c)}).join("&");ct(location.hash)!==s&&(location.hash=s)}function Wt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Pt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.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 Vt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Bt(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 zt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function $t(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),s=r?r.split(",").map(function(h){try{return decodeURIComponent(h)}catch{return h}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=Nt,window.lnCore.hashSet=Mt,window.lnCore.hashLinkClick=Wt,window.lnCore.resolveHashNamespace=Pt,window.lnCore.hashSortEncode=Vt,window.lnCore.hashSortDecode=Bt,window.lnCore.hashFilterEncode=zt,window.lnCore.hashFilterDecode=$t);function jt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=jt);function dt(t,e,l,r,s=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const h=Math.max(0,t||0),c=Math.max(0,e||0),f=Math.floor(h/l),a=Math.ceil(c/l),w=Math.max(0,f-s),S=Math.min(r,f+a+s),A=w*l,E=Math.max(0,(r-S)*l);return{start:w,end:S,topPadding:A,bottomPadding:E}}function Ut(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)r.has(t[f])&&s++;else s=r.size;const h=l>0&&s===l,c=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:h,isIndeterminate:c}}function ut(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function ht(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&r.add(e[s]);else for(let s=0;s<e.length;s++)r.delete(e[s]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function a(n,u){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const o=parseInt(u,10);o>0&&n._cache.configure({windowSize:o})}}function w(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function S(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:F,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:F,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:W,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:a,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:w,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},I=lt(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function q(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(yt(u)).format(n)}catch{return String(n)}}function R(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const o=getComputedStyle(u).overflowY;if(o==="auto"||o==="scroll")return u;u=u.parentElement}return null}function v(n){this.dom=n,it(this,n,I),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(o){const b=(o.detail&&o.detail.query!=null?o.detail.query:o.detail&&o.detail.term!=null?o.detail.term:"").trim();i.isDataDriven?(i.currentSearch=b,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=b.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(o){o.preventDefault(),i._onSetSearch(o)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table: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,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(o){const b=o.detail||{},d=b.data||[],_=b.total!=null?b.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(b)&&!b.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=b.filtered!=null?b.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(o){const b=o.detail&&o.detail.loading;n.classList.toggle("ln-table--loading",!!b),b&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(o){!i._windowed||!i._cache||i._cache.release(o.detail&&o.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(o){!o.detail||o.detail.field==null||(o.preventDefault(),i.currentSort=o.detail.direction==="none"?null:{field:o.detail.field,direction:o.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(o){if(o.target.closest("[data-ln-table-row-select]")||o.target.closest("[data-ln-table-row-action]")||o.target.closest("a")||o.target.closest("button")||o.ctrlKey||o.metaKey||o.button===1)return;const b=o.target.closest("[data-ln-table-row]");if(!b)return;const d=b.getAttribute("data-ln-table-row-id"),_=b._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(o){const b=o.target.closest("[data-ln-table-row-action]");if(!b)return;const d=b.closest("[data-ln-table-row]");if(!d)return;const _=b.getAttribute("data-ln-table-row-action"),p=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:p,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(o){if(!o.detail||o.detail.column==null)return;o.preventDefault();const b=o.detail.direction==="none"?null:o.detail.direction;i._sortCol=b===null?-1:o.detail.column,i._sortDir=b,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:o.detail.column,direction:o.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(o){if(o.preventDefault(),!o.detail)return;const b=o.detail.key,d=o.detail.values||[];if(b){if(d.length===0)delete i._columnFilters[b];else{const _=[];for(let p=0;p<d.length;p++)_.push(d[p].toLowerCase());i._columnFilters[b]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const o=n[i],b=[],d=[],_=[];for(let g=0;g<o.cells.length;g++){const m=o.cells[g],T=m.textContent.trim();b[g]=j(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let p=null;if(this.isDataDriven){p={};const g=o.getAttribute("data-ln-table-row-id");g!=null&&(p.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<o.cells.length){const k=o.cells[L];p[T]=j(k)}}}}this._data.push({values:b,rawTexts:d,html:o.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&p?p.id:void 0,...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-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const o=this._buildRow(n[i]);if(!o)break;u.appendChild(o)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const o=this._cache?this._cache.peek():null;i=o?this._buildRow(o):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=R(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const o=this.thead?this.thead.offsetHeight:0,b=this._scrollContainer;let d,_;if(b){const y=this.table.getBoundingClientRect(),C=b.getBoundingClientRect(),x=y.top-C.top+b.scrollTop+o;d=b.scrollTop-x,_=b.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+o;d=window.scrollY-x,_=window.innerHeight}const p=dt(d,_,i,u,15),g=p.start,m=p.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=p.topPadding,k=p.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(k>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;k>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,o=this._scrollContainer;let b,d;if(o){const y=this.table.getBoundingClientRect(),C=o.getBoundingClientRect(),x=y.top-C.top+o.scrollTop+i;b=o.scrollTop-x,d=o.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;b=window.scrollY-x,d=window.innerHeight}const _=dt(b,d,n,u,15),p=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,k=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),k.appendChild(y)}for(let y=p;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&k.appendChild(C)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),k.appendChild(y)}this.tbody.replaceChildren(k),this._vStart=p,this._vEnd=g,this._cache.ensure(p,g)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const o=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&o>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=Q(this.dom,_,"ln-table"),!i){const p=this.dom.querySelector("template[data-ln-table-empty]");if(p){const g=d?"search":"initial",m=p.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||p.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const p=document.createElement("td");p.setAttribute("colspan",String(n)),p.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(p),u=g}}else{const o=this.dom.querySelector("template["+l+"]"),b=document.createElement("td");b.setAttribute("colspan",String(n)),o&&b.appendChild(document.importNode(o.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(b),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,u){M(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let o=0;o<i.length;o++){const b=i[o],d=b.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const p=d[_].trim().split(":");if(p.length!==2)continue;const g=p[0].trim(),m=p[1].trim();u[g]!=null&&b.setAttribute(m,u[g])}}},v.prototype._buildRow=function(n){let u=Q(this.dom,this.name+"-row","ln-table");if(!u){const o=this.dom.querySelector("template[data-ln-table-row]");o&&(u=document.importNode(o.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const o=document.createElement("tbody");o.innerHTML=n.html,i=o.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const o=this.ths;for(let b=0;b<o.length;b++){const d=o[b].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const p=document.createElement("input");p.type="checkbox",p.setAttribute("data-ln-table-row-select",""),p.setAttribute("aria-label","Select row"),_.appendChild(p)}else{const p=o[b].getAttribute("data-ln-table-col");p&&n[p]!=null&&(_.textContent=String(n[p]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const o=i.querySelector("[data-ln-table-row-select]");o&&(o.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}ft(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),o=parseInt(u.getAttribute("data-ln-table-window-page"),10),b=parseInt(u.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Ot(this._onCacheChange),this._cache=Ht({windowSize:i>0?i:1e3,pageSize:o>0?o:200,threshold:b>=0?b:25,fetchDebounce:120,requestPage:function(d,_,p){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:p,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.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._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let o=0;o<n.length;o++){const b=n[o].getAttribute("data-ln-table-row-id");b!=null&&u.push(b)}const i=Ut(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),o=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",o);const b=n[u].querySelector("[data-ln-table-row-select]");b&&(b.checked=o)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const o=i.closest("[data-ln-table-row]");if(!o)return;const b=o.getAttribute("data-ln-table-row-id");b!=null&&(n.selectedIds=ut(n.selectedIds,b,i.checked),o.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),o=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",o),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],o=[];for(let b=0;b<i.length;b++){const d=i[b].getAttribute("data-ln-table-row-id"),_=i[b].querySelector("[data-ln-table-row-select]");d!=null&&(o.push(d),i[b].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=ht(n.selectedIds,o,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const o=u[i].querySelector("[data-ln-table-row-select]"),b=u[i].getAttribute("data-ln-table-row-id");o&&o.checked&&b!=null&&(n.selectedIds=ut(n.selectedIds,b,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=ht(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const o=u[i].querySelector("[data-ln-table-row-select]");o&&(o.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?q(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),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)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},at(t,e,v,"ln-table",{attributes:E})})()})();
|