@livenetworks/ashlar 2.1.10 → 2.1.12

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 (71) hide show
  1. package/components/COMPONENTS.md +1 -1
  2. package/components/ln-accordion/ln-accordion.js +1 -1
  3. package/components/ln-ajax/ln-ajax.js +1 -1
  4. package/components/ln-api-connector/ln-api-connector.js +1 -1
  5. package/components/ln-api-queue/ln-api-queue.js +1 -1
  6. package/components/ln-autosave/ln-autosave.js +1 -1
  7. package/components/ln-chart/ln-chart.js +1 -1
  8. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  9. package/components/ln-confirm/ln-confirm.js +1 -1
  10. package/components/ln-core/events.js +5 -2
  11. package/components/ln-core/lifecycle.js +25 -44
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/README.md +19 -0
  15. package/components/ln-data-store/ln-data-store.js +1 -1
  16. package/components/ln-data-store/ln-data-store.schema.json +92 -84
  17. package/components/ln-data-store/src/data-store-model.js +17 -0
  18. package/components/ln-data-store/src/ln-data-store.js +77 -1
  19. package/components/ln-date/ln-date.js +1 -1
  20. package/components/ln-debug/ln-debug.js +1 -1
  21. package/components/ln-debug/ln-debug.schema.json +28 -28
  22. package/components/ln-debug/src/debug-verifier.js +24 -30
  23. package/components/ln-debug/src/generated-attributes.js +1 -3
  24. package/components/ln-debug/src/ln-debug.js +3 -11
  25. package/components/ln-dropdown/ln-dropdown.js +1 -1
  26. package/components/ln-editor/ln-editor.js +1 -1
  27. package/components/ln-external-links/ln-external-links.js +1 -1
  28. package/components/ln-filter/ln-filter.js +1 -1
  29. package/components/ln-form/ln-form.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/ln-search.js +1 -1
  47. package/components/ln-slug/ln-slug.js +1 -1
  48. package/components/ln-sort/ln-sort.js +1 -1
  49. package/components/ln-sortable/ln-sortable.js +1 -1
  50. package/components/ln-stat/ln-stat.js +1 -1
  51. package/components/ln-table/README.md +69 -38
  52. package/components/ln-table/ln-table.js +1 -1
  53. package/components/ln-table/ln-table.schema.json +11 -35
  54. package/components/ln-table/src/ln-table.js +306 -414
  55. package/components/ln-table/src/table-model.js +31 -0
  56. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  57. package/components/ln-tabs/ln-tabs.js +1 -1
  58. package/components/ln-time/ln-time.js +1 -1
  59. package/components/ln-toast/ln-toast.js +1 -1
  60. package/components/ln-toggle/ln-toggle.js +1 -1
  61. package/components/ln-tooltip/ln-tooltip.js +1 -1
  62. package/components/ln-translations/ln-translations.js +1 -1
  63. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  64. package/components/ln-upload/ln-upload.js +1 -1
  65. package/components/ln-validate/ln-validate.js +1 -1
  66. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  67. package/ln-ashlar.html-data.json +7 -17
  68. package/package.json +1 -1
  69. package/theme/config/mixins/_ln-table.scss +18 -10
  70. package/theme/config/mixins/_table.scss +15 -2
  71. package/web-types.json +14 -28
