@livenetworks/ashlar 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autosave/ln-autosave.js +1 -1
  6. package/components/ln-chart/ln-chart.js +1 -1
  7. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  8. package/components/ln-confirm/ln-confirm.js +1 -1
  9. package/components/ln-core/README.md +25 -0
  10. package/components/ln-core/index.js +1 -0
  11. package/components/ln-core/ln-core.schema.json +14 -4
  12. package/components/ln-core/query.js +113 -0
  13. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  14. package/components/ln-data-coordinator/README.md +4 -0
  15. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  16. package/components/ln-data-store/ln-data-store.js +1 -1
  17. package/components/ln-date/ln-date.js +1 -1
  18. package/components/ln-debug/ln-debug.js +1 -1
  19. package/components/ln-debug/src/generated-attributes.js +1 -0
  20. package/components/ln-dropdown/ln-dropdown.js +1 -1
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-fill/ln-fill.js +1 -1
  24. package/components/ln-filter/README.md +1 -0
  25. package/components/ln-filter/ln-filter.js +1 -1
  26. package/components/ln-filter/ln-filter.schema.json +8 -0
  27. package/components/ln-filter/src/ln-filter.js +67 -2
  28. package/components/ln-form/ln-form.js +1 -1
  29. package/components/ln-http/ln-http.js +1 -1
  30. package/components/ln-icon/ln-icon.js +1 -1
  31. package/components/ln-include/ln-include.js +1 -1
  32. package/components/ln-key/ln-key.js +1 -1
  33. package/components/ln-link/ln-link.js +1 -1
  34. package/components/ln-list/ln-list.js +1 -1
  35. package/components/ln-modal/ln-modal.js +1 -1
  36. package/components/ln-nav/ln-nav.js +1 -1
  37. package/components/ln-number/ln-number.js +1 -1
  38. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  39. package/components/ln-options/ln-options.js +1 -1
  40. package/components/ln-persist/ln-persist.js +1 -1
  41. package/components/ln-picklist/ln-picklist.js +1 -1
  42. package/components/ln-popover/ln-popover.js +1 -1
  43. package/components/ln-progress/ln-progress.js +1 -1
  44. package/components/ln-router/ln-router.js +1 -1
  45. package/components/ln-scroll/ln-scroll.js +1 -1
  46. package/components/ln-search/README.md +1 -0
  47. package/components/ln-search/ln-search.js +1 -1
  48. package/components/ln-search/ln-search.schema.json +8 -0
  49. package/components/ln-search/src/ln-search.js +54 -2
  50. package/components/ln-slug/ln-slug.js +1 -1
  51. package/components/ln-sort/README.md +1 -0
  52. package/components/ln-sort/ln-sort.js +1 -1
  53. package/components/ln-sort/ln-sort.schema.json +112 -104
  54. package/components/ln-sort/src/ln-sort.js +78 -3
  55. package/components/ln-sortable/ln-sortable.js +1 -1
  56. package/components/ln-stat/ln-stat.js +1 -1
  57. package/components/ln-table/README.md +1 -0
  58. package/components/ln-table/ln-table.js +1 -1
  59. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  60. package/components/ln-tabs/ln-tabs.js +1 -1
  61. package/components/ln-time/ln-time.js +1 -1
  62. package/components/ln-toast/ln-toast.js +1 -1
  63. package/components/ln-toggle/ln-toggle.js +1 -1
  64. package/components/ln-tooltip/ln-tooltip.js +1 -1
  65. package/components/ln-translations/ln-translations.js +1 -1
  66. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  67. package/components/ln-upload/ln-upload.js +1 -1
  68. package/components/ln-validate/ln-validate.js +1 -1
  69. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  70. package/ln-ashlar.html-data.json +4 -0
  71. package/package.json +1 -1
  72. package/web-types.json +8 -1
@@ -1 +1 @@
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 _(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!_(l))return}e.apply(console,t)}}function v(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function re(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(i),i}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,i={},a=e.elements,r={};if(o)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")o&&r[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const o=e.elements,l=[],i={};for(let a=0;a<o.length;a++){const r=o[a];r.name&&r.type==="checkbox"&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<o.length;a++){const r=o[a];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const s=r.getAttribute("data-ln-fill-as")||r.name;if(!s||!(s in t))continue;const n=t[s];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(i[r.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=le(n);l.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),l.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<r.options.length;c++)r.options[c].selected=n.indexOf(r.options[c].value)!==-1;l.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),l.push(r)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const R={};function ae(e,t){R[e]=t}function ce(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function ue(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];M[o]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=de);const x={};function we(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const s=o[r],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<l.length;r++){const s=l[r],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let r=0;r<i.length;r++){const s=i[r],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let r=0;r<a.length;r++){const s=a[r],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function be(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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function N(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,s){return t[s]!==void 0?t[s]:""}))}const l=function(a,r){return t[r]!==void 0?t[r]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const r=i[a],s=r.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function he(e,t,o,l,i,a){const r={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(r[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(l(c));let u=r[d];if(u)i(u,c,n);else{const f=we(o,a);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=B,window.lnCore.lnFill=be,window.lnCore.renderList=he);function k(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function j(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function P(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const E=new Map;function U(e,t){const o=(e?e.join("|"):"")+"::"+t;if(E.has(o))return E.get(o);const l=new Set(e||[]),i=function(a,r){const s=a.getAttribute(r);return s!==null&&l.has(s)?s:t};return E.set(o,i),i}function V(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function H(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function Q(e,t,o,l,i){if(!e||t===null)return!0;const a=l||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,o){for(const l in o){const[i,a,r]=o[l];Object.defineProperty(e,l,{get:function(){return i(t,a,r)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=U(l.values,l.fallback);break;case"integer":i=j;break;case"float":i=V;break;case"boolean":i=P;break;case"list":i=W;break;case"json":i=H;break;case"string":default:i=k;break}i||(i=k),t[l.prop]=[i,o,l.fallback]}return t}function me(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pe,window.lnCore.attrSpec=ge,window.lnCore.attrStr=k,window.lnCore.attrInt=j,window.lnCore.attrBool=P,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,l){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:l};if(e.matches&&e.matches(a)&&m(e,r),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)m(s[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(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 K(){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 Ae(e){const t=K(),o=e.observed||[];for(let l=0;l<o.length;l++){const i=o[l];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Ce(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,o,l){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const r=a.effects&&a.effects[o];r?r(t,o,l):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,l)}}function _e(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,l=K(),i=l.byAttr.get(t),a=$()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!o&&!i&&!a)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(a&&_(r)){const s=l.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let c=0;c<s.length;c++)Q(s[c].spec,n,t,s[c].componentTag,r)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const s=l.byReactive.get(t);s&&Y(s,r,t,e.oldValue),l.reactiveWildcard.length&&Y(l.reactiveWildcard,r,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(J(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{_e(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function D(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=S();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=L();if(e.target&&l.length)for(let i=0;i<l.length;i++){const a=l[i],r=a.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;s&&a.onSubtreeChange(s,e)}for(let i=0;i<e.addedNodes.length;i++){const a=e.addedNodes[i];if(a.nodeType===1){const r=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)a.matches&&a.matches(n.query)&&m(a,n);else if(a.matches&&a.matches(n.query)&&m(a,n),a.querySelectorAll){const c=a.querySelectorAll(n.query);for(let d=0;d<c.length;d++)m(c[d],n)}}n.onInit&&n.onInit(a)}}}for(let i=0;i<e.removedNodes.length;i++){const a=e.removedNodes[i];if(a.nodeType===1){if(document.contains(a))continue;const r=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s],c=n.query;if(c){if(!r)a.matches&&a.matches(c)&&D(a,n);else if(a.matches&&a.matches(c)&&D(a,n),a.querySelectorAll){const d=a.querySelectorAll(c);for(let u=0;u<d.length;u++)D(d[u],n)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){const e=new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{z(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const o=t.takeRecords();for(let l=0;l<o.length;l++){const i=o[l];if(i.type==="childList")try{z(i)}catch(a){console.error("[ln-core] lifecycle handler failed",i.target,a)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ee(e){S().push(e),e.onSubtreeChange&&e.query&&L().push(e),G()}function X(e,t,o,l,i={}){const a=i.extraAttributes||[],r=i.onAttributeChange||null,s=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?me(u):d,w=u?new Set(Object.keys(u)):null,h=i.persist||null;function g(T){const b=T||document.body;if(J(b,e,t,o),u&&$())for(const y in u){const Re=u[y],I=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&I.push(b);for(let q=0;q<I.length;q++){const F=I[q];_(F)&&Q(Re,F.getAttribute(y),y,l,F)}}n&&n(b)}const p=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let b;for(;(b=T.exec(e))!==null;)p.push(b[1])}else p.push(e);Ae({selector:e,attribute:t,componentTag:l,attributes:u,ComponentFn:o,onInit:n,observed:p.concat(a),onAttributeChange:r,onAttrChange:c,effects:f,declared:w,persist:h}),xe();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=i.subtreeQuery||(C?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:s,query:ee};S().push(te),s&&ee&&L().push(te),G(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=Ee,window.lnCore.withoutLifecycle=ke);function ne(){ye()>0?ve(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),g}function Z(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,o={},l=Z(t);if(!l)return o;const i=l.split("&");for(let a=0;a<i.length;a++){const r=i[a];if(!r)continue;const s=r.indexOf(":"),n=s>-1?r.slice(0,s):r,c=s>-1?r.slice(s+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Se(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Le(e,t){if(!e)return;const o=O();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(a){const r=o[a];return r===""?a:a+":"+encodeURIComponent(r)}).join("&");Z(location.hash)!==i&&(location.hash=i)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 qe(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 o=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=Se,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Fe);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(){const e="data-ln-sortable",t="lnSortable",o="data-ln-sortable-handle";if(window[t]!==void 0)return;const l={"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 i(r){this.dom=r,this.isEnabled=r.getAttribute(e)!=="disabled",this._dragging=null,r.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},r.addEventListener("pointerdown",this._onPointerDown),this}i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},i.prototype._handlePointerDown=function(r){let s=r.target.closest("["+o+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+o+"]"))return;for(n=r.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(re(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;r.preventDefault(),s.setPointerCapture(r.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),v(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this;let w=null,h=null;const g=function(C){h=C,!w&&(w=requestAnimationFrame(function(){w=null,h&&f._handlePointerMove(h)}))},p=function(C){w&&(cancelAnimationFrame(w),w=null),f._handlePointerEnd(C),s.removeEventListener("pointermove",g),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",g),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},i.prototype._handlePointerMove=function(r){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;let c=null,d=null;for(let u=0;u<s.length;u++){const f=s[u];if(f===n)continue;const w=f.getBoundingClientRect(),h=w.top+w.height/2;if(r.clientY>=w.top&&r.clientY<h){c=f,d="before";break}else if(r.clientY>=h&&r.clientY<=w.bottom){c=f,d="after";break}}if(!(this._lastDropTarget===c&&this._lastDropPos===d)){this._lastDropTarget&&this._lastDropTarget!==c&&this._lastDropTarget.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after"),this._lastDropTarget=c,this._lastDropPos=d;for(let u=0;u<s.length;u++){const f=s[u];f!==c&&(f.classList.contains("ln-sortable--drop-before")&&f.classList.remove("ln-sortable--drop-before"),f.classList.contains("ln-sortable--drop-after")&&f.classList.remove("ln-sortable--drop-after"))}if(c){const u=d==="before"?"ln-sortable--drop-before":"ln-sortable--drop-after",f=d==="before"?"ln-sortable--drop-after":"ln-sortable--drop-before";c.classList.contains(f)&&c.classList.remove(f),c.classList.contains(u)||c.classList.add(u)}}},i.prototype._handlePointerEnd=function(r){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}this._lastDropTarget=null,this._lastDropPos=null;for(const f of n)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"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const w=Array.from(this.dom.children).indexOf(s);v(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:w})}this._dragging=null};function a(r){const s=r[t];if(!s)return;const n=r.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,v(r,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:r}))}X(e,t,i,"ln-sortable",{attributes:l})})()})();
1
+ (function(){"use strict";function R(){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 v(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(!v(i))return}e.apply(console,t)}}function A(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function re(e,t,r){const i=r||{};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 _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,o={};if(r)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const r=e.elements,i=[],l={};for(let a=0;a<r.length;a++){const o=r[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<r.length;a++){const o=r[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 n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=le(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const $={};function ae(e,t){$[e]=t}function ce(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];M[r]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=de);const x={};function we(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[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],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function he(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function N(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const a=r.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 n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function be(e,t,r,i,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(i(c));let u=o[d];if(u)l(u,c,n);else{const f=we(r,a);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=B,window.lnCore.lnFill=he,window.lnCore.renderList=be);function S(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function P(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function j(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const E=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(E.has(r))return E.get(r);const i=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&i.has(s)?s:t};return E.set(r,l),l}function V(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function H(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Q(e,t,r,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=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,r){for(const i in r){const[l,a,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=W(i.values,i.fallback);break;case"integer":l=P;break;case"float":l=V;break;case"boolean":l=j;break;case"list":l=U;break;case"json":l=H;break;case"string":default:l=S;break}l||(l=S),t[i.prop]=[l,r,i.fallback]}return t}function me(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pe,window.lnCore.attrSpec=ge,window.lnCore.attrStr=S,window.lnCore.attrInt=P,window.lnCore.attrBool=j,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(a)&&m(e,o),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)m(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){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 K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=K(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(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=ye(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 G(e,t,r,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[r];o?o(t,r,i):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,i)}}function ve(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=K(),l=i.byAttr.get(t),a=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!a)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(a&&v(o)){const s=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<s.length;c++)Q(s[c].spec,n,t,s[c].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&G(s,o,t,e.oldValue),i.reactiveWildcard.length&&G(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(J(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ve(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function D(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Y(e){const t=k();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=L();if(e.target&&i.length)for(let l=0;l<i.length;l++){const a=i[l],o=a.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;s&&a.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const a=e.addedNodes[l];if(a.nodeType===1){const o=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)a.matches&&a.matches(n.query)&&m(a,n);else if(a.matches&&a.matches(n.query)&&m(a,n),a.querySelectorAll){const c=a.querySelectorAll(n.query);for(let d=0;d<c.length;d++)m(c[d],n)}}n.onInit&&n.onInit(a)}}}for(let l=0;l<e.removedNodes.length;l++){const a=e.removedNodes[l];if(a.nodeType===1){if(document.contains(a))continue;const o=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const n=t[s],c=n.query;if(c){if(!o)a.matches&&a.matches(c)&&D(a,n);else if(a.matches&&a.matches(c)&&D(a,n),a.querySelectorAll){const d=a.querySelectorAll(c);for(let u=0;u<d.length;u++)D(d[u],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{Y(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let i=0;i<r.length;i++){const l=r[i];if(l.type==="childList")try{Y(l)}catch(a){console.error("[ln-core] lifecycle handler failed",l.target,a)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ee(e){k().push(e),e.onSubtreeChange&&e.query&&L().push(e),z()}function X(e,t,r,i,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?me(u):d,w=u?new Set(Object.keys(u)):null,b=l.persist||null;function g(q){const h=q||document.body;if(J(h,e,t,r),u&&R())for(const C in u){const He=u[C],I=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&I.push(h);for(let T=0;T<I.length;T++){const F=I[T];v(F)&&Q(He,F.getAttribute(C),C,i,F)}}n&&n(h)}const p=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let h;for(;(h=q.exec(e))!==null;)p.push(h[1])}else p.push(e);_e({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:r,onInit:n,observed:p.concat(a),onAttributeChange:o,onAttrChange:c,effects:f,declared:w,persist:b}),xe();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=l.subtreeQuery||(y?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:s,query:ee};k().push(te),s&&ee&&L().push(te),z(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=Ee,window.lnCore.withoutLifecycle=Se);function ne(){Ce()>0?Ae(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),g}function Z(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,r={},i=Z(t);if(!i)return r;const l=i.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Le(e,t){if(!e)return;const r=O();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(a){const o=r[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 Te(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 r=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:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ke,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Te,window.lnCore.hashFilterDecode=Fe);function Re(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},i=Re(t);if(!i)return r;const l=new URLSearchParams(i);for(const[a,o]of l.entries())r[a]=o;return r}function Me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const i=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",i)}function Ne(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"_"+t:i:t||null}function Pe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const i=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:i}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Me,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ne,window.lnCore.querySortEncode=Pe,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ve(){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=Ve),(function(){const e="data-ln-sortable",t="lnSortable",r="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(n){s.isEnabled&&s._handlePointerDown(n)},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("["+r+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+r+"]"))return;for(n=o.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(re(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),A(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this;let w=null,b=null;const g=function(y){b=y,!w&&(w=requestAnimationFrame(function(){w=null,b&&f._handlePointerMove(b)}))},p=function(y){w&&(cancelAnimationFrame(w),w=null),f._handlePointerEnd(y),s.removeEventListener("pointermove",g),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",g),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;let c=null,d=null;for(let u=0;u<s.length;u++){const f=s[u];if(f===n)continue;const w=f.getBoundingClientRect(),b=w.top+w.height/2;if(o.clientY>=w.top&&o.clientY<b){c=f,d="before";break}else if(o.clientY>=b&&o.clientY<=w.bottom){c=f,d="after";break}}if(!(this._lastDropTarget===c&&this._lastDropPos===d)){this._lastDropTarget&&this._lastDropTarget!==c&&this._lastDropTarget.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after"),this._lastDropTarget=c,this._lastDropPos=d;for(let u=0;u<s.length;u++){const f=s[u];f!==c&&(f.classList.contains("ln-sortable--drop-before")&&f.classList.remove("ln-sortable--drop-before"),f.classList.contains("ln-sortable--drop-after")&&f.classList.remove("ln-sortable--drop-after"))}if(c){const u=d==="before"?"ln-sortable--drop-before":"ln-sortable--drop-after",f=d==="before"?"ln-sortable--drop-after":"ln-sortable--drop-before";c.classList.contains(f)&&c.classList.remove(f),c.classList.contains(u)||c.classList.add(u)}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}this._lastDropTarget=null,this._lastDropPos=null;for(const f of n)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"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const w=Array.from(this.dom.children).indexOf(s);A(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:w})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const n=o.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,A(o,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}X(e,t,l,"ln-sortable",{attributes:i})})()})();
@@ -1 +1 @@
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 o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!y(i))return}e.apply(console,t)}}function q(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&o[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);o[n.name]=n.value===""||isNaN(u)?null:u}else o[n.name]=n.value}return o}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,i=[],o={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const n=t[c];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(n).split(",").map(function(a){return a.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=oe(n);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<l.options.length;u++)l.options[u].selected=n.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const F={};function le(e,t){F[e]=t}function se(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];T[r]=t}function ae(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=ue,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=ce);const m={};function de(e,t){m[e]||(m[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=m[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const c=r[l],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const 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 l=0;l<o.length;l++){const c=o[l],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const a=n[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function R(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function we(e,t,r,i,o,s){const l={};for(let n=0;n<e.children.length;n++){const u=e.children[n],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],a=String(i(u));let d=l[a];if(d)o(d,u,n);else{const f=de(r,s);if(!f||(R(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),o(d,u,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=$,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function h(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function N(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function M(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return A.set(r,o),o}function W(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function V(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function U(e,t,r,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,r){for(const i in r){const[o,s,l]=r[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=j(i.values,i.fallback);break;case"integer":o=N;break;case"float":o=W;break;case"boolean":o=M;break;case"list":o=B;break;case"json":o=V;break;case"string":default:o=h;break}o||(o=h),t[i.prop]=[o,r,i.fallback]}return t}function he(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=H,window.lnCore.attrSpec=J,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=W,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&b(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){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 Ce(e){const t=K(),r=e.observed||[];for(let i=0;i<r.length;i++){const o=r[i];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=be(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function P(e,t,r,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function ye(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=K(),o=i.byAttr.get(t),s=I()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let u=0;u<c.length;u++)U(c[u].spec,n,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&P(c,l,t,e.oldValue),i.reactiveWildcard.length&&P(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(Q(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ye(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function x(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=v();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=x();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)s.matches&&s.matches(n.query)&&b(s,n);else if(s.matches&&s.matches(n.query)&&b(s,n),s.querySelectorAll){const u=s.querySelectorAll(n.query);for(let a=0;a<u.length;a++)b(u[a],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!l)s.matches&&s.matches(u)&&_(s,n);else if(s.matches&&s.matches(u)&&_(s,n),s.querySelectorAll){const a=s.querySelectorAll(u);for(let d=0;d<a.length;d++)_(a[d],n)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{z(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let i=0;i<r.length;i++){const o=r[i];if(o.type==="childList")try{z(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ve(e){v().push(e),e.onSubtreeChange&&e.query&&x().push(e),G()}function X(e,t,r,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,u=o.onAttrChange||null,a=o.effects||null,d=o.attributes||null,f=d?he(d):a,Te=d?new Set(Object.keys(d)):null,$e=o.persist||null;function C(O){const w=O||document.body;if(Q(w,e,t,r),d&&I())for(const p in d){const Ne=d[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const D=E[L];y(D)&&U(Ne,D.getAttribute(p),p,i,D)}}n&&n(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);Ce({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:r,onInit:n,observed:k.concat(s),onAttributeChange:l,onAttrChange:u,effects:f,declared:Te,persist:$e}),me();const Re=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=o.subtreeQuery||(Re?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Z};v().push(ee),c&&Z&&x().push(ee),G(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=ve,window.lnCore.withoutLifecycle=Ae);function te(){pe()>0?ge(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),C}function Y(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},i=Y(t);if(!i)return r;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),n=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function xe(e){if(!e)return null;const t=S();return e in t?t[e]:null}function _e(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==o&&(location.hash=o)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(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 Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=xe,window.lnCore.hashSet=_e,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=De);function Ie(){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=Ie);function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),i=e.slice(t+1).trim();if(!r)return null;const o={};return o[r]=[i],o}function Fe(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"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"}},i=J(r);function o(s){return this.dom=s,H(this,s,i),this._onSetCount=function(l){s.textContent=Fe(l.detail&&l.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),q(s,"ln-stat:request-count",{stat:this._storeName,filters:qe(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},X(e,t,o,"ln-stat",{attributes:r})})()})();
1
+ (function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!y(o))return}e.apply(console,t)}}function F(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&i[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);i[r.name]=r.value===""||isNaN(u)?null:u}else i[r.name]=r.value}return i}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(r).split(",").map(function(a){return a.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=oe(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const I={};function le(e,t){I[e]=t}function se(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ue(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];R[n]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=ce);const m={};function de(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 T(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const a=r[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 i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const a=r[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 fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].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 s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],a=String(o(u));let d=l[a];if(d)i(d,u,r);else{const f=de(n,s);if(!f||($(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),i(d,u,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function h(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function N(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function M(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return A.set(n,i),i}function U(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function V(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function Q(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=j(o.values,o.fallback);break;case"integer":i=N;break;case"float":i=U;break;case"boolean":i=M;break;case"list":i=B;break;case"json":i=W;break;case"string":default:i=h;break}i||(i=h),t[o.prop]=[i,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=H,window.lnCore.attrSpec=Q,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=W);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function J(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&b(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)b(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=P(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=be(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function K(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ye(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=P(),i=o.byAttr.get(t),s=D()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&K(c,l,t,e.oldValue),o.reactiveWildcard.length&&K(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(J(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ye(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function G(e){const t=_();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=S();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&b(s,r);else if(s.matches&&s.matches(r.query)&&b(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let a=0;a<u.length;a++)b(u[a],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&x(s,r);else if(s.matches&&s.matches(u)&&x(s,r),s.querySelectorAll){const a=s.querySelectorAll(u);for(let d=0;d<a.length;d++)x(a[d],r)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{G(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{G(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&S().push(e),z()}function X(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,u=i.onAttrChange||null,a=i.effects||null,d=i.attributes||null,f=d?he(d):a,Ve=d?new Set(Object.keys(d)):null,He=i.persist||null;function C(E){const w=E||document.body;if(J(w,e,t,n),d&&D())for(const p in d){const Je=d[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const q=L[O];y(q)&&V(Je,q.getAttribute(p),p,o,q)}}r&&r(w)}const k=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)k.push(w[1])}else k.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:k.concat(s),onAttributeChange:l,onAttrChange:u,effects:f,declared:Ve,persist:He}),me();const Qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=i.subtreeQuery||(Qe?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:Z};_().push(ee),c&&Z&&S().push(ee),z(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=_e,window.lnCore.withoutLifecycle=Ae);function te(){pe()>0?ge(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),C}function Y(e){return(e||"").replace(/^#/,"")}function v(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Se(e){if(!e)return null;const t=v();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=v();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=v,window.lnCore.hashGet=Se,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=qe);function De(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=De(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Ie(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Re(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Te(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ne(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Me(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Be(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Ie,window.lnCore.querySet=Re,window.lnCore.resolveQueryParam=Te,window.lnCore.querySortEncode=$e,window.lnCore.querySortDecode=Ne,window.lnCore.queryFilterEncode=Me,window.lnCore.queryFilterDecode=Be);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je);function Ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t).trim(),o=e.slice(t+1).trim();if(!n)return null;const i={};return i[n]=[o],i}function We(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"}},o=Q(n);function i(s){return this.dom=s,H(this,s,o),this._onSetCount=function(l){s.textContent=We(l.detail&&l.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),F(s,"ln-stat:request-count",{stat:this._storeName,filters:Ue(this._filterRaw)}),this}i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},X(e,t,i,"ln-stat",{attributes:n})})()})();
@@ -148,6 +148,7 @@ Column filters use static authored markup — a `[data-ln-popover]` block contai
148
148
  - **SSR Mode (`!this.isDataDriven`)**: `ln-table` listens for `ln-filter:change` directly on its root element. It calls `e.preventDefault()` (preventing `ln-filter`'s default child-hiding DOM mutation), updates its in-memory `_columnFilters[key]`, runs `_applyFilterAndSort()`, `_render()`, and `_updateFooter()`, and dispatches `ln-table:filter`.
149
149
  - **Data-Driven Mode (`this.isDataDriven`)**: `ln-table` does not filter locally — `ln-data-store` intercepts `ln-filter:change` on the shared store, updates `query.filters[key]`, and `ln-data-coordinator` re-serves updated datasets to the table via `ln-table:set-data`.
150
150
  - **Header Indicator**: `ln-table-coordinator` receives the bubbled `ln-filter:change` from the popover, maps `e.detail.key` to a column via `data-ln-table-filter-col` on `<th>`, and toggles `.ln-filter-active` on the funnel `<button>` (the dot indicator).
151
+ - **URL Query Synchronization (`data-ln-query`)**: Adding `data-ln-query` to the search input (`data-ln-query="search"` or `q`), sort controls (`data-ln-query="sort"`), or column filter lists (`data-ln-query="department"`) synchronizes the table's state to browser URL search parameters (`?search=...&department=...&sort=...`) via `history.replaceState`. Works out-of-the-box in both SSR and Data-Driven modes without custom page coordinators.
151
152
 
152
153
  ### What ln-table does NOT do
153
154
 
@@ -1 +1 @@
1
- (function(){"use strict";function G(){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 M(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 o=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){o=t[s];break}if(!M(o))return}e.apply(console,t)}}function D(e,t,l){const o=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function ge(e,t,l){e._applyFilterAndSort(),e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter();const o={sort:e.currentSort,filters:e.currentFilters,search:e.currentSearch};o[l]=e.name,D(e.dom,t,o)}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()}function K(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ye(e,t){const l=!!(t&&t.typed),o=t&&t.exclude,s={},h=e.elements,c={};if(l)for(let f=0;f<h.length;f++){const r=h[f];r.name&&r.type==="checkbox"&&!r.disabled&&(c[r.name]=(c[r.name]||0)+1)}for(let f=0;f<h.length;f++){const r=h[f];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")l&&c[r.name]===1?s[r.name]=r.checked:(s[r.name]||(s[r.name]=[]),r.checked&&s[r.name].push(r.value));else if(r.type==="radio")r.checked&&(s[r.name]=r.value);else if(r.type==="select-multiple"){s[r.name]=[];for(let p=0;p<r.options.length;p++)r.options[p].selected&&s[r.name].push(r.options[p].value)}else if(l&&r.type==="hidden")s[r.name]=r.value;else if(l&&(r.type==="number"||r.type==="range")){const p=Number(r.value);s[r.name]=r.value===""||isNaN(p)?null:p}else s[r.name]=r.value}return s}function Ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Se(e,t){const l=e.elements,o=[],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 t))continue;const r=t[f];if(c.type==="checkbox"){if(Array.isArray(r))c.checked=r.indexOf(c.value)!==-1;else if(s[c.name]>1){const p=String(r).split(",").map(function(m){return m.trim()});c.checked=p.indexOf(c.value)!==-1}else c.checked=Ce(r);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(r),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(r))for(let p=0;p<c.options.length;p++)c.options[p].selected=r.indexOf(c.options[p].value)!==-1;o.push(c)}else c.value=r,c.tagName==="SELECT"&&r!=null&&c.setAttribute("data-ln-value",r),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Se,window.lnCore.serializeForm=ye,window.lnCore.resolveFormMethod=me);const Q={};function ve(e,t){Q[e]=t}function Ae(e){return Q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ve,window.lnCore.getDataMapper=Ae);function Ee(e){const t=e?e.closest("[lang]"):null,l=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function ke(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Y={};function xe(e,t){if(!e||typeof t!="object")return;const l=e.toLowerCase().split("-")[0];Y[l]=t}function De(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Y[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=xe,window.lnCore.getLocaleFallback=De,window.lnCore.ensureLocaleObserver=ke);const N={};function J(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const l=N[e];return l?l.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t,l){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return J(t,l)}function Z(e,t){if(!e||!t)return e;const l=e.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const f=l[c],r=f.getAttribute("data-ln-field");t[r]!=null&&(f.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const f=o[c],r=f.getAttribute("data-ln-attr").split(",");for(let p=0;p<r.length;p++){const m=r[p].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();t[E]!=null&&f.setAttribute(v,t[E])}}const s=e.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const f=s[c],r=f.getAttribute("data-ln-show");r in t&&f.classList.toggle("hidden",!t[r])}const h=e.querySelectorAll("[data-ln-class]");for(let c=0;c<h.length;c++){const f=h[c],r=f.getAttribute("data-ln-class").split(",");for(let p=0;p<r.length;p++){const m=r[p].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();E in t&&f.classList.toggle(v,!!t[E])}}return e}function Te(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 l=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<l.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[o],t??null),l[o].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)Z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let l=0;l<t.length;l++)t[l].textContent=""}})));function W(e,t){if(!e||!t)return e;const l=document.createTreeWalker(e,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 t[f]!==void 0?t[f]:""}))}const o=function(h,c){return t[c]!==void 0?t[c]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let h=0;h<s.length;h++){const c=s[h],f=c.attributes;for(let r=0;r<f.length;r++){const p=f[r];p.value.indexOf("{{")!==-1&&c.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Le(e,t,l,o,s,h){const c={};for(let r=0;r<e.children.length;r++){const p=e.children[r],m=p.getAttribute("data-ln-render-key");m&&(c[m]=p)}const f=document.createDocumentFragment();for(let r=0;r<t.length;r++){const p=t[r],m=String(o(p));let v=c[m];if(v)s(v,p,r);else{const E=J(l,h);if(!E||(W(E,p),v=E.firstElementChild,!v))continue;v.setAttribute("data-ln-render-key",m),s(v,p,r)}f.appendChild(v)}e.textContent="",e.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=Z,window.lnCore.lnFill=Te,window.lnCore.renderList=Le);function F(e,t,l){const o=e.getAttribute(t);return o===null?l:o}function ee(e,t,l){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?l:o}function P(e,t,l=!1){const o=e.getAttribute(t);if(o===null)return!!l;const s=o.trim().toLowerCase();return!(s==="false"||s==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function ne(e,t){const l=(e?e.join("|"):"")+"::"+t;if(V.has(l))return V.get(l);const o=new Set(e||[]),s=function(h,c){const f=h.getAttribute(c);return f!==null&&o.has(f)?f:t};return V.set(l,s),s}function ie(e,t,l){const o=parseFloat(e.getAttribute(t));return isNaN(o)?l:o}function le(e,t,l){const o=e.getAttribute(t);if(!o)return l;try{return JSON.parse(o)}catch{return l}}function re(e,t,l,o,s){if(!e||t===null)return!0;const h=o||"ln-component",c=e.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||t===""&&e.fallback!==void 0)return!0;const f=r=>{s?console.warn(r,s):console.warn(r)};if(c==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(f(`[${h}] Invalid value "${t}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const r=e.values||[];return r.includes(t)?!0:(f(`[${h}] Invalid value "${t}" for attribute "${l}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(t))return f(`[${h}] Invalid integer "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(f(`[${h}] Value ${r} for attribute "${l}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(f(`[${h}] Value ${r} for attribute "${l}" is greater than max (${e.max}).`),!1):!0}if(c==="float")return isNaN(Number(t))?(f(`[${h}] Invalid float "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(t),!0}catch(r){return f(`[${h}] Invalid JSON for attribute "${l}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,l){for(const o in l){const[s,h,c]=l[o];Object.defineProperty(e,o,{get:function(){return s(t,h,c)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const l in e){const o=e[l];if(!o||!o.prop)continue;let s=o.read;if(!s&&o.type)switch(o.type){case"enum":s=ne(o.values,o.fallback);break;case"integer":s=ee;break;case"float":s=ie;break;case"boolean":s=P;break;case"list":s=te;break;case"json":s=le;break;case"string":default:s=F;break}s||(s=F),t[o.prop]=[s,l,o.fallback]}return t}function qe(e){const t={};for(const l in e){const o=e[l];o&&o.effect&&(t[l]=o.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 l in e.effects)t.add(l);if(e.onAttrChange&&e.declared)for(const l of e.declared)t.add(l);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=oe,window.lnCore.attrSpec=se,window.lnCore.attrStr=F,window.lnCore.attrInt=ee,window.lnCore.attrBool=P,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=ie,window.lnCore.attrJson=le);function O(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(l){console.error("["+t.attribute+"] init failed",e,l)}}}function ae(e,t,l,o){if(e.nodeType!==1)return;const h=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",c={selector:t,attribute:l,ComponentFn:o};if(e.matches&&e.matches(h)&&O(e,c),e.querySelectorAll){const f=e.querySelectorAll(h);for(let r=0;r<f.length;r++)O(f[r],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ie(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Fe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ce(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=ce(),l=e.observed||[];for(let o=0;o<l.length;o++){const s=l[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const s=t.byDeclaredAttr.get(o);s.some(h=>h.componentTag===e.componentTag)||s.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Re(e);if(o===null)t.reactiveWildcard.push(e);else for(const s of o)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function de(e,t,l,o){for(let s=0;s<e.length;s++){const h=e[s];if(!t[h.attribute])continue;const c=h.effects&&h.effects[l];c?c(t,l,o):h.onAttrChange&&(!h.declared||h.declared.has(l))&&h.onAttrChange(t,l,o)}}function He(e){const t=e.attributeName,l=t.indexOf("data-ln-")===0,o=ce(),s=o.byAttr.get(t),h=G()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!l&&!s&&!h)return;const c=e.target;if(e.oldValue!==c.getAttribute(t)){if(h&&M(c)){const f=o.byDeclaredAttr.get(t),r=c.getAttribute(t);for(let p=0;p<f.length;p++)re(f[p].spec,r,t,f[p].componentTag,c)}if(window.lnCore._debugSink&&(l||s)&&window.lnCore._debugSink("attr",t,c,{oldValue:e.oldValue,newValue:c.getAttribute(t)}),l){const f=o.byReactive.get(t);f&&de(f,c,t,e.oldValue),o.reactiveWildcard.length&&de(o.reactiveWildcard,c,t,e.oldValue)}if(s)for(let f=0;f<s.length;f++){const r=s[f];if(r.handler){r.handler(c,t,e.oldValue);continue}r.onAttributeChange&&c[r.attribute]?r.onAttributeChange(c,t):(ae(c,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(c))}}}function Me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++)try{He(t[l])}catch(o){console.error("[ln-core] mutation handler failed",t[l].target,o)}}).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 z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function $(e,t){if(!document.contains(e))if(t.attribute){const l=e[t.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ue(e){const t=B();if(!t.length)return;const l=e.target;if(l){const s=l.nodeType===1?l:l.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=z();if(e.target&&o.length)for(let s=0;s<o.length;s++){const h=o[s],c=h.query,f=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;f&&h.onSubtreeChange(f,e)}for(let s=0;s<e.addedNodes.length;s++){const h=e.addedNodes[s];if(h.nodeType===1){const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<t.length;f++){const r=t[f];if(r.selector&&r.attribute&&r.ComponentFn){if(!c)h.matches&&h.matches(r.query)&&O(h,r);else if(h.matches&&h.matches(r.query)&&O(h,r),h.querySelectorAll){const p=h.querySelectorAll(r.query);for(let m=0;m<p.length;m++)O(p[m],r)}}r.onInit&&r.onInit(h)}}}for(let s=0;s<e.removedNodes.length;s++){const h=e.removedNodes[s];if(h.nodeType===1){if(document.contains(h))continue;const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<t.length;f++){const r=t[f],p=r.query;if(p){if(!c)h.matches&&h.matches(p)&&$(h,r);else if(h.matches&&h.matches(p)&&$(h,r),h.querySelectorAll){const m=h.querySelectorAll(p);for(let v=0;v<m.length;v++)$(m[v],r)}}}}}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){const e=new MutationObserver(function(t){for(let l=0;l<t.length;l++){const o=t[l];if(o.type==="childList")try{ue(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const l=t.takeRecords();for(let o=0;o<l.length;o++){const s=l[o];if(s.type==="childList")try{ue(s)}catch(h){console.error("[ln-core] lifecycle handler failed",s.target,h)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function We(e){B().push(e),e.onSubtreeChange&&e.query&&z().push(e),he()}function fe(e,t,l,o,s={}){const h=s.extraAttributes||[],c=s.onAttributeChange||null,f=s.onSubtreeChange||null,r=s.onInit||null,p=s.onAttrChange||null,m=s.effects||null,v=s.attributes||null,E=v?qe(v):m,q=v?new Set(Object.keys(v)):null,R=s.persist||null;function I(b){const d=b||document.body;if(ae(d,e,t,l),v&&G())for(const w in v){const _=v[w],g=Array.from(d.querySelectorAll("["+w+"]"));d.matches&&d.matches("["+w+"]")&&g.push(d);for(let y=0;y<g.length;y++){const T=g[y];M(T)&&re(_,T.getAttribute(w),w,o,T)}}r&&r(d)}const A=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let d;for(;(d=b.exec(e))!==null;)A.push(d[1])}else A.push(e);Oe({selector:e,attribute:t,componentTag:o,attributes:v,ComponentFn:l,onInit:r,observed:A.concat(h),onAttributeChange:c,onAttrChange:p,effects:E,declared:q,persist:R}),Me();const i=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=s.subtreeQuery||(i?e:"["+e+"]"),n={selector:e,attribute:t,ComponentFn:l,onInit:r,onSubtreeChange:f,query:u};B().push(n),f&&u&&z().push(n),he(),window[t]=I,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=We,window.lnCore.withoutLifecycle=Ne);function a(){Ie()>0?Fe(function(){I(document.body)}):I(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a(),I}function Pe(e,t){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,e()}))}}function Ve(e){e=e||{};let t=e.windowSize>0?e.windowSize:1e3,l=e.pageSize>0?e.pageSize:200,o=e.threshold!=null?e.threshold:25,s=e.fetchDebounce!=null?e.fetchDebounce:120;const h=typeof e.requestPage=="function"?e.requestPage:function(){},c=typeof e.onChange=="function"?e.onChange:function(){},f=new Map,r=new Map,p=new Set;let m=0,v=0,E=0,q={sort:null,filters:{},search:""},R=null,I=0,A=0,i=!1;function u(d){r.set(d,++I)}function n(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function a(){if(f.size<=t)return;const d=Array.from(f.keys()).sort(function(_,g){return(r.get(_)||0)-(r.get(g)||0)});let w=0;for(;f.size>t&&w<d.length;)f.delete(d[w]),r.delete(d[w]),w++}function b(d,w){p.add(d),h(q,d,w)}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 m},get grandTotal(){return v},get queryGen(){return E},get size(){return f.size},ensure:function(d,w){clearTimeout(R),A=d;for(let k=d;k<w;k++)f.has(k)&&u(k);if(m<=0)return;const _=Math.max(0,d-o),g=Math.min(m,w+o),y=Math.floor(_/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=y;k<=T;k++){const C=k*l,S=Math.min(l,m-C);let x=!1;const Xe=Math.max(C,_),Ze=Math.min(C+S,g);for(let U=Xe;U<Ze;U++)if(!f.has(U)){x=!0;break}if(x&&!p.has(C)){L=C;break}}L!==-1&&(R=setTimeout(function(){b(L,l)},s))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const w=d.offset||0,_=d.data||[];let g=0;for(let y=0;y<_.length;y++)_[y]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(w),!1;i&&(f.clear(),r.clear(),i=!1),d.provisional||(v=d.total!=null?d.total:v,m=d.filtered!=null?d.filtered:d.data?d.data.length:m);for(let y=0;y<_.length;y++)_[y]!=null&&(f.set(w+y,_[y]),u(w+y));return p.delete(w),a(),c(),!0},requestInitial:function(d){d&&(q=d),b(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(R),d&&(q=d),i=!0,b(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(R),i=!0;const d=Math.max(0,Math.floor(A/l)*l);b(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(R),f.clear(),r.clear(),p.clear()},configure:function(d){d=d||{};let w=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==t){const _=d.windowSize<t;t=d.windowSize,_&&a(),w=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(o=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(s=d.fetchDebounce),w&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(v=d,n()||(m=d),c())}}}function be(e){return(e||"").replace(/^#/,"")}function j(e){const t=e===void 0?location.hash:e,l={},o=be(t);if(!o)return l;const s=o.split("&");for(let h=0;h<s.length;h++){const c=s[h];if(!c)continue;const f=c.indexOf(":"),r=f>-1?c.slice(0,f):c,p=f>-1?c.slice(f+1):"";if(r)try{l[r]=decodeURIComponent(p)}catch{l[r]=p}}return l}function Be(e){if(!e)return null;const t=j();return e in t?t[e]:null}function ze(e,t){if(!e)return;const l=j();t==null?delete l[e]:l[e]=String(t);const s=Object.keys(l).map(function(h){const c=l[h];return c===""?h:h+":"+encodeURIComponent(c)}).join("&");be(location.hash)!==s&&(location.hash=s)}function $e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const l=e.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ue(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 Ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const l=e.slice(0,t),o=e.slice(t+1),s=o?o.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=j,window.lnCore.hashGet=Be,window.lnCore.hashSet=ze,window.lnCore.hashLinkClick=$e,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Ue,window.lnCore.hashSortDecode=Ge,window.lnCore.hashFilterEncode=Ke,window.lnCore.hashFilterDecode=Qe);function Ye(){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=Ye);function pe(e,t,l,o,s=15){if(o<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const h=Math.max(0,e||0),c=Math.max(0,t||0),f=Math.floor(h/l),r=Math.ceil(c/l),p=Math.max(0,f-s),m=Math.min(o,f+r+s),v=p*l,E=Math.max(0,(o-m)*l);return{start:p,end:m,topPadding:v,bottomPadding:E}}function Je(e,t){const l=Array.isArray(e)?e.length:0,o=t instanceof Set?t:new Set(t||[]);let s=0;if(Array.isArray(e))for(let f=0;f<e.length;f++)o.has(e[f])&&s++;else s=o.size;const h=l>0&&s===l,c=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:h,isIndeterminate:c}}function we(e,t,l){const o=new Set(e);return t==null||((l!==void 0?l:!o.has(t))?o.add(t):o.delete(t)),o}function _e(e,t,l){const o=new Set(e);if(!Array.isArray(t))return o;if(l)for(let s=0;s<t.length;s++)t[s]!=null&&o.add(t[s]);else for(let s=0;s<t.length;s++)o.delete(t[s]);return o}(function(){const e="data-ln-table",t="lnTable",l="data-ln-table-empty";if(window[t]!==void 0)return;function r(i,u){if(!i||!i.isDataDriven)return;const n=i.dom.hasAttribute("data-ln-table-window");if(n&&!i._windowed)i._enterWindowedMode(),i._kickWindowInitial();else if(!n&&i._windowed)i._exitWindowedMode();else if(n&&i._windowed){const a=parseInt(u,10);a>0&&i._cache.configure({windowSize:a})}}function p(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>0&&i._cache.configure({pageSize:n})}function m(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>=0&&i._cache.configure({threshold:n})}function v(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>=0&&i._cache.setGrandTotal(n)}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:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:r,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:m,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:v,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=se(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function R(i,u){if(i==null||isNaN(i))return"";try{return new Intl.NumberFormat(Ee(u)).format(i)}catch{return String(i)}}function I(i){let u=i.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const a=getComputedStyle(u).overflowY;if(a==="auto"||a==="scroll")return u;u=u.parentElement}return null}function A(i){this.dom=i,oe(this,i,q),this.table=i.querySelector("table"),this.tbody=i.querySelector("[data-ln-table-body]")||i.querySelector("tbody"),this.thead=i.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=i.querySelector("[data-ln-table-total]"),this._filteredSpan=i.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==i?this._filteredSpan.parentElement:null),this._selectedSpan=i.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==i?this._selectedSpan.parentElement:null),this.isDataDriven=i.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 n=this;return this._onSetSearch=function(a){const b=(a.detail&&a.detail.query!=null?a.detail.query:a.detail&&a.detail.term!=null?a.detail.term:"").trim();n.isDataDriven?(n.currentSearch=b,D(i,"ln-table:search",{table:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=b.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(a){a.preventDefault(),n._onSetSearch(a)},i.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",D(i,"ln-table:clear-filters",{table:n.name}),n._requestData()):(n._searchTerm="",n._columnFilters={},n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-table:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},i.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&&i.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(a){const b=a.detail||{},d=b.data||[],w=b.total!=null?b.total:d.length;if(!(n._hasInitialSeed&&!n.isLoaded&&d.length===0&&w===0)){if(n._windowed){n._cache.ingest(b)&&!b.provisional&&i.classList.remove("ln-table--loading");return}n._data=d,n._lastTotal=w,n._lastFiltered=b.filtered!=null?b.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._hasInitialSeed=!1,i.classList.remove("ln-table--loading"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),D(i,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount})}},i.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(a){const b=a.detail&&a.detail.loading;i.classList.toggle("ln-table--loading",!!b),b&&(n.isLoaded=!1)},i.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(a){!n._windowed||!n._cache||n._cache.release(a.detail&&a.detail.offset)},i.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!n._windowed||!n._cache||n._cache.revalidate()},i.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(a){if(!(!n._windowed||!n._cache)){if(a&&a.detail&&a.detail.query){const b=a.detail.query;b.search!==void 0&&(n.currentSearch=b.search),b.filters!==void 0&&(n.currentFilters=b.filters),b.sort!==void 0&&(n.currentSort=b.sort)}n._requestData()}},i.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(a){!a.detail||a.detail.field==null||(a.preventDefault(),n.currentSort=a.detail.direction==="none"?null:{field:a.detail.field,direction:a.detail.direction},n._requestData())},i.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(a){if(a.target.closest("[data-ln-table-row-select]")||a.target.closest("[data-ln-table-row-action]")||a.target.closest("a")||a.target.closest("button")||a.ctrlKey||a.metaKey||a.button===1)return;const b=a.target.closest("[data-ln-table-row]");if(!b)return;const d=b.getAttribute("data-ln-table-row-id"),w=b._lnRecord||{};D(i,"ln-table:row-click",{table:n.name,id:d,record:w})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(a){const b=a.target.closest("[data-ln-table-row-action]");if(!b)return;const d=b.closest("[data-ln-table-row]");if(!d)return;const w=b.getAttribute("data-ln-table-row-action"),_=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(i,"ln-table:row-action",{table:n.name,id:_,action:w,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),setTimeout(function(){!n.dom||!document.contains(n.dom)||(n._windowed?n._kickWindowInitial():D(i,"ln-table:request-data",{table:n.name,sort:n.currentSort,filters:n.currentFilters,search:n.currentSearch}))},0)):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){n.tbody.rows.length>0&&(n._emptyTbodyObserver.disconnect(),n._emptyTbodyObserver=null,n._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(a){if(!a.detail||a.detail.column==null)return;a.preventDefault();const b=a.detail.direction==="none"?null:a.detail.direction;n._sortCol=b===null?-1:a.detail.column,n._sortDir=b,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),D(i,"ln-table:sorted",{column:a.detail.column,direction:a.detail.direction,matched:n._filteredData.length,total:n._data.length})},i.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(a){if(a.preventDefault(),!a.detail)return;const b=a.detail.key,d=a.detail.values||[];if(b){if(d.length===0)delete n._columnFilters[b];else{const w=[];for(let _=0;_<d.length;_++)w.push(d[_].toLowerCase());n._columnFilters[b]=w}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},i.addEventListener("ln-filter:change",this._onFilterChange)),this}A.prototype._parseRows=function(){const i=this.tbody.rows,u=this.ths;this._data=[],i.length>0&&(this._rowHeight=i[0].offsetHeight||40),this._lockColumnWidths();for(let n=0;n<i.length;n++){const a=i[n],b=[],d=[],w=[];for(let g=0;g<a.cells.length;g++){const y=a.cells[g],T=y.textContent.trim();b[g]=K(y),d[g]=T.toLowerCase(),y.querySelector("[data-ln-table-row-action]")||w.push(T.toLowerCase())}let _=null;if(this.isDataDriven){_={};const g=a.getAttribute("data-ln-table-row-id");g!=null&&(_.id=g);for(let y=0;y<u.length;y++){const T=u[y].getAttribute("data-ln-table-col");if(T){const L=y;if(L<a.cells.length){const k=a.cells[L];_[T]=K(k)}}}}this._data.push({values:b,rawTexts:d,html:a.outerHTML,searchText:w.join(" "),id:this.isDataDriven&&_?_.id:void 0,..._})}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})},A.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},A.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const i=document.createElement("colgroup");this.ths.forEach(function(u){const n=document.createElement("col");n.style.width=u.offsetWidth+"px",i.appendChild(n)}),this.table.insertBefore(i,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=i},A.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const i=this._lastTotal,u=this.visibleCount;if(i===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 i=this._filteredData.length;i===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):i>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},A.prototype._renderAll=function(){if(this.isDataDriven){const i=this._filteredData,u=document.createDocumentFragment();for(let n=0;n<i.length;n++){const a=this._buildRow(i[n]);if(!a)break;u.appendChild(a)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const i=[],u=this._filteredData;for(let n=0;n<u.length;n++)i.push(u[n].html);this.tbody.innerHTML=i.join(""),this._selectable&&this._restoreSelection()}},A.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const i=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let n=null;if(this._windowed){const a=this._cache?this._cache.peek():null;n=a?this._buildRow(a):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(n=this._buildRow(this._data[0]));n&&this.tbody&&(this.tbody.appendChild(n),this._rowHeight=n.offsetHeight||40,n.remove())}this.isDataDriven?this._scrollContainer=I(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){i._rafId||(i._rafId=requestAnimationFrame(function(){i._rafId=null,i._windowed?i._renderWindowed():i._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},A.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)},A.prototype._renderVirtual=function(){const i=this._filteredData,u=i.length,n=this._rowHeight;if(!n||!u)return;const a=this.thead?this.thead.offsetHeight:0,b=this._scrollContainer;let d,w;if(b){const C=this.table.getBoundingClientRect(),S=b.getBoundingClientRect(),x=C.top-S.top+b.scrollTop+a;d=b.scrollTop-x,w=b.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+a;d=window.scrollY-x,w=window.innerHeight}const _=pe(d,w,n,u,15),g=_.start,y=_.end;if(g===this._vStart&&y===this._vEnd)return;this._vStart=g,this._vEnd=y;const T=this.ths.length||1,L=_.topPadding,k=_.bottomPadding;if(this.isDataDriven){const C=document.createDocumentFragment();if(L>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",S.appendChild(x),C.appendChild(S)}for(let S=g;S<y;S++){const x=this._buildRow(i[S]);x&&C.appendChild(x)}if(k>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",S.appendChild(x),C.appendChild(S)}this.tbody.replaceChildren(C),this._selectable&&this._updateSelectAll()}else{let C="";L>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let S=g;S<y;S++)C+=i[S].html;k>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=C,this._selectable&&this._restoreSelection()}},A.prototype._buildPlaceholderRow=function(){const i=document.createElement("tr");i.className="ln-table__placeholder",i.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",i.appendChild(u),i},A.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const i=this._rowHeight;if(!i)return;const u=this._cache.logicalTotal,n=this.thead?this.thead.offsetHeight:0,a=this._scrollContainer;let b,d;if(a){const C=this.table.getBoundingClientRect(),S=a.getBoundingClientRect(),x=C.top-S.top+a.scrollTop+n;b=a.scrollTop-x,d=a.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+n;b=window.scrollY-x,d=window.innerHeight}const w=pe(b,d,i,u,15),_=w.start,g=w.end;if(_===this._vStart&&g===this._vEnd)return;const y=this.ths.length||1,T=w.topPadding,L=w.bottomPadding,k=document.createDocumentFragment();if(T>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=T+"px",C.appendChild(S),k.appendChild(C)}for(let C=_;C<g;C++)if(this._cache.has(C)){const S=this._buildRow(this._cache.get(C));S&&k.appendChild(S)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=L+"px",C.appendChild(S),k.appendChild(C)}this.tbody.replaceChildren(k),this._vStart=_,this._vEnd=g,this._cache.ensure(_,g)},A.prototype._showEmptyState=function(){const i=this.ths.length||1;let u=null,n=null;if(this.isDataDriven){const a=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&a>0,w=d?this.name+"-empty-filtered":this.name+"-empty";if(n=X(this.dom,w,"ln-table"),!n){const _=this.dom.querySelector("template[data-ln-table-empty]");if(_){const g=d?"search":"initial",y=_.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||_.content.firstElementChild;y&&(n=document.importNode(y,!0))}}if(n)if(n.tagName==="TR")u=n;else{const _=document.createElement("td");_.setAttribute("colspan",String(i)),_.appendChild(n);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(_),u=g}}else{const a=this.dom.querySelector("template["+l+"]"),b=document.createElement("td");b.setAttribute("colspan",String(i)),a&&b.appendChild(document.importNode(a.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})},A.prototype._fillRow=function(i,u){W(i,u);const n=i.querySelectorAll("[data-ln-table-cell-attr]");for(let a=0;a<n.length;a++){const b=n[a],d=b.getAttribute("data-ln-table-cell-attr").split(",");for(let w=0;w<d.length;w++){const _=d[w].trim().split(":");if(_.length!==2)continue;const g=_[0].trim(),y=_[1].trim();u[g]!=null&&b.setAttribute(y,u[g])}}},A.prototype._buildRow=function(i){let u=X(this.dom,this.name+"-row","ln-table");if(!u){const a=this.dom.querySelector("template[data-ln-table-row]");a&&(u=document.importNode(a.content,!0))}let n=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(n)this._fillRow(n,i);else if(i&&i.html){const a=document.createElement("tbody");a.innerHTML=i.html,n=a.firstElementChild}else{n=document.createElement("tr"),n.setAttribute("data-ln-table-row","");const a=this.ths;for(let b=0;b<a.length;b++){const d=a[b].hasAttribute("data-ln-table-col-select"),w=document.createElement("td");if(d){const _=document.createElement("input");_.type="checkbox",_.setAttribute("data-ln-table-row-select",""),_.setAttribute("aria-label","Select row"),w.appendChild(_)}else{const _=a[b].getAttribute("data-ln-table-col");_&&i[_]!=null&&(w.textContent=String(i[_]))}n.appendChild(w)}}if(n._lnRecord=i,i.id!=null&&n.setAttribute("data-ln-table-row-id",i.id),this._selectable&&i.id!=null&&this.selectedIds.has(String(i.id))){n.classList.add("ln-row-selected");const a=n.querySelector("[data-ln-table-row-select]");a&&(a.checked=!0)}return n},A.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}ge(this,"ln-table:request-data","table")},A.prototype._enterWindowedMode=function(){const i=this,u=this.dom,n=parseInt(u.getAttribute("data-ln-table-window"),10),a=parseInt(u.getAttribute("data-ln-table-window-page"),10),b=parseInt(u.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!i._windowed||!i._cache||(i.totalCount=i._cache.grandTotal,i.visibleCount=i._cache.logicalTotal,i._lastTotal=i._cache.grandTotal,i.isLoaded=!0,i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(u,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount}))},this._renderBatch=Pe(this._onCacheChange),this._cache=Ve({windowSize:n>0?n:1e3,pageSize:a>0?a:200,threshold:b>=0?b:25,fetchDebounce:120,requestPage:function(d,w,_){D(u,"ln-table:request-data",{table:i.name,sort:d.sort,filters:d.filters,search:d.search,offset:w,limit:_,queryGen:i._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},A.prototype._kickWindowInitial=function(){if(this._data.length>0){let i=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(i)&&this._totalSpan){const n=this._totalSpan.textContent.replace(/[^\d]/g,"");n&&(i=parseInt(n,10))}const u=i>0?i: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})},A.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()},A.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let a=0;a<i.length;a++){const b=i[a].getAttribute("data-ln-table-row-id");b!=null&&u.push(b)}const n=Je(u,this.selectedIds);this._selectAllCheckbox.checked=n.isAllSelected,this._selectAllCheckbox.indeterminate=n.isIndeterminate},A.prototype._restoreSelection=function(){if(!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<i.length;u++){const n=i[u].getAttribute("data-ln-table-row-id"),a=n!=null&&this.selectedIds.has(n);i[u].classList.toggle("ln-row-selected",a);const b=i[u].querySelector("[data-ln-table-row-select]");b&&(b.checked=a)}this._updateSelectAll()},Object.defineProperty(A.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),A.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const i=this;if(this._onSelectionChange=function(u){const n=u.target.closest("[data-ln-table-row-select]");if(!n)return;const a=n.closest("[data-ln-table-row]");if(!a)return;const b=a.getAttribute("data-ln-table-row-id");b!=null&&(i.selectedIds=we(i.selectedIds,b,n.checked),a.classList.toggle("ln-row-selected",n.checked),i.selectedCount=i.selectedIds.size,i._updateSelectAll(),i._updateFooter(),D(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.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 n=i.dom.querySelector('[data-ln-table-dict="select-all"]'),a=i.dom.getAttribute("data-ln-table-select-all-label")||(n?n.textContent.trim():null)||"Select all";u.setAttribute("aria-label",a),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=i._selectAllCheckbox.checked,n=i.tbody?i.tbody.querySelectorAll("[data-ln-table-row]"):[],a=[];for(let b=0;b<n.length;b++){const d=n[b].getAttribute("data-ln-table-row-id"),w=n[b].querySelector("[data-ln-table-row-select]");d!=null&&(a.push(d),n[b].classList.toggle("ln-row-selected",u),w&&(w.checked=u))}i.selectedIds=_e(i.selectedIds,a,u),i.selectedCount=i.selectedIds.size,D(i.dom,"ln-table:select-all",{table:i.name,selected:u}),D(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.selectedCount}),i._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<u.length;n++){const a=u[n].querySelector("[data-ln-table-row-select]"),b=u[n].getAttribute("data-ln-table-row-id");a&&a.checked&&b!=null&&(i.selectedIds=we(i.selectedIds,b,!0),u[n].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},A.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 i=this.dom.querySelector("[data-ln-table-col-select]");if(i){const u=i.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=_e(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<u.length;n++){u[n].classList.remove("ln-row-selected");const a=u[n].querySelector("[data-ln-table-row-select]");a&&(a.checked=!1)}}this._updateFooter()},A.prototype._updateFooter=function(){let i=0,u=0;this.isDataDriven?(i=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(i=this._data.length,u=this._filteredData.length);const n=u<i;if(this._totalSpan&&(this._totalSpan.textContent=R(i,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=n?R(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!n),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?R(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},A.prototype.destroy=function(){this.dom[t]&&(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[t])},fe(e,t,A,"ln-table",{attributes:E})})()})();
1
+ (function(){"use strict";function G(){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 W(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 s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){r=t[s];break}if(!W(r))return}e.apply(console,t)}}function k(e,t,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function ge(e,t,l){e._applyFilterAndSort(),e._vStart=-1,e._vEnd=-1,e._render(),e._updateFooter();const r={sort:e.currentSort,filters:e.currentFilters,search:e.currentSearch};r[l]=e.name,k(e.dom,t,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()}function Q(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ye(e,t){const l=!!(t&&t.typed),r=t&&t.exclude,s={},h=e.elements,c={};if(l)for(let f=0;f<h.length;f++){const o=h[f];o.name&&o.type==="checkbox"&&!o.disabled&&(c[o.name]=(c[o.name]||0)+1)}for(let f=0;f<h.length;f++){const o=h[f];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")l&&c[o.name]===1?s[o.name]=o.checked:(s[o.name]||(s[o.name]=[]),o.checked&&s[o.name].push(o.value));else if(o.type==="radio")o.checked&&(s[o.name]=o.value);else if(o.type==="select-multiple"){s[o.name]=[];for(let w=0;w<o.options.length;w++)o.options[w].selected&&s[o.name].push(o.options[w].value)}else if(l&&o.type==="hidden")s[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const w=Number(o.value);s[o.name]=o.value===""||isNaN(w)?null:w}else s[o.name]=o.value}return s}function Ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Se(e,t){const l=e.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 t))continue;const o=t[f];if(c.type==="checkbox"){if(Array.isArray(o))c.checked=o.indexOf(c.value)!==-1;else if(s[c.name]>1){const w=String(o).split(",").map(function(m){return m.trim()});c.checked=w.indexOf(c.value)!==-1}else c.checked=Ce(o);r.push(c)}else if(c.type==="radio")c.checked=c.value===String(o),r.push(c);else if(c.type==="select-multiple"){if(Array.isArray(o))for(let w=0;w<c.options.length;w++)c.options[w].selected=o.indexOf(c.options[w].value)!==-1;r.push(c)}else c.value=o,c.tagName==="SELECT"&&o!=null&&c.setAttribute("data-ln-value",o),r.push(c)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Se,window.lnCore.serializeForm=ye,window.lnCore.resolveFormMethod=me);const K={};function ve(e,t){K[e]=t}function Ae(e){return K[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ve,window.lnCore.getDataMapper=Ae);function Ee(e){const t=e?e.closest("[lang]"):null,l=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function De(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Y={};function xe(e,t){if(!e||typeof t!="object")return;const l=e.toLowerCase().split("-")[0];Y[l]=t}function ke(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Y[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=xe,window.lnCore.getLocaleFallback=ke,window.lnCore.ensureLocaleObserver=De);const M={};function J(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const l=M[e];return l?l.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t,l){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return J(t,l)}function Z(e,t){if(!e||!t)return e;const l=e.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const f=l[c],o=f.getAttribute("data-ln-field");t[o]!=null&&(f.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let c=0;c<r.length;c++){const f=r[c],o=f.getAttribute("data-ln-attr").split(",");for(let w=0;w<o.length;w++){const m=o[w].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();t[E]!=null&&f.setAttribute(v,t[E])}}const s=e.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const f=s[c],o=f.getAttribute("data-ln-show");o in t&&f.classList.toggle("hidden",!t[o])}const h=e.querySelectorAll("[data-ln-class]");for(let c=0;c<h.length;c++){const f=h[c],o=f.getAttribute("data-ln-class").split(",");for(let w=0;w<o.length;w++){const m=o[w].trim().split(":");if(m.length!==2)continue;const v=m[0].trim(),E=m[1].trim();E in t&&f.classList.toggle(v,!!t[E])}}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 l=e.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],t??null),l[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)Z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let l=0;l<t.length;l++)t[l].textContent=""}})));function N(e,t){if(!e||!t)return e;const l=document.createTreeWalker(e,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 t[f]!==void 0?t[f]:""}))}const r=function(h,c){return t[c]!==void 0?t[c]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let h=0;h<s.length;h++){const c=s[h],f=c.attributes;for(let o=0;o<f.length;o++){const w=f[o];w.value.indexOf("{{")!==-1&&c.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Te(e,t,l,r,s,h){const c={};for(let o=0;o<e.children.length;o++){const w=e.children[o],m=w.getAttribute("data-ln-render-key");m&&(c[m]=w)}const f=document.createDocumentFragment();for(let o=0;o<t.length;o++){const w=t[o],m=String(r(w));let v=c[m];if(v)s(v,w,o);else{const E=J(l,h);if(!E||(N(E,w),v=E.firstElementChild,!v))continue;v.setAttribute("data-ln-render-key",m),s(v,w,o)}f.appendChild(v)}e.textContent="",e.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=Z,window.lnCore.lnFill=Le,window.lnCore.renderList=Te);function F(e,t,l){const r=e.getAttribute(t);return r===null?l:r}function ee(e,t,l){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?l:r}function P(e,t,l=!1){const r=e.getAttribute(t);if(r===null)return!!l;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(l=>l.trim()).filter(Boolean)}const B=new Map;function ne(e,t){const l=(e?e.join("|"):"")+"::"+t;if(B.has(l))return B.get(l);const r=new Set(e||[]),s=function(h,c){const f=h.getAttribute(c);return f!==null&&r.has(f)?f:t};return B.set(l,s),s}function ie(e,t,l){const r=parseFloat(e.getAttribute(t));return isNaN(r)?l:r}function le(e,t,l){const r=e.getAttribute(t);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function re(e,t,l,r,s){if(!e||t===null)return!0;const h=r||"ln-component",c=e.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||t===""&&e.fallback!==void 0)return!0;const f=o=>{s?console.warn(o,s):console.warn(o)};if(c==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(f(`[${h}] Invalid value "${t}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const o=e.values||[];return o.includes(t)?!0:(f(`[${h}] Invalid value "${t}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(t))return f(`[${h}] Invalid integer "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(f(`[${h}] Value ${o} for attribute "${l}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(f(`[${h}] Value ${o} for attribute "${l}" is greater than max (${e.max}).`),!1):!0}if(c==="float")return isNaN(Number(t))?(f(`[${h}] Invalid float "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(t),!0}catch(o){return f(`[${h}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,l){for(const r in l){const[s,h,c]=l[r];Object.defineProperty(e,r,{get:function(){return s(t,h,c)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const l in e){const r=e[l];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=ne(r.values,r.fallback);break;case"integer":s=ee;break;case"float":s=ie;break;case"boolean":s=P;break;case"list":s=te;break;case"json":s=le;break;case"string":default:s=F;break}s||(s=F),t[r.prop]=[s,l,r.fallback]}return t}function qe(e){const t={};for(const l in e){const r=e[l];r&&r.effect&&(t[l]=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 l in e.effects)t.add(l);if(e.onAttrChange&&e.declared)for(const l of e.declared)t.add(l);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=oe,window.lnCore.attrSpec=se,window.lnCore.attrStr=F,window.lnCore.attrInt=ee,window.lnCore.attrBool=P,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=ie,window.lnCore.attrJson=le);function O(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(l){console.error("["+t.attribute+"] init failed",e,l)}}}function ae(e,t,l,r){if(e.nodeType!==1)return;const h=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",c={selector:t,attribute:l,ComponentFn:r};if(e.matches&&e.matches(h)&&O(e,c),e.querySelectorAll){const f=e.querySelectorAll(h);for(let o=0;o<f.length;o++)O(f[o],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ie(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Fe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ce(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=ce(),l=e.observed||[];for(let r=0;r<l.length;r++){const s=l[r];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 r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const s=t.byDeclaredAttr.get(r);s.some(h=>h.componentTag===e.componentTag)||s.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 s of r)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function de(e,t,l,r){for(let s=0;s<e.length;s++){const h=e[s];if(!t[h.attribute])continue;const c=h.effects&&h.effects[l];c?c(t,l,r):h.onAttrChange&&(!h.declared||h.declared.has(l))&&h.onAttrChange(t,l,r)}}function He(e){const t=e.attributeName,l=t.indexOf("data-ln-")===0,r=ce(),s=r.byAttr.get(t),h=G()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!l&&!s&&!h)return;const c=e.target;if(e.oldValue!==c.getAttribute(t)){if(h&&W(c)){const f=r.byDeclaredAttr.get(t),o=c.getAttribute(t);for(let w=0;w<f.length;w++)re(f[w].spec,o,t,f[w].componentTag,c)}if(window.lnCore._debugSink&&(l||s)&&window.lnCore._debugSink("attr",t,c,{oldValue:e.oldValue,newValue:c.getAttribute(t)}),l){const f=r.byReactive.get(t);f&&de(f,c,t,e.oldValue),r.reactiveWildcard.length&&de(r.reactiveWildcard,c,t,e.oldValue)}if(s)for(let f=0;f<s.length;f++){const o=s[f];if(o.handler){o.handler(c,t,e.oldValue);continue}o.onAttributeChange&&c[o.attribute]?o.onAttributeChange(c,t):(ae(c,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(c))}}}function We(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++)try{He(t[l])}catch(r){console.error("[ln-core] mutation handler failed",t[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function j(e,t){if(!document.contains(e))if(t.attribute){const l=e[t.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ue(e){const t=V();if(!t.length)return;const l=e.target;if(l){const s=l.nodeType===1?l:l.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=z();if(e.target&&r.length)for(let s=0;s<r.length;s++){const h=r[s],c=h.query,f=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;f&&h.onSubtreeChange(f,e)}for(let s=0;s<e.addedNodes.length;s++){const h=e.addedNodes[s];if(h.nodeType===1){const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<t.length;f++){const o=t[f];if(o.selector&&o.attribute&&o.ComponentFn){if(!c)h.matches&&h.matches(o.query)&&O(h,o);else if(h.matches&&h.matches(o.query)&&O(h,o),h.querySelectorAll){const w=h.querySelectorAll(o.query);for(let m=0;m<w.length;m++)O(w[m],o)}}o.onInit&&o.onInit(h)}}}for(let s=0;s<e.removedNodes.length;s++){const h=e.removedNodes[s];if(h.nodeType===1){if(document.contains(h))continue;const c=!!(h.firstElementChild||h.children&&h.children.length);for(let f=0;f<t.length;f++){const o=t[f],w=o.query;if(w){if(!c)h.matches&&h.matches(w)&&j(h,o);else if(h.matches&&h.matches(w)&&j(h,o),h.querySelectorAll){const m=h.querySelectorAll(w);for(let v=0;v<m.length;v++)j(m[v],o)}}}}}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){const e=new MutationObserver(function(t){for(let l=0;l<t.length;l++){const r=t[l];if(r.type==="childList")try{ue(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const l=t.takeRecords();for(let r=0;r<l.length;r++){const s=l[r];if(s.type==="childList")try{ue(s)}catch(h){console.error("[ln-core] lifecycle handler failed",s.target,h)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ne(e){V().push(e),e.onSubtreeChange&&e.query&&z().push(e),he()}function fe(e,t,l,r,s={}){const h=s.extraAttributes||[],c=s.onAttributeChange||null,f=s.onSubtreeChange||null,o=s.onInit||null,w=s.onAttrChange||null,m=s.effects||null,v=s.attributes||null,E=v?qe(v):m,q=v?new Set(Object.keys(v)):null,R=s.persist||null;function I(b){const d=b||document.body;if(ae(d,e,t,l),v&&G())for(const p in v){const _=v[p],g=Array.from(d.querySelectorAll("["+p+"]"));d.matches&&d.matches("["+p+"]")&&g.push(d);for(let y=0;y<g.length;y++){const L=g[y];W(L)&&re(_,L.getAttribute(p),p,r,L)}}o&&o(d)}const A=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let d;for(;(d=b.exec(e))!==null;)A.push(d[1])}else A.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:v,ComponentFn:l,onInit:o,observed:A.concat(h),onAttributeChange:c,onAttrChange:w,effects:E,declared:q,persist:R}),We();const i=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=s.subtreeQuery||(i?e:"["+e+"]"),n={selector:e,attribute:t,ComponentFn:l,onInit:o,onSubtreeChange:f,query:u};V().push(n),f&&u&&z().push(n),he(),window[t]=I,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=Ne,window.lnCore.withoutLifecycle=Me);function a(){Ie()>0?Fe(function(){I(document.body)}):I(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a(),I}function Pe(e,t){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,e()}))}}function Be(e){e=e||{};let t=e.windowSize>0?e.windowSize:1e3,l=e.pageSize>0?e.pageSize:200,r=e.threshold!=null?e.threshold:25,s=e.fetchDebounce!=null?e.fetchDebounce:120;const h=typeof e.requestPage=="function"?e.requestPage:function(){},c=typeof e.onChange=="function"?e.onChange:function(){},f=new Map,o=new Map,w=new Set;let m=0,v=0,E=0,q={sort:null,filters:{},search:""},R=null,I=0,A=0,i=!1;function u(d){o.set(d,++I)}function n(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function a(){if(f.size<=t)return;const d=Array.from(f.keys()).sort(function(_,g){return(o.get(_)||0)-(o.get(g)||0)});let p=0;for(;f.size>t&&p<d.length;)f.delete(d[p]),o.delete(d[p]),p++}function b(d,p){w.add(d),h(q,d,p)}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 m},get grandTotal(){return v},get queryGen(){return E},get size(){return f.size},ensure:function(d,p){clearTimeout(R),A=d;for(let D=d;D<p;D++)f.has(D)&&u(D);if(m<=0)return;const _=Math.max(0,d-r),g=Math.min(m,p+r),y=Math.floor(_/l),L=Math.floor(Math.max(0,g-1)/l);let T=-1;for(let D=y;D<=L;D++){const C=D*l,S=Math.min(l,m-C);let x=!1;const st=Math.max(C,_),at=Math.min(C+S,g);for(let $=st;$<at;$++)if(!f.has($)){x=!0;break}if(x&&!w.has(C)){T=C;break}}T!==-1&&(R=setTimeout(function(){b(T,l)},s))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const p=d.offset||0,_=d.data||[];let g=0;for(let y=0;y<_.length;y++)_[y]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return w.delete(p),!1;i&&(f.clear(),o.clear(),i=!1),d.provisional||(v=d.total!=null?d.total:v,m=d.filtered!=null?d.filtered:d.data?d.data.length:m);for(let y=0;y<_.length;y++)_[y]!=null&&(f.set(p+y,_[y]),u(p+y));return w.delete(p),a(),c(),!0},requestInitial:function(d){d&&(q=d),b(0,l)},invalidate:function(d){E++,w.clear(),clearTimeout(R),d&&(q=d),i=!0,b(0,l)},revalidate:function(){E++,w.clear(),clearTimeout(R),i=!0;const d=Math.max(0,Math.floor(A/l)*l);b(d,l)},release:function(d){w.delete(d)},destroy:function(){clearTimeout(R),f.clear(),o.clear(),w.clear()},configure:function(d){d=d||{};let p=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==t){const _=d.windowSize<t;t=d.windowSize,_&&a(),p=!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),p&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(v=d,n()||(m=d),c())}}}function be(e){return(e||"").replace(/^#/,"")}function U(e){const t=e===void 0?location.hash:e,l={},r=be(t);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(":"),o=f>-1?c.slice(0,f):c,w=f>-1?c.slice(f+1):"";if(o)try{l[o]=decodeURIComponent(w)}catch{l[o]=w}}return l}function Ve(e){if(!e)return null;const t=U();return e in t?t[e]:null}function ze(e,t){if(!e)return;const l=U();t==null?delete l[e]:l[e]=String(t);const s=Object.keys(l).map(function(h){const c=l[h];return c===""?h:h+":"+encodeURIComponent(c)}).join("&");be(location.hash)!==s&&(location.hash=s)}function je(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ue(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const l=e.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.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 $e(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 Qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const l=e.slice(0,t),r=e.slice(t+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=U,window.lnCore.hashGet=Ve,window.lnCore.hashSet=ze,window.lnCore.hashLinkClick=je,window.lnCore.resolveHashNamespace=Ue,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=Ge,window.lnCore.hashFilterEncode=Qe,window.lnCore.hashFilterDecode=Ke);function Ye(e){return(e||"").replace(/^\?/,"")}function Je(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,l={},r=Ye(t);if(!r)return l;const s=new URLSearchParams(r);for(const[h,c]of s.entries())l[h]=c;return l}function Xe(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ze(e,t){if(!e||typeof window>"u")return;const l=new URL(window.location.href);if(t==null||t===""?l.searchParams.delete(e):l.searchParams.set(e,String(t)),l.search===window.location.search)return;const r=l.pathname+l.search+l.hash;window.history.replaceState(window.history.state,"",r)}function et(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const l=e.getAttribute("data-ln-query");if(l&&l.trim()!=="")return l.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 tt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function nt(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const l=t.sort_field||t.sort_by;if(l){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:l,direction:r}}}return null}function it(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function lt(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Je,window.lnCore.queryGet=Xe,window.lnCore.querySet=Ze,window.lnCore.resolveQueryParam=et,window.lnCore.querySortEncode=tt,window.lnCore.querySortDecode=nt,window.lnCore.queryFilterEncode=it,window.lnCore.queryFilterDecode=lt);function rt(){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=rt);function we(e,t,l,r,s=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const h=Math.max(0,e||0),c=Math.max(0,t||0),f=Math.floor(h/l),o=Math.ceil(c/l),w=Math.max(0,f-s),m=Math.min(r,f+o+s),v=w*l,E=Math.max(0,(r-m)*l);return{start:w,end:m,topPadding:v,bottomPadding:E}}function ot(e,t){const l=Array.isArray(e)?e.length:0,r=t instanceof Set?t:new Set(t||[]);let s=0;if(Array.isArray(e))for(let f=0;f<e.length;f++)r.has(e[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 pe(e,t,l){const r=new Set(e);return t==null||((l!==void 0?l:!r.has(t))?r.add(t):r.delete(t)),r}function _e(e,t,l){const r=new Set(e);if(!Array.isArray(t))return r;if(l)for(let s=0;s<t.length;s++)t[s]!=null&&r.add(t[s]);else for(let s=0;s<t.length;s++)r.delete(t[s]);return r}(function(){const e="data-ln-table",t="lnTable",l="data-ln-table-empty";if(window[t]!==void 0)return;function o(i,u){if(!i||!i.isDataDriven)return;const n=i.dom.hasAttribute("data-ln-table-window");if(n&&!i._windowed)i._enterWindowedMode(),i._kickWindowInitial();else if(!n&&i._windowed)i._exitWindowedMode();else if(n&&i._windowed){const a=parseInt(u,10);a>0&&i._cache.configure({windowSize:a})}}function w(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>0&&i._cache.configure({pageSize:n})}function m(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>=0&&i._cache.configure({threshold:n})}function v(i,u){if(!i||!i.isDataDriven||!i._windowed||!i._cache)return;const n=parseInt(u,10);n>=0&&i._cache.setGrandTotal(n)}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:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:o,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:m,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:v,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=se(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function R(i,u){if(i==null||isNaN(i))return"";try{return new Intl.NumberFormat(Ee(u)).format(i)}catch{return String(i)}}function I(i){let u=i.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const a=getComputedStyle(u).overflowY;if(a==="auto"||a==="scroll")return u;u=u.parentElement}return null}function A(i){this.dom=i,oe(this,i,q),this.table=i.querySelector("table"),this.tbody=i.querySelector("[data-ln-table-body]")||i.querySelector("tbody"),this.thead=i.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=i.querySelector("[data-ln-table-total]"),this._filteredSpan=i.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==i?this._filteredSpan.parentElement:null),this._selectedSpan=i.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==i?this._selectedSpan.parentElement:null),this.isDataDriven=i.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 n=this;return this._onSetSearch=function(a){const b=(a.detail&&a.detail.query!=null?a.detail.query:a.detail&&a.detail.term!=null?a.detail.term:"").trim();n.isDataDriven?(n.currentSearch=b,k(i,"ln-table:search",{table:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=b.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),k(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(a){a.preventDefault(),n._onSetSearch(a)},i.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",k(i,"ln-table:clear-filters",{table:n.name}),n._requestData()):(n._searchTerm="",n._columnFilters={},n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),k(i,"ln-table:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},i.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&&i.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(a){const b=a.detail||{},d=b.data||[],p=b.total!=null?b.total:d.length;if(!(n._hasInitialSeed&&!n.isLoaded&&d.length===0&&p===0)){if(n._windowed){n._cache.ingest(b)&&!b.provisional&&i.classList.remove("ln-table--loading");return}n._data=d,n._lastTotal=p,n._lastFiltered=b.filtered!=null?b.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._hasInitialSeed=!1,i.classList.remove("ln-table--loading"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),k(i,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount})}},i.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(a){const b=a.detail&&a.detail.loading;i.classList.toggle("ln-table--loading",!!b),b&&(n.isLoaded=!1)},i.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(a){!n._windowed||!n._cache||n._cache.release(a.detail&&a.detail.offset)},i.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!n._windowed||!n._cache||n._cache.revalidate()},i.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(a){if(!(!n._windowed||!n._cache)){if(a&&a.detail&&a.detail.query){const b=a.detail.query;b.search!==void 0&&(n.currentSearch=b.search),b.filters!==void 0&&(n.currentFilters=b.filters),b.sort!==void 0&&(n.currentSort=b.sort)}n._requestData()}},i.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(a){!a.detail||a.detail.field==null||(a.preventDefault(),n.currentSort=a.detail.direction==="none"?null:{field:a.detail.field,direction:a.detail.direction},n._requestData())},i.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(a){if(a.target.closest("[data-ln-table-row-select]")||a.target.closest("[data-ln-table-row-action]")||a.target.closest("a")||a.target.closest("button")||a.ctrlKey||a.metaKey||a.button===1)return;const b=a.target.closest("[data-ln-table-row]");if(!b)return;const d=b.getAttribute("data-ln-table-row-id"),p=b._lnRecord||{};k(i,"ln-table:row-click",{table:n.name,id:d,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(a){const b=a.target.closest("[data-ln-table-row-action]");if(!b)return;const d=b.closest("[data-ln-table-row]");if(!d)return;const p=b.getAttribute("data-ln-table-row-action"),_=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};k(i,"ln-table:row-action",{table:n.name,id:_,action:p,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),setTimeout(function(){!n.dom||!document.contains(n.dom)||(n._windowed?n._kickWindowInitial():k(i,"ln-table:request-data",{table:n.name,sort:n.currentSort,filters:n.currentFilters,search:n.currentSearch}))},0)):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){n.tbody.rows.length>0&&(n._emptyTbodyObserver.disconnect(),n._emptyTbodyObserver=null,n._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(a){if(!a.detail||a.detail.column==null)return;a.preventDefault();const b=a.detail.direction==="none"?null:a.detail.direction;n._sortCol=b===null?-1:a.detail.column,n._sortDir=b,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),k(i,"ln-table:sorted",{column:a.detail.column,direction:a.detail.direction,matched:n._filteredData.length,total:n._data.length})},i.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(a){if(a.preventDefault(),!a.detail)return;const b=a.detail.key,d=a.detail.values||[];if(b){if(d.length===0)delete n._columnFilters[b];else{const p=[];for(let _=0;_<d.length;_++)p.push(d[_].toLowerCase());n._columnFilters[b]=p}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),k(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},i.addEventListener("ln-filter:change",this._onFilterChange)),this}A.prototype._parseRows=function(){const i=this.tbody.rows,u=this.ths;this._data=[],i.length>0&&(this._rowHeight=i[0].offsetHeight||40),this._lockColumnWidths();for(let n=0;n<i.length;n++){const a=i[n],b=[],d=[],p=[];for(let g=0;g<a.cells.length;g++){const y=a.cells[g],L=y.textContent.trim();b[g]=Q(y),d[g]=L.toLowerCase(),y.querySelector("[data-ln-table-row-action]")||p.push(L.toLowerCase())}let _=null;if(this.isDataDriven){_={};const g=a.getAttribute("data-ln-table-row-id");g!=null&&(_.id=g);for(let y=0;y<u.length;y++){const L=u[y].getAttribute("data-ln-table-col");if(L){const T=y;if(T<a.cells.length){const D=a.cells[T];_[L]=Q(D)}}}}this._data.push({values:b,rawTexts:d,html:a.outerHTML,searchText:p.join(" "),id:this.isDataDriven&&_?_.id:void 0,..._})}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})},A.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},A.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const i=document.createElement("colgroup");this.ths.forEach(function(u){const n=document.createElement("col");n.style.width=u.offsetWidth+"px",i.appendChild(n)}),this.table.insertBefore(i,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=i},A.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const i=this._lastTotal,u=this.visibleCount;if(i===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 i=this._filteredData.length;i===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):i>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},A.prototype._renderAll=function(){if(this.isDataDriven){const i=this._filteredData,u=document.createDocumentFragment();for(let n=0;n<i.length;n++){const a=this._buildRow(i[n]);if(!a)break;u.appendChild(a)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const i=[],u=this._filteredData;for(let n=0;n<u.length;n++)i.push(u[n].html);this.tbody.innerHTML=i.join(""),this._selectable&&this._restoreSelection()}},A.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const i=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let n=null;if(this._windowed){const a=this._cache?this._cache.peek():null;n=a?this._buildRow(a):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(n=this._buildRow(this._data[0]));n&&this.tbody&&(this.tbody.appendChild(n),this._rowHeight=n.offsetHeight||40,n.remove())}this.isDataDriven?this._scrollContainer=I(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){i._rafId||(i._rafId=requestAnimationFrame(function(){i._rafId=null,i._windowed?i._renderWindowed():i._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},A.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)},A.prototype._renderVirtual=function(){const i=this._filteredData,u=i.length,n=this._rowHeight;if(!n||!u)return;const a=this.thead?this.thead.offsetHeight:0,b=this._scrollContainer;let d,p;if(b){const C=this.table.getBoundingClientRect(),S=b.getBoundingClientRect(),x=C.top-S.top+b.scrollTop+a;d=b.scrollTop-x,p=b.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+a;d=window.scrollY-x,p=window.innerHeight}const _=we(d,p,n,u,15),g=_.start,y=_.end;if(g===this._vStart&&y===this._vEnd)return;this._vStart=g,this._vEnd=y;const L=this.ths.length||1,T=_.topPadding,D=_.bottomPadding;if(this.isDataDriven){const C=document.createDocumentFragment();if(T>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",L),x.style.height=T+"px",S.appendChild(x),C.appendChild(S)}for(let S=g;S<y;S++){const x=this._buildRow(i[S]);x&&C.appendChild(x)}if(D>0){const S=document.createElement("tr");S.className="ln-table__spacer",S.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",L),x.style.height=D+"px",S.appendChild(x),C.appendChild(S)}this.tbody.replaceChildren(C),this._selectable&&this._updateSelectAll()}else{let C="";T>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+T+'px;padding:0;border:none"></td></tr>');for(let S=g;S<y;S++)C+=i[S].html;D>0&&(C+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+L+'" style="height:'+D+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=C,this._selectable&&this._restoreSelection()}},A.prototype._buildPlaceholderRow=function(){const i=document.createElement("tr");i.className="ln-table__placeholder",i.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",i.appendChild(u),i},A.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const i=this._rowHeight;if(!i)return;const u=this._cache.logicalTotal,n=this.thead?this.thead.offsetHeight:0,a=this._scrollContainer;let b,d;if(a){const C=this.table.getBoundingClientRect(),S=a.getBoundingClientRect(),x=C.top-S.top+a.scrollTop+n;b=a.scrollTop-x,d=a.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+n;b=window.scrollY-x,d=window.innerHeight}const p=we(b,d,i,u,15),_=p.start,g=p.end;if(_===this._vStart&&g===this._vEnd)return;const y=this.ths.length||1,L=p.topPadding,T=p.bottomPadding,D=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=L+"px",C.appendChild(S),D.appendChild(C)}for(let C=_;C<g;C++)if(this._cache.has(C)){const S=this._buildRow(this._cache.get(C));S&&D.appendChild(S)}else D.appendChild(this._buildPlaceholderRow());if(T>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const S=document.createElement("td");S.setAttribute("colspan",y),S.style.height=T+"px",C.appendChild(S),D.appendChild(C)}this.tbody.replaceChildren(D),this._vStart=_,this._vEnd=g,this._cache.ensure(_,g)},A.prototype._showEmptyState=function(){const i=this.ths.length||1;let u=null,n=null;if(this.isDataDriven){const a=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&a>0,p=d?this.name+"-empty-filtered":this.name+"-empty";if(n=X(this.dom,p,"ln-table"),!n){const _=this.dom.querySelector("template[data-ln-table-empty]");if(_){const g=d?"search":"initial",y=_.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||_.content.firstElementChild;y&&(n=document.importNode(y,!0))}}if(n)if(n.tagName==="TR")u=n;else{const _=document.createElement("td");_.setAttribute("colspan",String(i)),_.appendChild(n);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(_),u=g}}else{const a=this.dom.querySelector("template["+l+"]"),b=document.createElement("td");b.setAttribute("colspan",String(i)),a&&b.appendChild(document.importNode(a.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(),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})},A.prototype._fillRow=function(i,u){N(i,u);const n=i.querySelectorAll("[data-ln-table-cell-attr]");for(let a=0;a<n.length;a++){const b=n[a],d=b.getAttribute("data-ln-table-cell-attr").split(",");for(let p=0;p<d.length;p++){const _=d[p].trim().split(":");if(_.length!==2)continue;const g=_[0].trim(),y=_[1].trim();u[g]!=null&&b.setAttribute(y,u[g])}}},A.prototype._buildRow=function(i){let u=X(this.dom,this.name+"-row","ln-table");if(!u){const a=this.dom.querySelector("template[data-ln-table-row]");a&&(u=document.importNode(a.content,!0))}let n=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(n)this._fillRow(n,i);else if(i&&i.html){const a=document.createElement("tbody");a.innerHTML=i.html,n=a.firstElementChild}else{n=document.createElement("tr"),n.setAttribute("data-ln-table-row","");const a=this.ths;for(let b=0;b<a.length;b++){const d=a[b].hasAttribute("data-ln-table-col-select"),p=document.createElement("td");if(d){const _=document.createElement("input");_.type="checkbox",_.setAttribute("data-ln-table-row-select",""),_.setAttribute("aria-label","Select row"),p.appendChild(_)}else{const _=a[b].getAttribute("data-ln-table-col");_&&i[_]!=null&&(p.textContent=String(i[_]))}n.appendChild(p)}}if(n._lnRecord=i,i.id!=null&&n.setAttribute("data-ln-table-row-id",i.id),this._selectable&&i.id!=null&&this.selectedIds.has(String(i.id))){n.classList.add("ln-row-selected");const a=n.querySelector("[data-ln-table-row-select]");a&&(a.checked=!0)}return n},A.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}ge(this,"ln-table:request-data","table")},A.prototype._enterWindowedMode=function(){const i=this,u=this.dom,n=parseInt(u.getAttribute("data-ln-table-window"),10),a=parseInt(u.getAttribute("data-ln-table-window-page"),10),b=parseInt(u.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!i._windowed||!i._cache||(i.totalCount=i._cache.grandTotal,i.visibleCount=i._cache.logicalTotal,i._lastTotal=i._cache.grandTotal,i.isLoaded=!0,i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),k(u,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount}))},this._renderBatch=Pe(this._onCacheChange),this._cache=Be({windowSize:n>0?n:1e3,pageSize:a>0?a:200,threshold:b>=0?b:25,fetchDebounce:120,requestPage:function(d,p,_){k(u,"ln-table:request-data",{table:i.name,sort:d.sort,filters:d.filters,search:d.search,offset:p,limit:_,queryGen:i._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},A.prototype._kickWindowInitial=function(){if(this._data.length>0){let i=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(i)&&this._totalSpan){const n=this._totalSpan.textContent.replace(/[^\d]/g,"");n&&(i=parseInt(n,10))}const u=i>0?i: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})},A.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()},A.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let a=0;a<i.length;a++){const b=i[a].getAttribute("data-ln-table-row-id");b!=null&&u.push(b)}const n=ot(u,this.selectedIds);this._selectAllCheckbox.checked=n.isAllSelected,this._selectAllCheckbox.indeterminate=n.isIndeterminate},A.prototype._restoreSelection=function(){if(!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<i.length;u++){const n=i[u].getAttribute("data-ln-table-row-id"),a=n!=null&&this.selectedIds.has(n);i[u].classList.toggle("ln-row-selected",a);const b=i[u].querySelector("[data-ln-table-row-select]");b&&(b.checked=a)}this._updateSelectAll()},Object.defineProperty(A.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),A.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const i=this;if(this._onSelectionChange=function(u){const n=u.target.closest("[data-ln-table-row-select]");if(!n)return;const a=n.closest("[data-ln-table-row]");if(!a)return;const b=a.getAttribute("data-ln-table-row-id");b!=null&&(i.selectedIds=pe(i.selectedIds,b,n.checked),a.classList.toggle("ln-row-selected",n.checked),i.selectedCount=i.selectedIds.size,i._updateSelectAll(),i._updateFooter(),k(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.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 n=i.dom.querySelector('[data-ln-table-dict="select-all"]'),a=i.dom.getAttribute("data-ln-table-select-all-label")||(n?n.textContent.trim():null)||"Select all";u.setAttribute("aria-label",a),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=i._selectAllCheckbox.checked,n=i.tbody?i.tbody.querySelectorAll("[data-ln-table-row]"):[],a=[];for(let b=0;b<n.length;b++){const d=n[b].getAttribute("data-ln-table-row-id"),p=n[b].querySelector("[data-ln-table-row-select]");d!=null&&(a.push(d),n[b].classList.toggle("ln-row-selected",u),p&&(p.checked=u))}i.selectedIds=_e(i.selectedIds,a,u),i.selectedCount=i.selectedIds.size,k(i.dom,"ln-table:select-all",{table:i.name,selected:u}),k(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.selectedCount}),i._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<u.length;n++){const a=u[n].querySelector("[data-ln-table-row-select]"),b=u[n].getAttribute("data-ln-table-row-id");a&&a.checked&&b!=null&&(i.selectedIds=pe(i.selectedIds,b,!0),u[n].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},A.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 i=this.dom.querySelector("[data-ln-table-col-select]");if(i){const u=i.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=_e(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<u.length;n++){u[n].classList.remove("ln-row-selected");const a=u[n].querySelector("[data-ln-table-row-select]");a&&(a.checked=!1)}}this._updateFooter()},A.prototype._updateFooter=function(){let i=0,u=0;this.isDataDriven?(i=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(i=this._data.length,u=this._filteredData.length);const n=u<i;if(this._totalSpan&&(this._totalSpan.textContent=R(i,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=n?R(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!n),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?R(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},A.prototype.destroy=function(){this.dom[t]&&(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[t])},fe(e,t,A,"ln-table",{attributes:E})})()})();