@@ -1 +1 @@
1
- (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!L(o))return}e.apply(console,t)}}function H(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 J(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}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 G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Q(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[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&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&l[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);l[r.name]=r.value===""||isNaN(a)?null:a}else l[r.name]=r.value}return l}function z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(r).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=z(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<i.options.length;a++)i.options[a].selected=r.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=Q,window.lnCore.resolveFormMethod=G);const E={};function X(e,t){E[e]=t}function Z(e){return E[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=X,window.lnCore.getDataMapper=Z);function ee(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){H(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function te(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];q[n]=t}function ne(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=te,window.lnCore.getLocaleFallback=ne,window.lnCore.ensureLocaleObserver=ee);const C={};function re(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function O(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();t[p]!=null&&c.setAttribute(h,t[p])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();p in t&&c.classList.toggle(h,!!t[p])}}return e}function oe(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)O(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ie(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const a=e.children[r],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],d=String(o(a));let h=i[d];if(h)l(h,a,r);else{const p=re(n,s);if(!p||(D(p,a),h=p.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",d),l(h,a,r)}c.appendChild(h)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=O,window.lnCore.lnFill=oe,window.lnCore.renderList=ie);function m(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function R(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function F(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function I(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function T(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return A.set(n,l),l}function $(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function N(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function le(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{l?console.warn(r,l):console.warn(r)};if(i==="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(i==="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(i==="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(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function se(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function ce(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=T(o.values,o.fallback);break;case"integer":l=R;break;case"float":l=$;break;case"boolean":l=F;break;case"list":l=I;break;case"json":l=N;break;case"string":default:l=m;break}l||(l=m),t[o.prop]=[l,n,o.fallback]}return t}function ue(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=se,window.lnCore.attrSpec=ce,window.lnCore.attrStr=m,window.lnCore.attrInt=R,window.lnCore.attrBool=F,window.lnCore.attrList=I,window.lnCore.attrEnum=T,window.lnCore.attrFloat=$,window.lnCore.attrJson=N);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ae(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&y(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)y(c[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function B(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=B(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ue(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function fe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=B(),l=o.byAttr.get(t),s=P()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&L(i)){const c=o.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let a=0;a<c.length;a++)le(c[a].spec,r,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&M(c,i,t,e.oldValue),o.reactiveWildcard.length&&M(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const r=l[c];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function we(){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{fe(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 j(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function W(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function k(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 he(e){const t=j();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=W();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(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(!i)s.matches&&s.matches(r.query)&&y(s,r);else if(s.matches&&s.matches(r.query)&&y(s,r),s.querySelectorAll){const a=s.querySelectorAll(r.query);for(let d=0;d<a.length;d++)y(a[d],r)}}r.onInit&&r.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){if(document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a){if(!i)s.matches&&s.matches(a)&&k(s,r);else if(s.matches&&s.matches(a)&&k(s,r),s.querySelectorAll){const d=s.querySelectorAll(a);for(let h=0;h<d.length;h++)k(d[h],r)}}}}}}function be(){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{he(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function pe(e,t){de({observed:e,handler:t}),we()}function ge(e){j().push(e),e.onSubtreeChange&&e.query&&W().push(e),be()}function U(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},o=U(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ye(e){if(!e)return null;const t=_();return e in t?t[e]:null}function Ce(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");U(location.hash)!==l&&(location.hash=l)}function me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ve(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ce,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=Se);function xe(e){return(e||"").replace(/^\?/,"")}function Le(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=xe(t);if(!o)return n;const l=new URLSearchParams(o);for(const[s,i]of l.entries())n[s]=i;return n}function Ee(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function qe(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 Oe(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 De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(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 Fe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ie(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=Le,window.lnCore.queryGet=Ee,window.lnCore.querySet=qe,window.lnCore.resolveQueryParam=Oe,window.lnCore.querySortEncode=De,window.lnCore.querySortDecode=Re,window.lnCore.queryFilterEncode=Fe,window.lnCore.queryFilterDecode=Ie);function Te(){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=Te),(function(){const e="data-ln-link",t="lnLink";if(window[t]!==void 0)return;let n=null;function o(){n=document.createElement("div"),n.className="ln-link-status",document.body.appendChild(n)}function l(u){n&&(n.textContent=u,n.classList.add("ln-link-status--visible"))}function s(){n&&n.classList.remove("ln-link-status--visible")}function i(u,f){if(f.target.closest("a, button, input, select, textarea"))return;const w=u.querySelector("a");if(!w)return;const b=w.getAttribute("href");if(!b)return;if(f.ctrlKey||f.metaKey||f.button===1){window.open(b,"_blank","noopener,noreferrer");return}J(u,"ln-link:navigate",{target:u,href:b,link:w}).defaultPrevented||w.click()}function c(u){const f=u.querySelector("a");if(!f)return;const w=f.getAttribute("href");w&&l(w)}function r(){s()}function a(u){u[t+"Row"]||!u.querySelector("a")||(u[t+"Row"]=!0,u._lnLinkClick=function(w){i(u,w)},u._lnLinkEnter=function(){c(u)},u.addEventListener("click",u._lnLinkClick),u.addEventListener("mouseenter",u._lnLinkEnter),u.addEventListener("mouseleave",r))}function d(u){u[t+"Row"]&&(u._lnLinkClick&&u.removeEventListener("click",u._lnLinkClick),u._lnLinkEnter&&u.removeEventListener("mouseenter",u._lnLinkEnter),u.removeEventListener("mouseleave",r),delete u._lnLinkClick,delete u._lnLinkEnter,delete u[t+"Row"])}function h(u){if(!u[t+"Init"])return;const f=u.tagName;if(f==="TABLE"||f==="TBODY"){const w=f==="TABLE"&&u.querySelector("tbody")||u;for(const b of w.querySelectorAll("tr"))d(b)}else d(u);delete u[t+"Init"]}function p(u){if(u[t+"Init"])return;u[t+"Init"]=!0;const f=u.tagName;if(f==="TABLE"||f==="TBODY"){const w=f==="TABLE"&&u.querySelector("tbody")||u;for(const b of w.querySelectorAll("tr"))a(b)}else a(u)}function v(u){u.hasAttribute&&u.hasAttribute(e)&&p(u);const f=u.querySelectorAll?u.querySelectorAll("["+e+"]"):[];for(const w of f)p(w)}function $e(){g(function(){ge({query:"["+e+"]",onInit:function(u){v(u)},onSubtreeChange:function(u,f){for(let w=0;w<f.addedNodes.length;w++){const b=f.addedNodes[w];if(b.nodeType===1){if(b.tagName==="TR")a(b);else if(b.querySelectorAll){const S=b.querySelectorAll("tr");for(let x=0;x<S.length;x++)a(S[x])}}}}}),pe([e],function(u){u.hasAttribute&&u.hasAttribute(e)?v(u):h(u)})},"ln-link")}function V(u){v(u)}window[t]={init:V,destroy:h};function K(){o(),$e(),V(document.body)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",K):K()})()})();
1
+ (function(){"use strict";function P(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function x(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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!x(o))return}e.apply(console,t)}}function H(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 J(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}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 G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Q(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[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&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&l[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);l[r.name]=r.value===""||isNaN(a)?null:a}else l[r.name]=r.value}return l}function z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(r).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=z(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<i.options.length;a++)i.options[a].selected=r.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=Q,window.lnCore.resolveFormMethod=G);const E={};function X(e,t){E[e]=t}function Z(e){return E[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=X,window.lnCore.getDataMapper=Z);function ee(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){H(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const L={};function te(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];L[n]=t}function ne(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return L[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=te,window.lnCore.getLocaleFallback=ne,window.lnCore.ensureLocaleObserver=ee);const m={};function re(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 q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();t[p]!=null&&c.setAttribute(f,t[p])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();p in t&&c.classList.toggle(f,!!t[p])}}return e}function oe(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)q(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 O(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ie(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const a=e.children[r],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],d=String(o(a));let f=i[d];if(f)l(f,a,r);else{const p=re(n,s);if(!p||(O(p,a),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),l(f,a,r)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=O,window.lnCore.fill=q,window.lnCore.lnFill=oe,window.lnCore.renderList=ie);function C(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function D(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function I(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function F(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return A.set(n,l),l}function T(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function $(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function le(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{l?console.warn(r,l):console.warn(r)};if(i==="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(i==="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(i==="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(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function se(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function ce(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=F(o.values,o.fallback);break;case"integer":l=D;break;case"float":l=T;break;case"boolean":l=I;break;case"list":l=R;break;case"json":l=$;break;case"string":default:l=C;break}l||(l=C),t[o.prop]=[l,n,o.fallback]}return t}function ue(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=se,window.lnCore.attrSpec=ce,window.lnCore.attrStr=C,window.lnCore.attrInt=D,window.lnCore.attrBool=I,window.lnCore.attrList=R,window.lnCore.attrEnum=F,window.lnCore.attrFloat=T,window.lnCore.attrJson=$);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ae(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&y(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)y(c[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function N(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=N(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ue(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function B(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function fe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=N(),l=o.byAttr.get(t),s=P()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&x(i)){const c=o.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let a=0;a<c.length;a++)le(c[a].spec,r,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&B(c,i,t,e.oldValue),o.reactiveWildcard.length&&B(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const r=l[c];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function we(){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{fe(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 M(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function W(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 he(e){const t=M();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=j();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType!==1)continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&(r.ComponentFn&&y(s,r),r.onInit&&r.onInit(s)),i&&s.querySelectorAll)){const d=s.querySelectorAll(a);for(let f=0;f<d.length;f++)r.ComponentFn&&y(d[f],r),r.onInit&&r.onInit(d[f])}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType!==1||document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&W(s,r),i&&s.querySelectorAll)){const d=s.querySelectorAll(a);for(let f=0;f<d.length;f++)W(d[f],r)}}}}function be(){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{he(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function pe(e,t){de({observed:e,handler:t}),we()}function ge(e){M().push(e),e.onSubtreeChange&&e.query&&j().push(e),be()}function U(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},o=U(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ye(e){if(!e)return null;const t=k();return e in t?t[e]:null}function me(e,t){if(!e)return;const n=k();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");U(location.hash)!==l&&(location.hash=l)}function Ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ve(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=ye,window.lnCore.hashSet=me,window.lnCore.hashLinkClick=Ce,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=Se);function xe(e){return(e||"").replace(/^\?/,"")}function Ee(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=xe(t);if(!o)return n;const l=new URLSearchParams(o);for(const[s,i]of l.entries())n[s]=i;return n}function Le(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function qe(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 Oe(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 De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 Re(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Fe(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=Ee,window.lnCore.queryGet=Le,window.lnCore.querySet=qe,window.lnCore.resolveQueryParam=Oe,window.lnCore.querySortEncode=De,window.lnCore.querySortDecode=Ie,window.lnCore.queryFilterEncode=Re,window.lnCore.queryFilterDecode=Fe);function Te(){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=Te),(function(){const e="data-ln-link",t="lnLink";if(window[t]!==void 0)return;let n=null;function o(){n=document.createElement("div"),n.className="ln-link-status",document.body.appendChild(n)}function l(u){n&&(n.textContent=u,n.classList.add("ln-link-status--visible"))}function s(){n&&n.classList.remove("ln-link-status--visible")}function i(u,w){if(w.target.closest("a, button, input, select, textarea"))return;const h=u.querySelector("a");if(!h)return;const b=h.getAttribute("href");if(!b)return;if(w.ctrlKey||w.metaKey||w.button===1){window.open(b,"_blank","noopener,noreferrer");return}J(u,"ln-link:navigate",{target:u,href:b,link:h}).defaultPrevented||h.click()}function c(u){const w=u.querySelector("a");if(!w)return;const h=w.getAttribute("href");h&&l(h)}function r(){s()}function a(u){u[t+"Row"]||!u.querySelector("a")||(u[t+"Row"]=!0,u._lnLinkClick=function(h){i(u,h)},u._lnLinkEnter=function(){c(u)},u.addEventListener("click",u._lnLinkClick),u.addEventListener("mouseenter",u._lnLinkEnter),u.addEventListener("mouseleave",r))}function d(u){u[t+"Row"]&&(u._lnLinkClick&&u.removeEventListener("click",u._lnLinkClick),u._lnLinkEnter&&u.removeEventListener("mouseenter",u._lnLinkEnter),u.removeEventListener("mouseleave",r),delete u._lnLinkClick,delete u._lnLinkEnter,delete u[t+"Row"])}function f(u){if(!u[t+"Init"])return;const w=u.tagName;if(w==="TABLE"||w==="TBODY"){const h=w==="TABLE"&&u.querySelector("tbody")||u;for(const b of h.querySelectorAll("tr"))d(b)}else d(u);delete u[t+"Init"]}function p(u){if(u[t+"Init"])return;u[t+"Init"]=!0;const w=u.tagName;if(w==="TABLE"||w==="TBODY"){const h=w==="TABLE"&&u.querySelector("tbody")||u;for(const b of h.querySelectorAll("tr"))a(b)}else a(u)}function _(u){u.hasAttribute&&u.hasAttribute(e)&&p(u);const w=u.querySelectorAll?u.querySelectorAll("["+e+"]"):[];for(const h of w)p(h)}function $e(){g(function(){ge({query:"["+e+"]",onInit:function(u){_(u)},onSubtreeChange:function(u,w){for(let h=0;h<w.addedNodes.length;h++){const b=w.addedNodes[h];if(b.nodeType===1){if(b.tagName==="TR")a(b);else if(b.querySelectorAll){const v=b.querySelectorAll("tr");for(let S=0;S<v.length;S++)a(v[S])}}}}}),pe([e],function(u){u.hasAttribute&&u.hasAttribute(e)?_(u):f(u)})},"ln-link")}function V(u){_(u)}window[t]={init:V,destroy:f};function K(){o(),$e(),V(document.body)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",K):K()})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function nt(){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 G(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let s=null;for(let a=1;a<e.length;a++)if(e[a]&&e[a].nodeType===1){s=e[a];break}if(!G(s))return}t.apply(console,e)}}function D(t,e,l){const s=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,s),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function At(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const s={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};s[l]=t.name,D(t.dom,e,s)}function $(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){$(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function it(t){return t.hasAttribute("value")?t.getAttribute("value"):t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.textContent.trim()}function Et(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function Dt(t,e){const l=!!(e&&e.typed),s=e&&e.exclude,a={},u=t.elements,d={};if(l)for(let h=0;h<u.length;h++){const o=u[h];o.name&&o.type==="checkbox"&&!o.disabled&&(d[o.name]=(d[o.name]||0)+1)}for(let h=0;h<u.length;h++){const o=u[h];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(s&&o.matches&&o.matches(s)))if(o.type==="checkbox")l&&d[o.name]===1?a[o.name]=o.checked:(a[o.name]||(a[o.name]=[]),o.checked&&a[o.name].push(o.value));else if(o.type==="radio")o.checked&&(a[o.name]=o.value);else if(o.type==="select-multiple"){a[o.name]=[];for(let p=0;p<o.options.length;p++)o.options[p].selected&&a[o.name].push(o.options[p].value)}else if(l&&o.type==="hidden")a[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const p=Number(o.value);a[o.name]=o.value===""||isNaN(p)?null:p}else a[o.name]=o.value}return a}function Lt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function kt(t,e){const l=t.elements,s=[],a={};for(let u=0;u<l.length;u++){const d=l[u];d.name&&d.type==="checkbox"&&(a[d.name]=(a[d.name]||0)+1)}for(let u=0;u<l.length;u++){const d=l[u];if(d.type==="file"||d.type==="submit"||d.type==="button")continue;const h=d.getAttribute("data-ln-fill-as")||d.name;if(!h||!(h in e))continue;const o=e[h];if(d.type==="checkbox"){if(Array.isArray(o))d.checked=o.indexOf(d.value)!==-1;else if(a[d.name]>1){const p=String(o).split(",").map(function(m){return m.trim()});d.checked=p.indexOf(d.value)!==-1}else d.checked=Lt(o);s.push(d)}else if(d.type==="radio")d.checked=d.value===String(o),s.push(d);else if(d.type==="select-multiple"){if(Array.isArray(o))for(let p=0;p<d.options.length;p++)d.options[p].selected=o.indexOf(d.options[p].value)!==-1;s.push(d)}else d.value=o,d.tagName==="SELECT"&&o!=null&&d.setAttribute("data-ln-value",o),s.push(d)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=kt,window.lnCore.serializeForm=Dt,window.lnCore.resolveFormMethod=Et);const rt={};function xt(t,e){rt[t]=e}function It(t){return rt[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=xt,window.lnCore.getDataMapper=It);function lt(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function Ft(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,$(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const ot={};function Tt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];ot[l]=e}function qt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return ot[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Tt,window.lnCore.getLocaleFallback=qt,window.lnCore.ensureLocaleObserver=Ft);const P={};function st(t,e){P[t]||(P[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=P[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function at(t,e,l){if(t){const s=t.querySelector('[data-ln-template="'+e+'"]');if(s)return s.content.cloneNode(!0)}return st(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let d=0;d<l.length;d++){const h=l[d],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const s=t.querySelectorAll("[data-ln-attr]");for(let d=0;d<s.length;d++){const h=s[d],o=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<o.length;p++){const m=o[p].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),L=m[1].trim();e[L]!=null&&h.setAttribute(b,e[L])}}const a=t.querySelectorAll("[data-ln-show]");for(let d=0;d<a.length;d++){const h=a[d],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const u=t.querySelectorAll("[data-ln-class]");for(let d=0;d<u.length;d++){const h=u[d],o=h.getAttribute("data-ln-class").split(",");for(let p=0;p<o.length;p++){const m=o[p].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),L=m[1].trim();L in e&&h.classList.toggle(b,!!e[L])}}return t}function Rt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<l.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[s],e??null),l[s].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)Q(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function K(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(d,h){return e[h]!==void 0?e[h]:""}))}const s=function(u,d){return e[d]!==void 0?e[d]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let u=0;u<a.length;u++){const d=a[u],h=d.attributes;for(let o=0;o<h.length;o++){const p=h[o];p.value.indexOf("{{")!==-1&&d.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function Ot(t,e,l,s,a,u){const d={};for(let o=0;o<t.children.length;o++){const p=t.children[o],m=p.getAttribute("data-ln-render-key");m&&(d[m]=p)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const p=e[o],m=String(s(p));let b=d[m];if(b)a(b,p,o);else{const L=st(l,u);if(!L||(K(L,p),b=L.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",m),a(b,p,o)}h.appendChild(b)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=Q,window.lnCore.lnFill=Rt,window.lnCore.renderList=Ot);function B(t,e,l){const s=t.getAttribute(e);return s===null?l:s}function ct(t,e,l){const s=parseInt(t.getAttribute(e),10);return isNaN(s)?l:s}function Y(t,e,l=!1){const s=t.getAttribute(e);if(s===null)return!!l;const a=s.trim().toLowerCase();return!(a==="false"||a==="0")}function dt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const J=new Map;function ut(t,e){const l=(t?t.join("|"):"")+"::"+e;if(J.has(l))return J.get(l);const s=new Set(t||[]),a=function(u,d){const h=u.getAttribute(d);return h!==null&&s.has(h)?h:e};return J.set(l,a),a}function ht(t,e,l){const s=parseFloat(t.getAttribute(e));return isNaN(s)?l:s}function ft(t,e,l){const s=t.getAttribute(e);if(!s)return l;try{return JSON.parse(s)}catch{return l}}function pt(t,e,l,s,a){if(!t||e===null)return!0;const u=s||"ln-component",d=t.type;if(d==="trigger"||d==="marker"||d==="string"||d==="list"||!d||e===""&&t.fallback!==void 0)return!0;const h=o=>{a?console.warn(o,a):console.warn(o)};if(d==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(d==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(d==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${u}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${u}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(d==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(d==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${u}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function _t(t,e,l){for(const s in l){const[a,u,d]=l[s];Object.defineProperty(t,s,{get:function(){return a(e,u,d)},enumerable:!0,configurable:!0})}return t}function wt(t){const e={};for(const l in t){const s=t[l];if(!s||!s.prop)continue;let a=s.read;if(!a&&s.type)switch(s.type){case"enum":a=ut(s.values,s.fallback);break;case"integer":a=ct;break;case"float":a=ht;break;case"boolean":a=Y;break;case"list":a=dt;break;case"json":a=ft;break;case"string":default:a=B;break}a||(a=B),e[s.prop]=[a,l,s.fallback]}return e}function Mt(t){const e={};for(const l in t){const s=t[l];s&&s.effect&&(e[l]=s.effect)}return Object.keys(e).length?e:null}function Ht(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_t,window.lnCore.attrSpec=wt,window.lnCore.attrStr=B,window.lnCore.attrInt=ct,window.lnCore.attrBool=Y,window.lnCore.attrList=dt,window.lnCore.attrEnum=ut,window.lnCore.attrFloat=ht,window.lnCore.attrJson=ft);function V(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function gt(t,e,l,s){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d={selector:e,attribute:l,ComponentFn:s};if(t.matches&&t.matches(u)&&V(t,d),t.querySelectorAll){const h=t.querySelectorAll(u);for(let o=0;o<h.length;o++)V(h[o],d)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Nt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Wt(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function mt(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function zt(t){const e=mt(),l=t.observed||[];for(let s=0;s<l.length;s++){const a=l[s];e.byAttr.has(a)||e.byAttr.set(a,[]),e.byAttr.get(a).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const s in t.attributes){e.byDeclaredAttr.has(s)||e.byDeclaredAttr.set(s,[]);const a=e.byDeclaredAttr.get(s);a.some(u=>u.componentTag===t.componentTag)||a.push({spec:t.attributes[s],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const s=Ht(t);if(s===null)e.reactiveWildcard.push(t);else for(const a of s)e.byReactive.has(a)||e.byReactive.set(a,[]),e.byReactive.get(a).push(t)}t.persist&&e.persist.push(t)}function bt(t,e,l,s){for(let a=0;a<t.length;a++){const u=t[a];if(!e[u.attribute])continue;const d=u.effects&&u.effects[l];d?d(e,l,s):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,s)}}function Ut(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,s=mt(),a=s.byAttr.get(e),u=nt()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(e);if(!l&&!a&&!u)return;const d=t.target;if(t.oldValue!==d.getAttribute(e)){if(u&&G(d)){const h=s.byDeclaredAttr.get(e),o=d.getAttribute(e);for(let p=0;p<h.length;p++)pt(h[p].spec,o,e,h[p].componentTag,d)}if(window.lnCore._debugSink&&(l||a)&&window.lnCore._debugSink("attr",e,d,{oldValue:t.oldValue,newValue:d.getAttribute(e)}),l){const h=s.byReactive.get(e);h&&bt(h,d,e,t.oldValue),s.reactiveWildcard.length&&bt(s.reactiveWildcard,d,e,t.oldValue)}if(a)for(let h=0;h<a.length;h++){const o=a[h];if(o.handler){o.handler(d,e,t.oldValue);continue}o.onAttributeChange&&d[o.attribute]?o.onAttributeChange(d,e):(gt(d,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(d))}}}function Bt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Ut(e[l])}catch(s){console.error("[ln-core] mutation handler failed",e[l].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function tt(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(s){console.error("["+e.attribute+"] destroy failed",t,s)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function yt(t){const e=X();if(!e.length)return;const l=t.target;if(l){const a=l.nodeType===1?l:l.parentElement;if(a&&(a.isContentEditable||a.closest&&a.closest('[contenteditable]:not([contenteditable="false"])')))return}const s=Z();if(t.target&&s.length)for(let a=0;a<s.length;a++){const u=s[a],d=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(d)?t.target:t.target.closest?t.target.closest(d):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(d):null;h&&u.onSubtreeChange(h,t)}for(let a=0;a<t.addedNodes.length;a++){const u=t.addedNodes[a];if(u.nodeType===1){const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h];if(o.selector&&o.attribute&&o.ComponentFn){if(!d)u.matches&&u.matches(o.query)&&V(u,o);else if(u.matches&&u.matches(o.query)&&V(u,o),u.querySelectorAll){const p=u.querySelectorAll(o.query);for(let m=0;m<p.length;m++)V(p[m],o)}}o.onInit&&o.onInit(u)}}}for(let a=0;a<t.removedNodes.length;a++){const u=t.removedNodes[a];if(u.nodeType===1){if(document.contains(u))continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h],p=o.query;if(p){if(!d)u.matches&&u.matches(p)&&tt(u,o);else if(u.matches&&u.matches(p)&&tt(u,o),u.querySelectorAll){const m=u.querySelectorAll(p);for(let b=0;b<m.length;b++)tt(m[b],o)}}}}}}function Ct(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){const t=new MutationObserver(function(e){for(let l=0;l<e.length;l++){const s=e[l];if(s.type==="childList")try{yt(s)}catch(a){console.error("[ln-core] lifecycle handler failed",s.target,a)}}});window.lnCore._lifecycleObserver=t,t.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Vt(t){if(typeof window>"u")return t();window.lnCore=window.lnCore||{};const e=window.lnCore._lifecycleObserver;if(!e)return t();const l=e.takeRecords();for(let s=0;s<l.length;s++){const a=l[s];if(a.type==="childList")try{yt(a)}catch(u){console.error("[ln-core] lifecycle handler failed",a.target,u)}}e.disconnect();try{return t()}finally{e.observe(document.body,{childList:!0,subtree:!0})}}function $t(t){X().push(t),t.onSubtreeChange&&t.query&&Z().push(t),Ct()}function vt(t,e,l,s,a={}){const u=a.extraAttributes||[],d=a.onAttributeChange||null,h=a.onSubtreeChange||null,o=a.onInit||null,p=a.onAttrChange||null,m=a.effects||null,b=a.attributes||null,L=b?Mt(b):m,T=b?new Set(Object.keys(b)):null,q=a.persist||null;function N(i){const r=i||document.body;if(gt(r,t,e,l),b&&nt())for(const c in b){const f=b[c],_=Array.from(r.querySelectorAll("["+c+"]"));r.matches&&r.matches("["+c+"]")&&_.push(r);for(let w=0;w<_.length;w++){const y=_[w];G(y)&&pt(f,y.getAttribute(c),c,s,y)}}o&&o(r)}const I=[];if(t.indexOf("[")!==-1){const i=/\[([\w-]+)/g;let r;for(;(r=i.exec(t))!==null;)I.push(r[1])}else I.push(t);zt({selector:t,attribute:e,componentTag:s,attributes:b,ComponentFn:l,onInit:o,observed:I.concat(u),onAttributeChange:d,onAttrChange:p,effects:L,declared:T,persist:q}),Bt();const F=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,O=a.subtreeQuery||(F?t:"["+t+"]"),v={selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:O};X().push(v),h&&O&&Z().push(v),Ct(),window[e]=N,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=vt,window.lnCore.observeLifecycle=$t,window.lnCore.withoutLifecycle=Vt);function n(){Nt()>0?Wt(function(){N(document.body)}):N(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n(),N}function jt(t){let e=!1;for(let l=0;l<t.length;l++){const s=t[l];if(!(s===""||s==null)&&(e=!0,!Number.isFinite(Number(s))))return"string"}return e?"number":"string"}function Gt(t,e,l,s){if(l==="number"){const d=parseFloat(t),h=parseFloat(e);return(isNaN(d)?0:d)-(isNaN(h)?0:h)}const a=t!=null?String(t):"",u=e!=null?String(e):"";return s?s.compare(a,u):a<u?-1:a>u?1:0}function Pt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Qt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,s=t.threshold!=null?t.threshold:25,a=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},d=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,o=new Map,p=new Set;let m=0,b=0,L=0,T={sort:null,filters:{},search:""},q=null,N=0,I=0,F=!1;function O(r){o.set(r,++N)}function v(){return!!(T&&(T.search||T.filters&&Object.keys(T.filters).length))}function n(){if(h.size<=e)return;const r=Array.from(h.keys()).sort(function(f,_){return(o.get(f)||0)-(o.get(_)||0)});let c=0;for(;h.size>e&&c<r.length;)h.delete(r[c]),o.delete(r[c]),c++}function i(r,c){p.add(r),u(T,r,c)}return{get:function(r){return h.get(r)},has:function(r){return h.has(r)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return m},get grandTotal(){return b},get queryGen(){return L},get size(){return h.size},ensure:function(r,c){clearTimeout(q),I=r;for(let g=r;g<c;g++)h.has(g)&&O(g);if(m<=0)return;const f=Math.max(0,r-s),_=Math.min(m,c+s),w=Math.floor(f/l),y=Math.floor(Math.max(0,_-1)/l);let E=-1;for(let g=w;g<=y;g++){const C=g*l,k=Math.min(l,m-C);let W=!1;const z=Math.max(C,f),M=Math.min(C+k,_);for(let R=z;R<M;R++)if(!h.has(R)){W=!0;break}if(W&&!p.has(C)){E=C;break}}E!==-1&&(q=setTimeout(function(){i(E,l)},a))},ingest:function(r){if(r=r||{},r.queryGen!=null&&r.queryGen!==L)return!1;const c=r.offset||0,f=r.data||[];let _=0;for(let w=0;w<f.length;w++)f[w]!=null&&_++;if(_===0&&(r.provisional||r.filtered>0))return p.delete(c),!1;F&&(h.clear(),o.clear(),F=!1),r.provisional||(b=r.total!=null?r.total:b,m=r.filtered!=null?r.filtered:r.data?r.data.length:m);for(let w=0;w<f.length;w++)f[w]!=null&&(h.set(c+w,f[w]),O(c+w));return p.delete(c),n(),d(),!0},requestInitial:function(r){r&&(T=r),i(0,l)},invalidate:function(r){L++,p.clear(),clearTimeout(q),r&&(T=r),F=!0,i(0,l)},revalidate:function(){L++,p.clear(),clearTimeout(q),F=!0;const r=Math.max(0,Math.floor(I/l)*l);i(r,l)},release:function(r){p.delete(r)},destroy:function(){clearTimeout(q),h.clear(),o.clear(),p.clear()},configure:function(r){r=r||{};let c=!1;if(r.windowSize!=null&&r.windowSize>0&&r.windowSize!==e){const f=r.windowSize<e;e=r.windowSize,f&&n(),c=!0}r.pageSize!=null&&r.pageSize>0&&(l=r.pageSize),r.threshold!=null&&r.threshold>=0&&(s=r.threshold),r.fetchDebounce!=null&&r.fetchDebounce>=0&&(a=r.fetchDebounce),c&&d()},setGrandTotal:function(r){r==null||isNaN(r)||r<0||(b=r,v()||(m=r),d())}}}function St(t){return(t||"").replace(/^#/,"")}function et(t){const e=t===void 0?location.hash:t,l={},s=St(e);if(!s)return l;const a=s.split("&");for(let u=0;u<a.length;u++){const d=a[u];if(!d)continue;const h=d.indexOf(":"),o=h>-1?d.slice(0,h):d,p=h>-1?d.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(p)}catch{l[o]=p}}return l}function Kt(t){if(!t)return null;const e=et();return t in e?e[t]:null}function Yt(t,e){if(!t)return;const l=et();e==null?delete l[t]:l[t]=String(e);const a=Object.keys(l).map(function(u){const d=l[u];return d===""?u:u+":"+encodeURIComponent(d)}).join("&");St(location.hash)!==a&&(location.hash=a)}function Jt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Xt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?e?s+"-"+e:s:e||null}function Zt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function te(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function ee(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function ne(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),s=t.slice(e+1),a=s?s.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=et,window.lnCore.hashGet=Kt,window.lnCore.hashSet=Yt,window.lnCore.hashLinkClick=Jt,window.lnCore.resolveHashNamespace=Xt,window.lnCore.hashSortEncode=Zt,window.lnCore.hashSortDecode=te,window.lnCore.hashFilterEncode=ee,window.lnCore.hashFilterDecode=ne);function ie(t){return(t||"").replace(/^\?/,"")}function re(t){const e=t===void 0?typeof window<"u"?window.location.search:"":t,l={},s=ie(e);if(!s)return l;const a=new URLSearchParams(s);for(const[u,d]of a.entries())l[u]=d;return l}function le(t){if(!t||typeof window>"u")return null;const e=new URLSearchParams(window.location.search);return e.has(t)?e.get(t):null}function oe(t,e){if(!t||typeof window>"u")return;const l=new URL(window.location.href);if(e==null||e===""?l.searchParams.delete(t):l.searchParams.set(t,String(e)),l.search===window.location.search)return;const s=l.pathname+l.search+l.hash;window.history.replaceState(window.history.state,"",s)}function se(t,e){if(!t||!t.hasAttribute("data-ln-query"))return null;const l=t.getAttribute("data-ln-query");if(l&&l.trim()!=="")return l.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?e?s+"_"+e:s:e||null}function ae(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function ce(t,e){if(t&&typeof t=="string"){if(t.endsWith(".asc"))return{fieldOrColumn:t.slice(0,-4),direction:"asc"};if(t.endsWith(".desc"))return{fieldOrColumn:t.slice(0,-5),direction:"desc"}}if(e&&typeof e=="object"){const l=e.sort_field||e.sort_by;if(l){const s=e.sort_dir&&String(e.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:l,direction:s}}}return null}function de(t){return!Array.isArray(t)||t.length===0?null:t.map(encodeURIComponent).join(",")}function ue(t){return!t||typeof t!="string"?[]:t.split(",").map(function(e){try{return decodeURIComponent(e.trim())}catch{return e.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=re,window.lnCore.queryGet=le,window.lnCore.querySet=oe,window.lnCore.resolveQueryParam=se,window.lnCore.querySortEncode=ae,window.lnCore.querySortDecode=ce,window.lnCore.queryFilterEncode=de,window.lnCore.queryFilterDecode=ue);function he(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=he),(function(){const t="data-ln-list",e="lnList",l="data-ln-list-empty";if(window[e]!==void 0)return;function o(n,i){if(!n||!n.isDataDriven)return;const r=n.dom.hasAttribute("data-ln-list-window");if(r&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!r&&n._windowed)n._exitWindowedMode();else if(r&&n._windowed){const c=parseInt(i,10);c>0&&n._cache.configure({windowSize:c})}}function p(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>0&&n._cache.configure({pageSize:r})}function m(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>=0&&n._cache.configure({threshold:r})}function b(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>=0&&n._cache.setGrandTotal(r)}const L={"data-ln-list":{prop:"name",type:"string",read:B,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:B,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:o,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:m,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:b,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},T=wt(L);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(lt(i)).format(n)}catch{return String(n)}}function N(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const c=getComputedStyle(i).overflowY;if(c==="auto"||c==="scroll")return i;i=i.parentElement}return null}function I(n){const i=n._scrollContainer||N(n.dom);return{container:i,top:i?i.scrollTop:window.scrollY}}function F(n){n.container?n.container.scrollTop=n.top:window.scrollTo(window.scrollX,n.top)}function O(n){if(!n)return 0;const i=getComputedStyle(n),r=parseFloat(i.marginTop)||0,c=parseFloat(i.marginBottom)||0;return n.offsetHeight+r+c}function v(n){this.dom=n,_t(this,n,T),this.tbody=n.querySelector("[data-ln-list-body]")||n,this.isDataDriven=n.hasAttribute("data-ln-list-source"),this._totalSpan=n.querySelector("[data-ln-list-total]"),this._filteredSpan=n.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const i=this;return this._onSetSearch=function(r){const c=(r.detail&&r.detail.query!=null?r.detail.query:r.detail&&r.detail.term!=null?r.detail.term:"").trim();i.isDataDriven?(i.currentSearch=c,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=c.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(r){r.preventDefault(),i._onSetSearch(r)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-list:clear-filters",{list:i.name}),i._requestData()):(i._searchTerm="",i._filters={},i._sortField=null,i._sortDir=null,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,n.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(r){const c=r.detail||{},f=c.data||[],_=c.total!=null?c.total:f.length;if(!(i._hasInitialSeed&&!i.isLoaded&&f.length===0&&_===0)){if(i._windowed){i._cache.ingest(c)&&!c.provisional&&n.classList.remove("ln-list--loading");return}i._data=f,i._lastTotal=_,i._lastFiltered=c.filtered!=null?c.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-list--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-list:rendered",{list:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(r){const c=r.detail&&r.detail.loading;n.classList.toggle("ln-list--loading",!!c),c&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(r){!i._windowed||!i._cache||i._cache.release(r.detail&&r.detail.offset)},n.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(r){!r.detail||r.detail.field==null||(r.preventDefault(),i.currentSort=r.detail.direction==="none"?null:{field:r.detail.field,direction:r.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(r){if(r.target.closest("[data-ln-item-select]")||r.target.closest("[data-ln-item-action]")||r.target.closest("a")||r.target.closest("button")||r.ctrlKey||r.metaKey||r.button===1)return;const c=r.target.closest("[data-ln-item]");if(!c)return;const f=c.getAttribute("data-ln-item-id"),_=c._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:f,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(r){const c=r.target.closest("[data-ln-item-action]");if(!c)return;const f=c.closest("[data-ln-item]");if(!f)return;const _=c.getAttribute("data-ln-item-action"),w=f.getAttribute("data-ln-item-id"),y=f._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:w,action:_,record:y})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(n,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){i.tbody.children.length>0&&(i._emptyObserver.disconnect(),i._emptyObserver=null,i._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(r){if(r.preventDefault(),!r.detail)return;const c=r.detail.key,f=r.detail.values||[];if(c){if(f.length===0)delete i._filters[c];else{const _=[];for(let w=0;w<f.length;w++)_.push(f[w].toLowerCase());i._filters[c]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(r){if(!r.detail||r.detail.field==null)return;r.preventDefault();const c=r.detail.direction==="none"?null:r.detail.direction;i._sortField=c===null?null:r.detail.field,i._sortDir=c,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:r.detail&&r.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}v.prototype._parseChildren=function(){const n=Array.from(this.tbody.children).filter(i=>!i.classList.contains("ln-list__spacer"));this._data=[],n.length>0&&(this._itemHeight=O(n[0])||50);for(let i=0;i<n.length;i++){const r=n[i],c=r.getAttribute("data-ln-item-id")||r.getAttribute("id"),f=r.textContent.trim().toLowerCase();let _=null;if(this.isDataDriven){_={},c!=null&&(_.id=c);const E=r.querySelectorAll("[data-ln-list-field]");for(let g=0;g<E.length;g++){const C=E[g],k=C.getAttribute("data-ln-list-field");k&&(_[k]=it(C))}}const w={},y=r.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<y.length;E++){const g=y[E],C=g.getAttribute("data-ln-list-field")||g.getAttribute("data-ln-field");C&&(w[C]=it(g))}for(let E=0;E<r.attributes.length;E++){const g=r.attributes[E];if(g.name.startsWith("data-")&&!g.name.startsWith("data-ln-")){const C=g.name.slice(5);C&&(w[C]=g.value)}}this._data.push({html:r.outerHTML,id:c,searchText:f,fields:w,..._||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const n=this._searchTerm,i=n?n.split(/\s+/).filter(Boolean):[],r=this._filters||{},c=Object.keys(r).length>0;if(i.length===0&&!c?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(f){if(i.length>0&&!i.every(function(w){return f.searchText&&f.searchText.indexOf(w)!==-1}))return!1;if(c)for(const _ in r){const w=r[_];if(w&&w.length>0){const y=f.fields&&f.fields[_]!==void 0?f.fields[_]:f[_]!==void 0?f[_]:null,E=y!=null?String(y).toLowerCase():"";if(w.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const f=this._sortField,_=this._sortDir==="desc"?-1:1,w=typeof Intl<"u"?new Intl.Collator(lt(this.dom),{sensitivity:"base"}):null,y=this._filteredData.map(function(g){return g.fields&&g.fields[f]!==void 0?g.fields[f]:g[f]}),E=jt(y);this._filteredData.sort(function(g,C){const k=g.fields&&g.fields[f]!==void 0?g.fields[f]:g[f],W=C.fields&&C.fields[f]!==void 0?C.fields[f]:C[f];return Gt(k,W,E,w)*_})}}},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,i=this.visibleCount;if(n===0||this._filteredData.length===0||i===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let c=0;c<n.length;c++){const f=this._buildItem(n[c]);f&&i.appendChild(f)}const r=I(this);this.tbody.replaceChildren(i),F(r),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let c=0;c<i.length;c++)n.push(i[c].html);const r=I(this);this.tbody.innerHTML=n.join(""),F(r),this._selectable&&this._restoreSelection()}},v.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let r=1;if(i&&i!=="none"){const f=i.trim().split(/\s+/).filter(Boolean);f.length>0&&(r=f.length)}const c=parseFloat(n.rowGap);return{columns:r,rowGap:isNaN(c)?0:c}},v.prototype._measureItemHeight=function(){if(this._windowed){const n=this._cache.peek(),i=n?this._buildItem(n):this._buildPlaceholderItem();i&&(this.tbody.textContent="",this.tbody.appendChild(i),this._itemHeight=O(i)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const n=this._buildItem(this._data[0]);n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=O(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=O(n[0])||50)}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=N(this.dom);const i=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},this._resizeRafId=null,this._resizeHandler=function(){n._resizeRafId||(n._resizeRafId=requestAnimationFrame(function(){n._resizeRafId=null,n._itemHeight=0,n._measureItemHeight(),n._vStart=-1,n._vEnd=-1,n._windowed?n._renderWindowed():n._renderVirtual()}))},i.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._resizeRafId&&(cancelAnimationFrame(this._resizeRafId),this._resizeRafId=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,r=this._itemHeight;if(!r||!i)return;const c=this._scrollContainer;let f,_;if(c){const x=this.tbody.getBoundingClientRect(),A=c.getBoundingClientRect(),S=c===this.tbody?0:x.top-A.top+c.scrollTop;f=c.scrollTop-S,_=c.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;f=window.scrollY-A,_=window.innerHeight}const w=this._readGridLayout(),y=w.columns,E=w.rowGap,g=r+E,C=Math.ceil(i/y);let k=Math.max(0,Math.floor(f/g)-15);k=Math.min(k,C);const W=Math.ceil(_/g)+30,z=Math.min(k+W,C),M=Math.min(k*y,i),R=Math.min(z*y,i);if(M===this._vStart&&R===this._vEnd)return;this._vStart=M,this._vEnd=R;const U=k*g,H=(C-z)*g;if(this.isDataDriven){const x=document.createDocumentFragment();if(U>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=U+"px",x.appendChild(S)}for(let S=M;S<R;S++){const j=this._buildItem(n[S]);j&&x.appendChild(j)}if(H>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=H+"px",x.appendChild(S)}const A=I(this);this.tbody.replaceChildren(x),F(A),this._selectable&&this._updateSelectAll()}else{let x="";U>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${U}px"></${this.isUl?"li":"div"}>`);for(let S=M;S<R;S++)x+=n[S].html;H>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=x,F(A),this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderItem=function(){const n=document.createElement(this.isUl?"li":"div");return n.className="ln-list__placeholder",n.setAttribute("aria-hidden","true"),n.style.height=this._itemHeight+"px",n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._itemHeight;if(!n)return;const i=this._scrollContainer;let r,c;if(i){const A=this.tbody.getBoundingClientRect(),S=i.getBoundingClientRect(),j=i===this.tbody?0:A.top-S.top+i.scrollTop;r=i.scrollTop-j,c=i.clientHeight}else{const S=this.tbody.getBoundingClientRect().top+window.scrollY;r=window.scrollY-S,c=window.innerHeight}const f=this._readGridLayout(),_=f.columns,w=f.rowGap,y=n+w,E=this._cache.logicalTotal,g=Math.ceil(E/_);let C=Math.max(0,Math.floor(r/y)-15);C=Math.min(C,g);const k=Math.ceil(c/y)+30,W=Math.min(C+k,g),z=Math.min(C*_,E),M=Math.min(W*_,E),R=C*y,U=(g-W)*y,H=document.createDocumentFragment();if(R>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=R+"px",H.appendChild(A)}for(let A=z;A<M;A++)if(this._cache.has(A)){const S=this._buildItem(this._cache.get(A));S&&H.appendChild(S)}else H.appendChild(this._buildPlaceholderItem());if(U>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=U+"px",H.appendChild(A)}const x=I(this);this.tbody.replaceChildren(H),F(x),this._vStart=z,this._vEnd=M,this._cache.ensure(z,M)},v.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,c=this.visibleCount===0&&i>0,f=c?this.name+"-empty-filtered":this.name+"-empty";if(n=at(this.dom,f,"ln-list"),!n){const _=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(_){const w=c?"search":"initial",y=_.content.querySelector(`[data-ln-empty-when="${w}"]`)||_.content.firstElementChild;y&&(n=document.importNode(y,!0))}}}else{const i=this.dom.querySelector(`template[${l}]`);if(i){const r=i.content.firstElementChild;r&&(n=document.importNode(r,!0))}}if(n)if(n.tagName==="LI"||n.tagName==="TR")this.tbody.replaceChildren(n);else{const i=document.createElement(this.isUl?"li":"div");i.appendChild(n),this.tbody.replaceChildren(i)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._buildItem=function(n){let i=at(this.dom,this.name+"-row","ln-list");if(!i){const c=this.dom.querySelector("template[data-ln-item]");c&&(i=document.importNode(c.content,!0))}let r=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(r)K(r,n),Q(r,n);else if(n&&n.html){const c=document.createElement(this.isUl?"ul":"div");c.innerHTML=n.html,r=c.firstElementChild}else if(r=document.createElement(this.isUl?"li":"div"),r.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const c in n)if(c!=="html"&&n[c]!=null){const f=document.createElement("span");f.setAttribute("data-ln-field",c),f.textContent=String(n[c]),r.appendChild(f)}}if(r._lnRecord=n,n&&n.id!=null&&(r.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){r.classList.add("ln-item-selected");const c=r.querySelector("[data-ln-item-select]");c&&(c.checked=!0)}return r},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const r=n[i].getAttribute("data-ln-item-id"),c=r!=null&&this.selectedIds.has(String(r));n[i].classList.toggle("ln-item-selected",c);const f=n[i].querySelector("[data-ln-item-select]");f&&(f.checked=c)}this._updateSelectAll()},v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const r=i.target.closest("[data-ln-item-select]");if(!r)return;const c=r.closest("[data-ln-item]");if(!c)return;const f=c.getAttribute("data-ln-item-id");f!=null&&(r.checked?(n.selectedIds.add(String(f)),c.classList.add("ln-item-selected")):(n.selectedIds.delete(String(f)),c.classList.remove("ln-item-selected")),n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const i=n._selectAllCheckbox.checked,r=n.tbody.querySelectorAll("[data-ln-item]");for(let c=0;c<r.length;c++){const f=r[c],_=f.getAttribute("data-ln-item-id"),w=f.querySelector("[data-ln-item-select]");_!=null&&(i?(n.selectedIds.add(String(_)),f.classList.add("ln-item-selected")):(n.selectedIds.delete(String(_)),f.classList.remove("ln-item-selected")),w&&(w.checked=i))}D(n.dom,"ln-list:select-all",{list:n.name,selected:i}),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let r=0;r<n.length;r++){const c=n[r].getAttribute("data-ln-item-id");if(c!=null&&!this.selectedIds.has(String(c))){i=!1;break}}this._selectAllCheckbox.checked=i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}At(this,"ln-list:request-data","list")},v.prototype._enterWindowedMode=function(){const n=this,i=this.dom,r=parseInt(i.getAttribute("data-ln-list-window"),10),c=parseInt(i.getAttribute("data-ln-list-window-page"),10),f=parseInt(i.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Pt(this._onCacheChange),this._cache=Qt({windowSize:r>0?r:1e3,pageSize:c>0?c:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(_,w,y){D(i,"ln-list:request-data",{list:n.name,sort:_.sort,filters:_.filters,search:_.search,offset:w,limit:y,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){const n=parseInt(this.dom.getAttribute("data-ln-list-count"),10),i=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:i,filtered:i})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},v.prototype._updateFooter=function(){let n=0,i=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,i=this.visibleCount):(n=this._data.length,i=this._filteredData.length);const r=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=r?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!r),this._selectedSpan){const c=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=c>0?q(c,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",c===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[e])},vt(t,e,v,"ln-list",{attributes:L})})()})();
1
+ (function(){"use strict";function et(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function G(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let o=null;for(let a=1;a<e.length;a++)if(e[a]&&e[a].nodeType===1){o=e[a];break}if(!G(o))return}t.apply(console,e)}}function D(t,e,l){const o=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,o),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function At(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const o={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};o[l]=t.name,D(t.dom,e,o)}function V(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){V(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function nt(t){return t.hasAttribute("value")?t.getAttribute("value"):t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.textContent.trim()}function Et(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function Dt(t,e){const l=!!(e&&e.typed),o=e&&e.exclude,a={},u=t.elements,d={};if(l)for(let h=0;h<u.length;h++){const s=u[h];s.name&&s.type==="checkbox"&&!s.disabled&&(d[s.name]=(d[s.name]||0)+1)}for(let h=0;h<u.length;h++){const s=u[h];if(!(!s.name||s.disabled||s.type==="file"||s.type==="submit"||s.type==="button")&&!(o&&s.matches&&s.matches(o)))if(s.type==="checkbox")l&&d[s.name]===1?a[s.name]=s.checked:(a[s.name]||(a[s.name]=[]),s.checked&&a[s.name].push(s.value));else if(s.type==="radio")s.checked&&(a[s.name]=s.value);else if(s.type==="select-multiple"){a[s.name]=[];for(let p=0;p<s.options.length;p++)s.options[p].selected&&a[s.name].push(s.options[p].value)}else if(l&&s.type==="hidden")a[s.name]=s.value;else if(l&&(s.type==="number"||s.type==="range")){const p=Number(s.value);a[s.name]=s.value===""||isNaN(p)?null:p}else a[s.name]=s.value}return a}function Lt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function kt(t,e){const l=t.elements,o=[],a={};for(let u=0;u<l.length;u++){const d=l[u];d.name&&d.type==="checkbox"&&(a[d.name]=(a[d.name]||0)+1)}for(let u=0;u<l.length;u++){const d=l[u];if(d.type==="file"||d.type==="submit"||d.type==="button")continue;const h=d.getAttribute("data-ln-fill-as")||d.name;if(!h||!(h in e))continue;const s=e[h];if(d.type==="checkbox"){if(Array.isArray(s))d.checked=s.indexOf(d.value)!==-1;else if(a[d.name]>1){const p=String(s).split(",").map(function(b){return b.trim()});d.checked=p.indexOf(d.value)!==-1}else d.checked=Lt(s);o.push(d)}else if(d.type==="radio")d.checked=d.value===String(s),o.push(d);else if(d.type==="select-multiple"){if(Array.isArray(s))for(let p=0;p<d.options.length;p++)d.options[p].selected=s.indexOf(d.options[p].value)!==-1;o.push(d)}else d.value=s,d.tagName==="SELECT"&&s!=null&&d.setAttribute("data-ln-value",s),o.push(d)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=kt,window.lnCore.serializeForm=Dt,window.lnCore.resolveFormMethod=Et);const it={};function xt(t,e){it[t]=e}function It(t){return it[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=xt,window.lnCore.getDataMapper=It);function rt(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function Ft(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,V(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const lt={};function Tt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];lt[l]=e}function qt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return lt[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Tt,window.lnCore.getLocaleFallback=qt,window.lnCore.ensureLocaleObserver=Ft);const P={};function ot(t,e){P[t]||(P[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=P[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function st(t,e,l){if(t){const o=t.querySelector('[data-ln-template="'+e+'"]');if(o)return o.content.cloneNode(!0)}return ot(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let d=0;d<l.length;d++){const h=l[d],s=h.getAttribute("data-ln-field");e[s]!=null&&(h.textContent=e[s])}const o=t.querySelectorAll("[data-ln-attr]");for(let d=0;d<o.length;d++){const h=o[d],s=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<s.length;p++){const b=s[p].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),L=b[1].trim();e[L]!=null&&h.setAttribute(m,e[L])}}const a=t.querySelectorAll("[data-ln-show]");for(let d=0;d<a.length;d++){const h=a[d],s=h.getAttribute("data-ln-show");s in e&&h.classList.toggle("hidden",!e[s])}const u=t.querySelectorAll("[data-ln-class]");for(let d=0;d<u.length;d++){const h=u[d],s=h.getAttribute("data-ln-class").split(",");for(let p=0;p<s.length;p++){const b=s[p].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),L=b[1].trim();L in e&&h.classList.toggle(m,!!e[L])}}return t}function Rt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<l.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[o],e??null),l[o].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)Q(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function K(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(d,h){return e[h]!==void 0?e[h]:""}))}const o=function(u,d){return e[d]!==void 0?e[d]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let u=0;u<a.length;u++){const d=a[u],h=d.attributes;for(let s=0;s<h.length;s++){const p=h[s];p.value.indexOf("{{")!==-1&&d.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return t}function Ot(t,e,l,o,a,u){const d={};for(let s=0;s<t.children.length;s++){const p=t.children[s],b=p.getAttribute("data-ln-render-key");b&&(d[b]=p)}const h=document.createDocumentFragment();for(let s=0;s<e.length;s++){const p=e[s],b=String(o(p));let m=d[b];if(m)a(m,p,s);else{const L=ot(l,u);if(!L||(K(L,p),m=L.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),a(m,p,s)}h.appendChild(m)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=Q,window.lnCore.lnFill=Rt,window.lnCore.renderList=Ot);function B(t,e,l){const o=t.getAttribute(e);return o===null?l:o}function at(t,e,l){const o=parseInt(t.getAttribute(e),10);return isNaN(o)?l:o}function Y(t,e,l=!1){const o=t.getAttribute(e);if(o===null)return!!l;const a=o.trim().toLowerCase();return!(a==="false"||a==="0")}function ct(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const J=new Map;function dt(t,e){const l=(t?t.join("|"):"")+"::"+e;if(J.has(l))return J.get(l);const o=new Set(t||[]),a=function(u,d){const h=u.getAttribute(d);return h!==null&&o.has(h)?h:e};return J.set(l,a),a}function ut(t,e,l){const o=parseFloat(t.getAttribute(e));return isNaN(o)?l:o}function ht(t,e,l){const o=t.getAttribute(e);if(!o)return l;try{return JSON.parse(o)}catch{return l}}function ft(t,e,l,o,a){if(!t||e===null)return!0;const u=o||"ln-component",d=t.type;if(d==="trigger"||d==="marker"||d==="string"||d==="list"||!d||e===""&&t.fallback!==void 0)return!0;const h=s=>{a?console.warn(s,a):console.warn(s)};if(d==="boolean"){const s=e.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(d==="enum"){const s=t.values||[];return s.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${s.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(d==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const s=parseInt(e,10);return t.min!==void 0&&s<t.min?(h(`[${u}] Value ${s} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&s>t.max?(h(`[${u}] Value ${s} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(d==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(d==="json")try{return JSON.parse(e),!0}catch(s){return h(`[${u}] Invalid JSON for attribute "${l}": ${s.message}. Fallback: ${t.fallback}.`),!1}return!0}function pt(t,e,l){for(const o in l){const[a,u,d]=l[o];Object.defineProperty(t,o,{get:function(){return a(e,u,d)},enumerable:!0,configurable:!0})}return t}function _t(t){const e={};for(const l in t){const o=t[l];if(!o||!o.prop)continue;let a=o.read;if(!a&&o.type)switch(o.type){case"enum":a=dt(o.values,o.fallback);break;case"integer":a=at;break;case"float":a=ut;break;case"boolean":a=Y;break;case"list":a=ct;break;case"json":a=ht;break;case"string":default:a=B;break}a||(a=B),e[o.prop]=[a,l,o.fallback]}return e}function Mt(t){const e={};for(const l in t){const o=t[l];o&&o.effect&&(e[l]=o.effect)}return Object.keys(e).length?e:null}function Ht(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pt,window.lnCore.attrSpec=_t,window.lnCore.attrStr=B,window.lnCore.attrInt=at,window.lnCore.attrBool=Y,window.lnCore.attrList=ct,window.lnCore.attrEnum=dt,window.lnCore.attrFloat=ut,window.lnCore.attrJson=ht);function $(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function wt(t,e,l,o){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d={selector:e,attribute:l,ComponentFn:o};if(t.matches&&t.matches(u)&&$(t,d),t.querySelectorAll){const h=t.querySelectorAll(u);for(let s=0;s<h.length;s++)$(h[s],d)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Nt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Wt(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function gt(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function zt(t){const e=gt(),l=t.observed||[];for(let o=0;o<l.length;o++){const a=l[o];e.byAttr.has(a)||e.byAttr.set(a,[]),e.byAttr.get(a).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const o in t.attributes){e.byDeclaredAttr.has(o)||e.byDeclaredAttr.set(o,[]);const a=e.byDeclaredAttr.get(o);a.some(u=>u.componentTag===t.componentTag)||a.push({spec:t.attributes[o],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const o=Ht(t);if(o===null)e.reactiveWildcard.push(t);else for(const a of o)e.byReactive.has(a)||e.byReactive.set(a,[]),e.byReactive.get(a).push(t)}t.persist&&e.persist.push(t)}function mt(t,e,l,o){for(let a=0;a<t.length;a++){const u=t[a];if(!e[u.attribute])continue;const d=u.effects&&u.effects[l];d?d(e,l,o):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,o)}}function Ut(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,o=gt(),a=o.byAttr.get(e),u=et()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(e);if(!l&&!a&&!u)return;const d=t.target;if(t.oldValue!==d.getAttribute(e)){if(u&&G(d)){const h=o.byDeclaredAttr.get(e),s=d.getAttribute(e);for(let p=0;p<h.length;p++)ft(h[p].spec,s,e,h[p].componentTag,d)}if(window.lnCore._debugSink&&(l||a)&&window.lnCore._debugSink("attr",e,d,{oldValue:t.oldValue,newValue:d.getAttribute(e)}),l){const h=o.byReactive.get(e);h&&mt(h,d,e,t.oldValue),o.reactiveWildcard.length&&mt(o.reactiveWildcard,d,e,t.oldValue)}if(a)for(let h=0;h<a.length;h++){const s=a[h];if(s.handler){s.handler(d,e,t.oldValue);continue}s.onAttributeChange&&d[s.attribute]?s.onAttributeChange(d,e):(wt(d,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(d))}}}function Bt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,V(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Ut(e[l])}catch(o){console.error("[ln-core] mutation handler failed",e[l].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function bt(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(o){console.error("["+e.attribute+"] destroy failed",t,o)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function yt(t){const e=X();if(!e.length)return;const l=t.target;if(l){const a=l.nodeType===1?l:l.parentElement;if(a&&(a.isContentEditable||a.closest&&a.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=Z();if(t.target&&o.length)for(let a=0;a<o.length;a++){const u=o[a],d=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(d)?t.target:t.target.closest?t.target.closest(d):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(d):null;h&&u.onSubtreeChange(h,t)}for(let a=0;a<t.addedNodes.length;a++){const u=t.addedNodes[a];if(u.nodeType!==1)continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h],p=s.query;if(p&&(u.matches&&u.matches(p)&&(s.ComponentFn&&$(u,s),s.onInit&&s.onInit(u)),d&&u.querySelectorAll)){const b=u.querySelectorAll(p);for(let m=0;m<b.length;m++)s.ComponentFn&&$(b[m],s),s.onInit&&s.onInit(b[m])}}}for(let a=0;a<t.removedNodes.length;a++){const u=t.removedNodes[a];if(u.nodeType!==1||document.contains(u))continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h],p=s.query;if(p&&(u.matches&&u.matches(p)&&bt(u,s),d&&u.querySelectorAll)){const b=u.querySelectorAll(p);for(let m=0;m<b.length;m++)bt(b[m],s)}}}}function Ct(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,V(function(){const t=new MutationObserver(function(e){for(let l=0;l<e.length;l++){const o=e[l];if(o.type==="childList")try{yt(o)}catch(a){console.error("[ln-core] lifecycle handler failed",o.target,a)}}});window.lnCore._lifecycleObserver=t,t.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Vt(t){if(typeof window>"u")return t();window.lnCore=window.lnCore||{};const e=window.lnCore._lifecycleObserver;if(!e)return t();const l=e.takeRecords();for(let o=0;o<l.length;o++){const a=l[o];if(a.type==="childList")try{yt(a)}catch(u){console.error("[ln-core] lifecycle handler failed",a.target,u)}}e.disconnect();try{return t()}finally{e.observe(document.body,{childList:!0,subtree:!0})}}function $t(t){X().push(t),t.onSubtreeChange&&t.query&&Z().push(t),Ct()}function vt(t,e,l,o,a={}){const u=a.extraAttributes||[],d=a.onAttributeChange||null,h=a.onSubtreeChange||null,s=a.onInit||null,p=a.onAttrChange||null,b=a.effects||null,m=a.attributes||null,L=m?Mt(m):b,T=m?new Set(Object.keys(m)):null,q=a.persist||null;function N(i){const r=i||document.body;if(wt(r,t,e,l),m&&et())for(const c in m){const f=m[c],_=Array.from(r.querySelectorAll("["+c+"]"));r.matches&&r.matches("["+c+"]")&&_.push(r);for(let w=0;w<_.length;w++){const y=_[w];G(y)&&ft(f,y.getAttribute(c),c,o,y)}}s&&s(r)}const I=[];if(t.indexOf("[")!==-1){const i=/\[([\w-]+)/g;let r;for(;(r=i.exec(t))!==null;)I.push(r[1])}else I.push(t);zt({selector:t,attribute:e,componentTag:o,attributes:m,ComponentFn:l,onInit:s,observed:I.concat(u),onAttributeChange:d,onAttrChange:p,effects:L,declared:T,persist:q}),Bt();const F=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,O=a.subtreeQuery||(F?t:"["+t+"]"),v={selector:t,attribute:e,ComponentFn:l,onInit:s,onSubtreeChange:h,query:O};X().push(v),h&&O&&Z().push(v),Ct(),window[e]=N,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=vt,window.lnCore.observeLifecycle=$t,window.lnCore.withoutLifecycle=Vt);function n(){Nt()>0?Wt(function(){N(document.body)}):N(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n(),N}function jt(t){let e=!1;for(let l=0;l<t.length;l++){const o=t[l];if(!(o===""||o==null)&&(e=!0,!Number.isFinite(Number(o))))return"string"}return e?"number":"string"}function Gt(t,e,l,o){if(l==="number"){const d=parseFloat(t),h=parseFloat(e);return(isNaN(d)?0:d)-(isNaN(h)?0:h)}const a=t!=null?String(t):"",u=e!=null?String(e):"";return o?o.compare(a,u):a<u?-1:a>u?1:0}function Pt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Qt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,o=t.threshold!=null?t.threshold:25,a=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},d=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,s=new Map,p=new Set;let b=0,m=0,L=0,T={sort:null,filters:{},search:""},q=null,N=0,I=0,F=!1;function O(r){s.set(r,++N)}function v(){return!!(T&&(T.search||T.filters&&Object.keys(T.filters).length))}function n(){if(h.size<=e)return;const r=Array.from(h.keys()).sort(function(f,_){return(s.get(f)||0)-(s.get(_)||0)});let c=0;for(;h.size>e&&c<r.length;)h.delete(r[c]),s.delete(r[c]),c++}function i(r,c){p.add(r),u(T,r,c)}return{get:function(r){return h.get(r)},has:function(r){return h.has(r)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return b},get grandTotal(){return m},get queryGen(){return L},get size(){return h.size},ensure:function(r,c){clearTimeout(q),I=r;for(let g=r;g<c;g++)h.has(g)&&O(g);if(b<=0)return;const f=Math.max(0,r-o),_=Math.min(b,c+o),w=Math.floor(f/l),y=Math.floor(Math.max(0,_-1)/l);let E=-1;for(let g=w;g<=y;g++){const C=g*l,k=Math.min(l,b-C);let W=!1;const z=Math.max(C,f),M=Math.min(C+k,_);for(let R=z;R<M;R++)if(!h.has(R)){W=!0;break}if(W&&!p.has(C)){E=C;break}}E!==-1&&(q=setTimeout(function(){i(E,l)},a))},ingest:function(r){if(r=r||{},r.queryGen!=null&&r.queryGen!==L)return!1;const c=r.offset||0,f=r.data||[];let _=0;for(let w=0;w<f.length;w++)f[w]!=null&&_++;if(_===0&&(r.provisional||r.filtered>0))return p.delete(c),!1;F&&(h.clear(),s.clear(),F=!1),r.provisional||(m=r.total!=null?r.total:m,b=r.filtered!=null?r.filtered:r.data?r.data.length:b);for(let w=0;w<f.length;w++)f[w]!=null&&(h.set(c+w,f[w]),O(c+w));return p.delete(c),n(),d(),!0},requestInitial:function(r){r&&(T=r),i(0,l)},invalidate:function(r){L++,p.clear(),clearTimeout(q),r&&(T=r),F=!0,i(0,l)},revalidate:function(){L++,p.clear(),clearTimeout(q),F=!0;const r=Math.max(0,Math.floor(I/l)*l);i(r,l)},release:function(r){p.delete(r)},destroy:function(){clearTimeout(q),h.clear(),s.clear(),p.clear()},configure:function(r){r=r||{};let c=!1;if(r.windowSize!=null&&r.windowSize>0&&r.windowSize!==e){const f=r.windowSize<e;e=r.windowSize,f&&n(),c=!0}r.pageSize!=null&&r.pageSize>0&&(l=r.pageSize),r.threshold!=null&&r.threshold>=0&&(o=r.threshold),r.fetchDebounce!=null&&r.fetchDebounce>=0&&(a=r.fetchDebounce),c&&d()},setGrandTotal:function(r){r==null||isNaN(r)||r<0||(m=r,v()||(b=r),d())}}}function St(t){return(t||"").replace(/^#/,"")}function tt(t){const e=t===void 0?location.hash:t,l={},o=St(e);if(!o)return l;const a=o.split("&");for(let u=0;u<a.length;u++){const d=a[u];if(!d)continue;const h=d.indexOf(":"),s=h>-1?d.slice(0,h):d,p=h>-1?d.slice(h+1):"";if(s)try{l[s]=decodeURIComponent(p)}catch{l[s]=p}}return l}function Kt(t){if(!t)return null;const e=tt();return t in e?e[t]:null}function Yt(t,e){if(!t)return;const l=tt();e==null?delete l[t]:l[t]=String(e);const a=Object.keys(l).map(function(u){const d=l[u];return d===""?u:u+":"+encodeURIComponent(d)}).join("&");St(location.hash)!==a&&(location.hash=a)}function Jt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Xt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const o=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return o?e?o+"-"+e:o:e||null}function Zt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function te(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function ee(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function ne(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),o=t.slice(e+1),a=o?o.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=tt,window.lnCore.hashGet=Kt,window.lnCore.hashSet=Yt,window.lnCore.hashLinkClick=Jt,window.lnCore.resolveHashNamespace=Xt,window.lnCore.hashSortEncode=Zt,window.lnCore.hashSortDecode=te,window.lnCore.hashFilterEncode=ee,window.lnCore.hashFilterDecode=ne);function ie(t){return(t||"").replace(/^\?/,"")}function re(t){const e=t===void 0?typeof window<"u"?window.location.search:"":t,l={},o=ie(e);if(!o)return l;const a=new URLSearchParams(o);for(const[u,d]of a.entries())l[u]=d;return l}function le(t){if(!t||typeof window>"u")return null;const e=new URLSearchParams(window.location.search);return e.has(t)?e.get(t):null}function oe(t,e){if(!t||typeof window>"u")return;const l=new URL(window.location.href);if(e==null||e===""?l.searchParams.delete(t):l.searchParams.set(t,String(e)),l.search===window.location.search)return;const o=l.pathname+l.search+l.hash;window.history.replaceState(window.history.state,"",o)}function se(t,e){if(!t||!t.hasAttribute("data-ln-query"))return null;const l=t.getAttribute("data-ln-query");if(l&&l.trim()!=="")return l.trim();const o=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return o?e?o+"_"+e:o:e||null}function ae(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function ce(t,e){if(t&&typeof t=="string"){if(t.endsWith(".asc"))return{fieldOrColumn:t.slice(0,-4),direction:"asc"};if(t.endsWith(".desc"))return{fieldOrColumn:t.slice(0,-5),direction:"desc"}}if(e&&typeof e=="object"){const l=e.sort_field||e.sort_by;if(l){const o=e.sort_dir&&String(e.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:l,direction:o}}}return null}function de(t){return!Array.isArray(t)||t.length===0?null:t.map(encodeURIComponent).join(",")}function ue(t){return!t||typeof t!="string"?[]:t.split(",").map(function(e){try{return decodeURIComponent(e.trim())}catch{return e.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=re,window.lnCore.queryGet=le,window.lnCore.querySet=oe,window.lnCore.resolveQueryParam=se,window.lnCore.querySortEncode=ae,window.lnCore.querySortDecode=ce,window.lnCore.queryFilterEncode=de,window.lnCore.queryFilterDecode=ue);function he(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=he),(function(){const t="data-ln-list",e="lnList",l="data-ln-list-empty";if(window[e]!==void 0)return;function s(n,i){if(!n||!n.isDataDriven)return;const r=n.dom.hasAttribute("data-ln-list-window");if(r&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!r&&n._windowed)n._exitWindowedMode();else if(r&&n._windowed){const c=parseInt(i,10);c>0&&n._cache.configure({windowSize:c})}}function p(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>0&&n._cache.configure({pageSize:r})}function b(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>=0&&n._cache.configure({threshold:r})}function m(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const r=parseInt(i,10);r>=0&&n._cache.setGrandTotal(r)}const L={"data-ln-list":{prop:"name",type:"string",read:B,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:B,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:s,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:b,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:m,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},T=_t(L);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(rt(i)).format(n)}catch{return String(n)}}function N(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const c=getComputedStyle(i).overflowY;if(c==="auto"||c==="scroll")return i;i=i.parentElement}return null}function I(n){const i=n._scrollContainer||N(n.dom);return{container:i,top:i?i.scrollTop:window.scrollY}}function F(n){n.container?n.container.scrollTop=n.top:window.scrollTo(window.scrollX,n.top)}function O(n){if(!n)return 0;const i=getComputedStyle(n),r=parseFloat(i.marginTop)||0,c=parseFloat(i.marginBottom)||0;return n.offsetHeight+r+c}function v(n){this.dom=n,pt(this,n,T),this.tbody=n.querySelector("[data-ln-list-body]")||n,this.isDataDriven=n.hasAttribute("data-ln-list-source"),this._totalSpan=n.querySelector("[data-ln-list-total]"),this._filteredSpan=n.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const i=this;return this._onSetSearch=function(r){const c=(r.detail&&r.detail.query!=null?r.detail.query:r.detail&&r.detail.term!=null?r.detail.term:"").trim();i.isDataDriven?(i.currentSearch=c,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=c.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(r){r.preventDefault(),i._onSetSearch(r)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-list:clear-filters",{list:i.name}),i._requestData()):(i._searchTerm="",i._filters={},i._sortField=null,i._sortDir=null,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,n.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(r){const c=r.detail||{},f=c.data||[],_=c.total!=null?c.total:f.length;if(!(i._hasInitialSeed&&!i.isLoaded&&f.length===0&&_===0)){if(i._windowed){i._cache.ingest(c)&&!c.provisional&&n.classList.remove("ln-list--loading");return}i._data=f,i._lastTotal=_,i._lastFiltered=c.filtered!=null?c.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-list--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-list:rendered",{list:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(r){const c=r.detail&&r.detail.loading;n.classList.toggle("ln-list--loading",!!c),c&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(r){!i._windowed||!i._cache||i._cache.release(r.detail&&r.detail.offset)},n.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(r){!r.detail||r.detail.field==null||(r.preventDefault(),i.currentSort=r.detail.direction==="none"?null:{field:r.detail.field,direction:r.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(r){if(r.target.closest("[data-ln-item-select]")||r.target.closest("[data-ln-item-action]")||r.target.closest("a")||r.target.closest("button")||r.ctrlKey||r.metaKey||r.button===1)return;const c=r.target.closest("[data-ln-item]");if(!c)return;const f=c.getAttribute("data-ln-item-id"),_=c._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:f,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(r){const c=r.target.closest("[data-ln-item-action]");if(!c)return;const f=c.closest("[data-ln-item]");if(!f)return;const _=c.getAttribute("data-ln-item-action"),w=f.getAttribute("data-ln-item-id"),y=f._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:w,action:_,record:y})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(n,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){i.tbody.children.length>0&&(i._emptyObserver.disconnect(),i._emptyObserver=null,i._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(r){if(r.preventDefault(),!r.detail)return;const c=r.detail.key,f=r.detail.values||[];if(c){if(f.length===0)delete i._filters[c];else{const _=[];for(let w=0;w<f.length;w++)_.push(f[w].toLowerCase());i._filters[c]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(r){if(!r.detail||r.detail.field==null)return;r.preventDefault();const c=r.detail.direction==="none"?null:r.detail.direction;i._sortField=c===null?null:r.detail.field,i._sortDir=c,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:r.detail&&r.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}v.prototype._parseChildren=function(){const n=Array.from(this.tbody.children).filter(i=>!i.classList.contains("ln-list__spacer"));this._data=[],n.length>0&&(this._itemHeight=O(n[0])||50);for(let i=0;i<n.length;i++){const r=n[i],c=r.getAttribute("data-ln-item-id")||r.getAttribute("id"),f=r.textContent.trim().toLowerCase();let _=null;if(this.isDataDriven){_={},c!=null&&(_.id=c);const E=r.querySelectorAll("[data-ln-list-field]");for(let g=0;g<E.length;g++){const C=E[g],k=C.getAttribute("data-ln-list-field");k&&(_[k]=nt(C))}}const w={},y=r.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<y.length;E++){const g=y[E],C=g.getAttribute("data-ln-list-field")||g.getAttribute("data-ln-field");C&&(w[C]=nt(g))}for(let E=0;E<r.attributes.length;E++){const g=r.attributes[E];if(g.name.startsWith("data-")&&!g.name.startsWith("data-ln-")){const C=g.name.slice(5);C&&(w[C]=g.value)}}this._data.push({html:r.outerHTML,id:c,searchText:f,fields:w,..._||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const n=this._searchTerm,i=n?n.split(/\s+/).filter(Boolean):[],r=this._filters||{},c=Object.keys(r).length>0;if(i.length===0&&!c?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(f){if(i.length>0&&!i.every(function(w){return f.searchText&&f.searchText.indexOf(w)!==-1}))return!1;if(c)for(const _ in r){const w=r[_];if(w&&w.length>0){const y=f.fields&&f.fields[_]!==void 0?f.fields[_]:f[_]!==void 0?f[_]:null,E=y!=null?String(y).toLowerCase():"";if(w.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const f=this._sortField,_=this._sortDir==="desc"?-1:1,w=typeof Intl<"u"?new Intl.Collator(rt(this.dom),{sensitivity:"base"}):null,y=this._filteredData.map(function(g){return g.fields&&g.fields[f]!==void 0?g.fields[f]:g[f]}),E=jt(y);this._filteredData.sort(function(g,C){const k=g.fields&&g.fields[f]!==void 0?g.fields[f]:g[f],W=C.fields&&C.fields[f]!==void 0?C.fields[f]:C[f];return Gt(k,W,E,w)*_})}}},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,i=this.visibleCount;if(n===0||this._filteredData.length===0||i===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let c=0;c<n.length;c++){const f=this._buildItem(n[c]);f&&i.appendChild(f)}const r=I(this);this.tbody.replaceChildren(i),F(r),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let c=0;c<i.length;c++)n.push(i[c].html);const r=I(this);this.tbody.innerHTML=n.join(""),F(r),this._selectable&&this._restoreSelection()}},v.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let r=1;if(i&&i!=="none"){const f=i.trim().split(/\s+/).filter(Boolean);f.length>0&&(r=f.length)}const c=parseFloat(n.rowGap);return{columns:r,rowGap:isNaN(c)?0:c}},v.prototype._measureItemHeight=function(){if(this._windowed){const n=this._cache.peek(),i=n?this._buildItem(n):this._buildPlaceholderItem();i&&(this.tbody.textContent="",this.tbody.appendChild(i),this._itemHeight=O(i)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const n=this._buildItem(this._data[0]);n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=O(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=O(n[0])||50)}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=N(this.dom);const i=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},this._resizeRafId=null,this._resizeHandler=function(){n._resizeRafId||(n._resizeRafId=requestAnimationFrame(function(){n._resizeRafId=null,n._itemHeight=0,n._measureItemHeight(),n._vStart=-1,n._vEnd=-1,n._windowed?n._renderWindowed():n._renderVirtual()}))},i.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._resizeRafId&&(cancelAnimationFrame(this._resizeRafId),this._resizeRafId=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,r=this._itemHeight;if(!r||!i)return;const c=this._scrollContainer;let f,_;if(c){const x=this.tbody.getBoundingClientRect(),A=c.getBoundingClientRect(),S=c===this.tbody?0:x.top-A.top+c.scrollTop;f=c.scrollTop-S,_=c.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;f=window.scrollY-A,_=window.innerHeight}const w=this._readGridLayout(),y=w.columns,E=w.rowGap,g=r+E,C=Math.ceil(i/y);let k=Math.max(0,Math.floor(f/g)-15);k=Math.min(k,C);const W=Math.ceil(_/g)+30,z=Math.min(k+W,C),M=Math.min(k*y,i),R=Math.min(z*y,i);if(M===this._vStart&&R===this._vEnd)return;this._vStart=M,this._vEnd=R;const U=k*g,H=(C-z)*g;if(this.isDataDriven){const x=document.createDocumentFragment();if(U>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=U+"px",x.appendChild(S)}for(let S=M;S<R;S++){const j=this._buildItem(n[S]);j&&x.appendChild(j)}if(H>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=H+"px",x.appendChild(S)}const A=I(this);this.tbody.replaceChildren(x),F(A),this._selectable&&this._updateSelectAll()}else{let x="";U>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${U}px"></${this.isUl?"li":"div"}>`);for(let S=M;S<R;S++)x+=n[S].html;H>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=x,F(A),this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderItem=function(){const n=document.createElement(this.isUl?"li":"div");return n.className="ln-list__placeholder",n.setAttribute("aria-hidden","true"),n.style.height=this._itemHeight+"px",n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._itemHeight;if(!n)return;const i=this._scrollContainer;let r,c;if(i){const A=this.tbody.getBoundingClientRect(),S=i.getBoundingClientRect(),j=i===this.tbody?0:A.top-S.top+i.scrollTop;r=i.scrollTop-j,c=i.clientHeight}else{const S=this.tbody.getBoundingClientRect().top+window.scrollY;r=window.scrollY-S,c=window.innerHeight}const f=this._readGridLayout(),_=f.columns,w=f.rowGap,y=n+w,E=this._cache.logicalTotal,g=Math.ceil(E/_);let C=Math.max(0,Math.floor(r/y)-15);C=Math.min(C,g);const k=Math.ceil(c/y)+30,W=Math.min(C+k,g),z=Math.min(C*_,E),M=Math.min(W*_,E),R=C*y,U=(g-W)*y,H=document.createDocumentFragment();if(R>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=R+"px",H.appendChild(A)}for(let A=z;A<M;A++)if(this._cache.has(A)){const S=this._buildItem(this._cache.get(A));S&&H.appendChild(S)}else H.appendChild(this._buildPlaceholderItem());if(U>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=U+"px",H.appendChild(A)}const x=I(this);this.tbody.replaceChildren(H),F(x),this._vStart=z,this._vEnd=M,this._cache.ensure(z,M)},v.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,c=this.visibleCount===0&&i>0,f=c?this.name+"-empty-filtered":this.name+"-empty";if(n=st(this.dom,f,"ln-list"),!n){const _=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(_){const w=c?"search":"initial",y=_.content.querySelector(`[data-ln-empty-when="${w}"]`)||_.content.firstElementChild;y&&(n=document.importNode(y,!0))}}}else{const i=this.dom.querySelector(`template[${l}]`);if(i){const r=i.content.firstElementChild;r&&(n=document.importNode(r,!0))}}if(n)if(n.tagName==="LI"||n.tagName==="TR")this.tbody.replaceChildren(n);else{const i=document.createElement(this.isUl?"li":"div");i.appendChild(n),this.tbody.replaceChildren(i)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._buildItem=function(n){let i=st(this.dom,this.name+"-row","ln-list");if(!i){const c=this.dom.querySelector("template[data-ln-item]");c&&(i=document.importNode(c.content,!0))}let r=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(r)K(r,n),Q(r,n);else if(n&&n.html){const c=document.createElement(this.isUl?"ul":"div");c.innerHTML=n.html,r=c.firstElementChild}else if(r=document.createElement(this.isUl?"li":"div"),r.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const c in n)if(c!=="html"&&n[c]!=null){const f=document.createElement("span");f.setAttribute("data-ln-field",c),f.textContent=String(n[c]),r.appendChild(f)}}if(r._lnRecord=n,n&&n.id!=null&&(r.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){r.classList.add("ln-item-selected");const c=r.querySelector("[data-ln-item-select]");c&&(c.checked=!0)}return r},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const r=n[i].getAttribute("data-ln-item-id"),c=r!=null&&this.selectedIds.has(String(r));n[i].classList.toggle("ln-item-selected",c);const f=n[i].querySelector("[data-ln-item-select]");f&&(f.checked=c)}this._updateSelectAll()},v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const r=i.target.closest("[data-ln-item-select]");if(!r)return;const c=r.closest("[data-ln-item]");if(!c)return;const f=c.getAttribute("data-ln-item-id");f!=null&&(r.checked?(n.selectedIds.add(String(f)),c.classList.add("ln-item-selected")):(n.selectedIds.delete(String(f)),c.classList.remove("ln-item-selected")),n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const i=n._selectAllCheckbox.checked,r=n.tbody.querySelectorAll("[data-ln-item]");for(let c=0;c<r.length;c++){const f=r[c],_=f.getAttribute("data-ln-item-id"),w=f.querySelector("[data-ln-item-select]");_!=null&&(i?(n.selectedIds.add(String(_)),f.classList.add("ln-item-selected")):(n.selectedIds.delete(String(_)),f.classList.remove("ln-item-selected")),w&&(w.checked=i))}D(n.dom,"ln-list:select-all",{list:n.name,selected:i}),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let r=0;r<n.length;r++){const c=n[r].getAttribute("data-ln-item-id");if(c!=null&&!this.selectedIds.has(String(c))){i=!1;break}}this._selectAllCheckbox.checked=i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}At(this,"ln-list:request-data","list")},v.prototype._enterWindowedMode=function(){const n=this,i=this.dom,r=parseInt(i.getAttribute("data-ln-list-window"),10),c=parseInt(i.getAttribute("data-ln-list-window-page"),10),f=parseInt(i.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Pt(this._onCacheChange),this._cache=Qt({windowSize:r>0?r:1e3,pageSize:c>0?c:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(_,w,y){D(i,"ln-list:request-data",{list:n.name,sort:_.sort,filters:_.filters,search:_.search,offset:w,limit:y,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){const n=parseInt(this.dom.getAttribute("data-ln-list-count"),10),i=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:i,filtered:i})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},v.prototype._updateFooter=function(){let n=0,i=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,i=this.visibleCount):(n=this._data.length,i=this._filteredData.length);const r=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=r?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!r),this._selectedSpan){const c=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=c>0?q(c,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",c===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[e])},vt(t,e,v,"ln-list",{attributes:L})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function N(){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(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!E(r))return}e.apply(console,t)}}function v(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function j(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function L(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function ie(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function le(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(f){return f.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=de(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=se);const U={};function ae(e,t){U[e]=t}function fe(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=fe);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];W[n]=t}function pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=we);const O={};function be(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function V(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const f=o[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const f=o[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function me(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(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 H(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ge(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],f=u.getAttribute("data-ln-render-key");f&&(l[f]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],f=String(r(u));let d=l[f];if(d)i(d,u,o);else{const a=be(n,s);if(!a||(H(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),i(d,u,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=H,window.lnCore.fill=V,window.lnCore.lnFill=me,window.lnCore.renderList=ge);function q(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function K(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function Q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function P(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return I.set(n,i),i}function J(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function X(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=P(r.values,r.fallback);break;case"integer":i=K;break;case"float":i=J;break;case"boolean":i=G;break;case"list":i=Q;break;case"json":i=z;break;case"string":default:i=q;break}i||(i=q),t[r.prop]=[i,n,r.fallback]}return t}function Ae(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function _e(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=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=q,window.lnCore.attrInt=K,window.lnCore.attrBool=G,window.lnCore.attrList=Q,window.lnCore.attrEnum=P,window.lnCore.attrFloat=J,window.lnCore.attrJson=z);function g(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 Y(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&g(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)g(c[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(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 Z(){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 ke(e){const t=Z(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Z(),i=r.byAttr.get(t),s=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&E(l)){const c=r.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<c.length;u++)X(c[u].spec,o,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ee(c,l,t,e.oldValue),r.reactiveWildcard.length&&ee(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(Y(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=R();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=D();if(e.target&&r.length)for(let i=0;i<r.length;i++){const s=r[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)s.matches&&s.matches(o.query)&&g(s,o);else if(s.matches&&s.matches(o.query)&&g(s,o),s.querySelectorAll){const u=s.querySelectorAll(o.query);for(let f=0;f<u.length;f++)g(u[f],o)}}o.onInit&&o.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 o=t[c],u=o.query;if(u){if(!l)s.matches&&s.matches(u)&&T(s,o);else if(s.matches&&s.matches(u)&&T(s,o),s.querySelectorAll){const f=s.querySelectorAll(u);for(let d=0;d<f.length;d++)T(f[d],o)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{te(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(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 r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{te(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 Oe(e){R().push(e),e.onSubtreeChange&&e.query&&D().push(e),ne()}function oe(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,f=i.effects||null,d=i.attributes||null,a=d?Ae(d):f,w=d?new Set(Object.keys(d)):null,h=i.persist||null;function b(m){const p=m||document.body;if(Y(p,e,t,n),d&&N())for(const _ in d){const Pe=d[_],M=Array.from(p.querySelectorAll("["+_+"]"));p.matches&&p.matches("["+_+"]")&&M.push(p);for(let $=0;$<M.length;$++){const B=M[$];E(B)&&X(Pe,B.getAttribute(_),_,r,B)}}o&&o(p)}const y=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let p;for(;(p=m.exec(e))!==null;)y.push(p[1])}else y.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:y.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:w,persist:h}),Ee();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=i.subtreeQuery||(C?e:"["+e+"]"),A={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:k};R().push(A),c&&k&&D().push(A),ne(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=Oe,window.lnCore.withoutLifecycle=Le);function x(){ve()>0?Se(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),b}function re(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,n={},r=re(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function qe(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const n=F();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("&");re(location.hash)!==i&&(location.hash=i)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=qe,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Me,window.lnCore.hashFilterDecode=$e);function Be(e){return(e||"").replace(/^\?/,"")}function Ne(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Be(t);if(!r)return n;const i=new URLSearchParams(r);for(const[s,l]of i.entries())n[s]=l;return n}function je(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ue(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 r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function We(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 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 Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(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 r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ke(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ge(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=Ne,window.lnCore.queryGet=je,window.lnCore.querySet=Ue,window.lnCore.resolveQueryParam=We,window.lnCore.querySortEncode=Ve,window.lnCore.querySortDecode=He,window.lnCore.queryFilterEncode=Ke,window.lnCore.queryFilterDecode=Ge);function Qe(){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=Qe),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",r="data-ln-modal-close";if(window[t]!==void 0)return;const i={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},s=new Set;let l=null;function c(){l||(l=function(d){if(ie(d))return;const a=d.target.closest("["+n+"]");if(!a||le(a))return;const w=a.getAttribute(n);if(!w)return;const h=document.getElementById(w);!h||!h[t]||(d.preventDefault(),a.hasAttribute("data-ln-modal-mode")?h.setAttribute("data-ln-modal-mode",a.getAttribute("data-ln-modal-mode")):h.hasAttribute("data-ln-modal-mode")&&h.setAttribute("data-ln-modal-mode","new"),h.setAttribute(e,"open"))},document.addEventListener("click",l))}function o(){s.size>0||!l||(document.removeEventListener("click",l),l=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open";const a=this;return this._onRequestOpen=function(){a.dom.setAttribute(e,"open")},this._onRequestClose=function(){a.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),a.dom.setAttribute(e,"close")},this._onClose=function(){!a.isOpen||a.dom.getAttribute(e)!=="open"||a.dom.open||(a._isNativeClosing=!0,a.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const h=w.target.closest("["+r+"]");h&&a.dom.contains(h)&&(w.preventDefault(),a.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),s.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),v(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}u.prototype.open=function(){this.dom.setAttribute(e,"open")},u.prototype.close=function(){this.dom.setAttribute(e,"close")},u.prototype.toggle=function(){const d=this.dom.getAttribute(e);this.dom.setAttribute(e,d==="open"?"close":"open")},u.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),s.delete(this),o(),this.isOpen){const d=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==d})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(d){const a=d[t];if(!a)return;const w=!!a._isNativeClosing;a._isNativeClosing=!1;const b=d.getAttribute(e)==="open";if(b===a.isOpen){b&&d.isConnected&&!d.open&&typeof d.showModal=="function"&&d.showModal();return}if(b){if(j(d,"ln-modal:before-open",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"close");return}a.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof d.showModal=="function"&&d.showModal();const C=d.querySelector("[autofocus]");if(C&&L(C))C.focus();else{const k=d.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),A=Array.prototype.find.call(k,L);if(A)A.focus();else{const x=d.querySelectorAll("a[href], button:not([disabled])"),m=Array.prototype.find.call(x,L);m&&m.focus()}}v(d,"ln-modal:open",{modalId:d.id,target:d})}else{if(!w&&j(d,"ln-modal:before-close",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"open");return}a.isOpen=!1,d.hasAttribute("data-ln-modal-mode")&&d.setAttribute("data-ln-modal-mode","new"),typeof d.close=="function"&&d.open&&d.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),v(d,"ln-modal:close",{modalId:d.id,target:d})}}oe(e,t,u,"ln-modal",{attributes:i})})()})();
1
+ (function(){"use strict";function B(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!E(r))return}e.apply(console,t)}}function _(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function N(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function L(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function ie(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function le(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(o).split(",").map(function(f){return f.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=de(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=se);const j={};function ae(e,t){j[e]=t}function fe(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=fe);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){_(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];U[n]=t}function pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=we);const O={};function be(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const f=o[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const f=o[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function me(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(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 V(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ge(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],f=u.getAttribute("data-ln-render-key");f&&(l[f]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],f=String(r(u));let d=l[f];if(d)i(d,u,o);else{const a=be(n,s);if(!a||(V(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),i(d,u,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=W,window.lnCore.lnFill=me,window.lnCore.renderList=ge);function q(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function H(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return I.set(n,i),i}function P(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function z(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=Q(r.values,r.fallback);break;case"integer":i=H;break;case"float":i=P;break;case"boolean":i=K;break;case"list":i=G;break;case"json":i=J;break;case"string":default:i=q;break}i||(i=q),t[r.prop]=[i,n,r.fallback]}return t}function Ae(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function _e(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=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=q,window.lnCore.attrInt=H,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=P,window.lnCore.attrJson=J);function S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function X(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&S(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)S(c[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(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 Y(){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 ke(e){const t=Y(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Y(),i=r.byAttr.get(t),s=B()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&E(l)){const c=r.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<c.length;u++)z(c[u].spec,o,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&Z(c,l,t,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(X(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ee(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=R();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=D();if(e.target&&r.length)for(let i=0;i<r.length;i++){const s=r[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const o=t[c],u=o.query;if(u&&(s.matches&&s.matches(u)&&(o.ComponentFn&&S(s,o),o.onInit&&o.onInit(s)),l&&s.querySelectorAll)){const f=s.querySelectorAll(u);for(let d=0;d<f.length;d++)o.ComponentFn&&S(f[d],o),o.onInit&&o.onInit(f[d])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const o=t[c],u=o.query;if(u&&(s.matches&&s.matches(u)&&ee(s,o),l&&s.querySelectorAll)){const f=s.querySelectorAll(u);for(let d=0;d<f.length;d++)ee(f[d],o)}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{te(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(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 r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{te(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 Oe(e){R().push(e),e.onSubtreeChange&&e.query&&D().push(e),ne()}function oe(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,f=i.effects||null,d=i.attributes||null,a=d?Ae(d):f,w=d?new Set(Object.keys(d)):null,h=i.persist||null;function b(m){const p=m||document.body;if(X(p,e,t,n),d&&B())for(const A in d){const Pe=d[A],F=Array.from(p.querySelectorAll("["+A+"]"));p.matches&&p.matches("["+A+"]")&&F.push(p);for(let M=0;M<F.length;M++){const $=F[M];E($)&&z(Pe,$.getAttribute(A),A,r,$)}}o&&o(p)}const g=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let p;for(;(p=m.exec(e))!==null;)g.push(p[1])}else g.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:w,persist:h}),Ee();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=i.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:k};R().push(C),c&&k&&D().push(C),ne(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=Oe,window.lnCore.withoutLifecycle=Le);function x(){ve()>0?Se(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),b}function re(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=re(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function qe(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const n=T();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("&");re(location.hash)!==i&&(location.hash=i)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=qe,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Me,window.lnCore.hashFilterDecode=$e);function Be(e){return(e||"").replace(/^\?/,"")}function Ne(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Be(t);if(!r)return n;const i=new URLSearchParams(r);for(const[s,l]of i.entries())n[s]=l;return n}function je(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ue(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 r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function We(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 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 Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(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 r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ke(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ge(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=Ne,window.lnCore.queryGet=je,window.lnCore.querySet=Ue,window.lnCore.resolveQueryParam=We,window.lnCore.querySortEncode=Ve,window.lnCore.querySortDecode=He,window.lnCore.queryFilterEncode=Ke,window.lnCore.queryFilterDecode=Ge);function Qe(){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=Qe),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",r="data-ln-modal-close";if(window[t]!==void 0)return;const i={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},s=new Set;let l=null;function c(){l||(l=function(d){if(ie(d))return;const a=d.target.closest("["+n+"]");if(!a||le(a))return;const w=a.getAttribute(n);if(!w)return;const h=document.getElementById(w);!h||!h[t]||(d.preventDefault(),a.hasAttribute("data-ln-modal-mode")?h.setAttribute("data-ln-modal-mode",a.getAttribute("data-ln-modal-mode")):h.hasAttribute("data-ln-modal-mode")&&h.setAttribute("data-ln-modal-mode","new"),h.setAttribute(e,"open"))},document.addEventListener("click",l))}function o(){s.size>0||!l||(document.removeEventListener("click",l),l=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open";const a=this;return this._onRequestOpen=function(){a.dom.setAttribute(e,"open")},this._onRequestClose=function(){a.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),a.dom.setAttribute(e,"close")},this._onClose=function(){!a.isOpen||a.dom.getAttribute(e)!=="open"||a.dom.open||(a._isNativeClosing=!0,a.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const h=w.target.closest("["+r+"]");h&&a.dom.contains(h)&&(w.preventDefault(),a.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),s.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),_(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}u.prototype.open=function(){this.dom.setAttribute(e,"open")},u.prototype.close=function(){this.dom.setAttribute(e,"close")},u.prototype.toggle=function(){const d=this.dom.getAttribute(e);this.dom.setAttribute(e,d==="open"?"close":"open")},u.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),s.delete(this),o(),this.isOpen){const d=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==d})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(d){const a=d[t];if(!a)return;const w=!!a._isNativeClosing;a._isNativeClosing=!1;const b=d.getAttribute(e)==="open";if(b===a.isOpen){b&&d.isConnected&&!d.open&&typeof d.showModal=="function"&&d.showModal();return}if(b){if(N(d,"ln-modal:before-open",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"close");return}a.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof d.showModal=="function"&&d.showModal();const y=d.querySelector("[autofocus]");if(y&&L(y))y.focus();else{const k=d.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),C=Array.prototype.find.call(k,L);if(C)C.focus();else{const x=d.querySelectorAll("a[href], button:not([disabled])"),m=Array.prototype.find.call(x,L);m&&m.focus()}}_(d,"ln-modal:open",{modalId:d.id,target:d})}else{if(!w&&N(d,"ln-modal:before-close",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"open");return}a.isOpen=!1,d.hasAttribute("data-ln-modal-mode")&&d.setAttribute("data-ln-modal-mode","new"),typeof d.close=="function"&&d.open&&d.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),_(d,"ln-modal:close",{modalId:d.id,target:d})}}oe(e,t,u,"ln-modal",{attributes:i})})()})();