@livenetworks/ashlar 2.0.10 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +106 -40
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/src/ln-editor.js +45 -12
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!D(r))return}e.apply(console,t)}}function j(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 le(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function ce(e){if(!e)return!1;if(typeof e.closest=="function")return!!e.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])');const t=String(e.tagName||"").toLowerCase();return t==="input"||t==="textarea"||t==="select"||!!e.isContentEditable}function ue(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function ae(e,t){return!e||!document.contains(e)||ue(e)||t&&typeof e[t]!="function"?!1:se(e)}function fe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function de(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function we(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function he(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const u=String(l).split(",").map(function(d){return d.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=we(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<i.options.length;u++)i.options[u].selected=l.indexOf(i.options[u].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=he,window.lnCore.serializeForm=de,window.lnCore.resolveFormMethod=fe);const W={};function pe(e,t){W[e]=t}function be(e){return W[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){j(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function ye(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ye,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=ge);const R={};function Ce(e,t){R[e]||(R[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=R[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const d=l[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),h=d[1].trim();t[h]!=null&&c.setAttribute(f,t[h])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const d=l[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),h=d[1].trim();h in t&&c.classList.toggle(f,!!t[h])}}return e}function Ae(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)H(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 P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ke(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const u=e.children[l],d=u.getAttribute("data-ln-render-key");d&&(i[d]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],d=String(r(u));let f=i[d];if(f)o(f,u,l);else{const h=Ce(n,s);if(!h||(P(h,u),f=h.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),o(f,u,l)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=H,window.lnCore.lnFill=Ae,window.lnCore.renderList=ke);function F(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function J(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const M=new Map;function G(e,t){const n=(e?e.join("|"):"")+"::"+t;if(M.has(n))return M.get(n);const r=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&r.has(c)?c:t};return M.set(n,o),o}function X(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Y(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,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function Se(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=G(r.values,r.fallback);break;case"integer":o=z;break;case"float":o=X;break;case"boolean":o=Q;break;case"list":o=J;break;case"json":o=Y;break;case"string":default:o=F;break}o||(o=F),t[r.prop]=[o,n,r.fallback]}return t}function _e(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 ve(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=xe,window.lnCore.attrSpec=Se,window.lnCore.attrStr=F,window.lnCore.attrInt=z,window.lnCore.attrBool=Q,window.lnCore.attrList=J,window.lnCore.attrEnum=G,window.lnCore.attrFloat=X,window.lnCore.attrJson=Y);function $(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ee(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 ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=ee(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ve(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Ie(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ee(),o=r.byAttr.get(n);if(K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&D(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)Z(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&te(s,t,n,e.oldValue),r.reactiveWildcard.length&&te(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):($(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(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 ne(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function De(e){const t=ne();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];$(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const d=u[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",u,f)}delete u[s.attribute]}}}}}}function Re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{De(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function B(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,f=o.attributes||null,h=f?_e(f):d,S=f?new Set(Object.keys(f)):null,_=o.persist||null;function g(m){const b=m||document.body;if($(b,e,t,n),f&&K())for(const p in f){const T=f[p],C=Array.from(b.querySelectorAll("["+p+"]"));b.matches&&b.matches("["+p+"]")&&C.push(b);for(let A=0;A<C.length;A++){const E=C[A];D(E)&&Z(T,E.getAttribute(p),p,r,E)}}l&&l(b)}const y=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let b;for(;(b=m.exec(e))!==null;)y.push(b[1])}else y.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:y.concat(s),onAttributeChange:i,onAttrChange:u,effects:h,declared:S,persist:_}),Le();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(v?e:"["+e+"]");ne().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:a}),Re(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=B);function w(){Te()>0?Ee(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w):w(),g}function re(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,n={},r=re(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function Fe(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Me(e,t){if(!e)return;const n=N();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");re(location.hash)!==o&&(location.hash=o)}function $e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Be(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 Ne(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Fe,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=$e,window.lnCore.resolveHashNamespace=Be,window.lnCore.hashSortEncode=Ne,window.lnCore.hashSortDecode=Ue,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Ke);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je);const k=["Ctrl","Alt","Shift","Meta"],We={alt:"Alt",control:"Ctrl",ctrl:"Ctrl",meta:"Meta",command:"Meta",cmd:"Meta",option:"Alt",shift:"Shift",esc:"Escape",escape:"Escape",space:"Space",spacebar:"Space",enter:"Enter",return:"Enter",tab:"Tab",backspace:"Backspace",delete:"Delete",del:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",arrowup:"ArrowUp",up:"ArrowUp",arrowdown:"ArrowDown",down:"ArrowDown",arrowleft:"ArrowLeft",left:"ArrowLeft",arrowright:"ArrowRight",right:"ArrowRight"};function oe(e){if(e===" ")return"Space";const t=String(e||"").trim();if(!t)return"";const n=We[t.toLowerCase()];return n||(t.length===1||/^f\d{1,2}$/i.test(t)?t.toUpperCase():t.charAt(0).toUpperCase()+t.slice(1))}function ie(e){const t=String(e||"").replace(/\s*\+\s*/g,"+").trim();if(!t)return"";const n=t.split("+"),r=new Set;let o="";for(let i=0;i<n.length;i++){const c=oe(n[i]);if(!c)return"";if(k.indexOf(c)!==-1){r.add(c);continue}if(o)return"";o=c}if(!o)return"";const s=[];for(let i=0;i<k.length;i++)r.has(k[i])&&s.push(k[i]);return s.push(o),s.join("+")}function Ve(e){const t=String(e||"").replace(/\s*\+\s*/g,"+").trim();if(!t)return[];const n=t.split(/[\s,]+/),r=[];for(let o=0;o<n.length;o++){const s=ie(n[o]);s&&r.indexOf(s)===-1&&r.push(s)}return r}function He(e,t){const n=String(t||"").trim();if(!n||/[\s,]/.test(n))return"";const r=String(e||"").replace(/\s*\+\s*/g,"+").trim();return/[\s,]/.test(r)?"":ie(r?r+"+"+n:n)}function Pe(e){if(!e)return"";const t=oe(e.key);if(!t||k.indexOf(t)!==-1)return"";const n=[];return e.ctrlKey&&n.push("Ctrl"),e.altKey&&n.push("Alt"),e.shiftKey&&n.push("Shift"),e.metaKey&&n.push("Meta"),n.push(t),n.join("+")}function ze(e){if(!e||!e.tagName)return null;const t=String(e.tagName).toLowerCase();if(t==="button"||t==="a"&&e.hasAttribute&&e.hasAttribute("href"))return"click";if(t==="input"||t==="textarea"||t==="select"||e.isContentEditable)return"focus";if(e.hasAttribute&&e.hasAttribute("contenteditable")){const n=e.getAttribute("contenteditable");if(n===""||String(n).toLowerCase()!=="false")return"focus"}return null}function Qe(e,t,n,r){if(!e||!t||n!=="click"||e.target!==t||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)return!1;const o=String(t.tagName||"").toLowerCase();return o==="button"?r==="Enter"||r==="Space":o==="a"&&t.hasAttribute&&t.hasAttribute("href")&&r==="Enter"}(function(){const e="data-ln-key",t="lnKey",n="data-ln-key-target",r="data-ln-key-allow-input",o="data-ln-key-modifier",s="data-ln-key-for",i="lnKeyFor";if(window[t]!==void 0)return;function c(a){const w=a[t];if(w){if(!a.hasAttribute(e)){w.destroy();return}w.sync()}}function l(a){const w=a[i];w&&!a.hasAttribute(s)&&w.destroy()}const u={"data-ln-key":{type:"string",effect:c,description:"Keyboard shortcut combination (e.g. meta+k, ctrl+s)"},"data-ln-key-target":{type:"string",effect:c,description:"Target element selector or ID to receive synthetic click or focus"},"data-ln-key-allow-input":{type:"boolean",effect:c,description:"Permits shortcut execution even when focused inside an editable input"}},d={"data-ln-key-for":{type:"string",effect:l,description:"Target element ID that this shortcut badge is displayed for"},"data-ln-key-modifier":{type:"string",description:"Platform modifier text representation override"}},f=new Set;let h=null;function S(){h||(h=function(a){if(a.defaultPrevented||a.isComposing||a.repeat)return;const w=Pe(a);if(!w)return;const m=ce(a.target),b=document.querySelectorAll("["+e+"], ["+s+"]");let p=null,T=!1,C=!1;for(let U=0;U<b.length;U++){const q=b[U],O=q[t]||q[i];if(!O||!O.matches(w)||m&&!O.allowsInput())continue;const I=O.resolveTarget(),L=ze(I);if(!(!L||!ae(I,L))){if(Qe(a,I,L,w)){C=!0;continue}p?T=!0:p={host:q,target:I,action:L}}}if(C||!p)return;T&&console.warn('[ln-key] Duplicate active shortcut "'+w+'"; first DOM match wins.');const A={source:p.host,target:p.target,action:p.action,key:w,event:a};le(p.host,"ln-key:before-trigger",A).defaultPrevented||(a.preventDefault(),p.target[p.action](),j(p.host,"ln-key:trigger",A))},document.addEventListener("keydown",h))}function _(){f.size>0||!h||(document.removeEventListener("keydown",h),h=null)}function g(a){return this.dom=a,this.shortcuts=[],f.add(this),this.sync(),S(),this}g.prototype.sync=function(){this.shortcuts=Ve(this.dom.getAttribute(e))},g.prototype.matches=function(a){return this.shortcuts.indexOf(a)!==-1},g.prototype.allowsInput=function(){return this.dom.hasAttribute(r)},g.prototype.resolveTarget=function(){const a=this.dom.getAttribute(n);return a?v(a,n):this.dom},g.prototype.destroy=function(){this.dom[t]&&(f.delete(this),delete this.dom[t],_())};function y(a){return this.dom=a,f.add(this),S(),this}y.prototype._modifierContext=function(){return this.dom.closest("["+o+"]")},y.prototype.shortcut=function(){const a=this._modifierContext(),w=a?a.getAttribute(o):"";return He(w,this.dom.textContent)},y.prototype.matches=function(a){return this.shortcut()===a},y.prototype.allowsInput=function(){if(this.dom.hasAttribute(r))return!0;const a=this._modifierContext();return!!(a&&a.hasAttribute(r))},y.prototype.resolveTarget=function(){return v(this.dom.getAttribute(s),s)},y.prototype.destroy=function(){this.dom[i]&&(f.delete(this),delete this.dom[i],_())};function v(a,w){if(!a)return null;try{const m=document.querySelector(a);return m||console.warn("[ln-key] Target not found for "+w+' selector "'+a+'".'),m}catch{return console.warn("[ln-key] Invalid "+w+' selector "'+a+'".'),null}}B(e,t,g,"ln-key",{attributes:u}),B(s,i,y,"ln-key-for",{attributes:d})})()})();
|
|
1
|
+
(function(){"use strict";function W(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function R(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!R(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 ue(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}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 ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function fe(e){if(!e)return!1;if(typeof e.closest=="function")return!!e.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])');const t=String(e.tagName||"").toLowerCase();return t==="input"||t==="textarea"||t==="select"||!!e.isContentEditable}function de(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function we(e,t){return!e||!document.contains(e)||de(e)||t&&typeof e[t]!="function"?!1:ae(e)}function he(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},c=e.elements,i={};if(n)for(let s=0;s<c.length;s++){const l=c[s];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<c.length;s++){const l=c[s];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function be(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ge(e,t){const n=e.elements,r=[],o={};for(let c=0;c<n.length;c++){const i=n[c];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let c=0;c<n.length;c++){const i=n[c];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const l=t[s];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const u=String(l).split(",").map(function(d){return d.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=be(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<i.options.length;u++)i.options[u].selected=l.indexOf(i.options[u].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=he);const H={};function ye(e,t){H[e]=t}function me(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=me);function Ce(){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 P={};function Ae(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];P[n]=t}function ke(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ae,window.lnCore.getLocaleFallback=ke,window.lnCore.ensureLocaleObserver=Ce);const F={};function xe(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const s=n[i],l=s.getAttribute("data-ln-field");t[l]!=null&&(s.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const s=r[i],l=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const d=l[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),h=d[1].trim();t[h]!=null&&s.setAttribute(f,t[h])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const s=o[i],l=s.getAttribute("data-ln-show");l in t&&s.classList.toggle("hidden",!t[l])}const c=e.querySelectorAll("[data-ln-class]");for(let i=0;i<c.length;i++){const s=c[i],l=s.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const d=l[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),h=d[1].trim();h in t&&s.classList.toggle(f,!!t[h])}}return e}function Se(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)z(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 Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const c=n.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,s){return t[s]!==void 0?t[s]:""}))}const r=function(c,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let c=0;c<o.length;c++){const i=o[c],s=i.attributes;for(let l=0;l<s.length;l++){const u=s[l];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function _e(e,t,n,r,o,c){const i={};for(let l=0;l<e.children.length;l++){const u=e.children[l],d=u.getAttribute("data-ln-render-key");d&&(i[d]=u)}const s=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],d=String(r(u));let f=i[d];if(f)o(f,u,l);else{const h=xe(n,c);if(!h||(Q(h,u),f=h.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),o(f,u,l)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=z,window.lnCore.lnFill=Se,window.lnCore.renderList=_e);function q(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function J(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const M=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(M.has(n))return M.get(n);const r=new Set(e||[]),o=function(c,i){const s=c.getAttribute(i);return s!==null&&r.has(s)?s:t};return M.set(n,o),o}function Z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ee(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function te(e,t,n,r,o){if(!e||t===null)return!0;const c=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(s(`[${c}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(s(`[${c}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return s(`[${c}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ve(e,t,n){for(const r in n){const[o,c,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,c,i)},enumerable:!0,configurable:!0})}return e}function Ee(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Y(r.values,r.fallback);break;case"integer":o=J;break;case"float":o=Z;break;case"boolean":o=G;break;case"list":o=X;break;case"json":o=ee;break;case"string":default:o=q;break}o||(o=q),t[r.prop]=[o,n,r.fallback]}return t}function Te(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 Oe(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=ve,window.lnCore.attrSpec=Ee,window.lnCore.attrStr=q,window.lnCore.attrInt=J,window.lnCore.attrBool=G,window.lnCore.attrList=X,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function k(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 ne(e,t,n,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(c)&&k(e,i),e.querySelectorAll){const s=e.querySelectorAll(c);for(let l=0;l<s.length;l++)k(s[l],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function De(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 re(){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 Ie(e){const t=re(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(c=>c.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Oe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,n,r){for(let o=0;o<e.length;o++){const c=e[o];if(!t[c.attribute])continue;const i=c.effects&&c.effects[n];i?i(t,n,r):c.onAttrChange&&(!c.declared||c.declared.has(n))&&c.onAttrChange(t,n,r)}}function Re(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=re(),o=r.byAttr.get(t),c=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!c)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(c&&R(i)){const s=r.byDeclaredAttr.get(t),l=i.getAttribute(t);for(let u=0;u<s.length;u++)te(s[u].spec,l,t,s[u].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const s=r.byReactive.get(t);s&&oe(s,i,t,e.oldValue),r.reactiveWildcard.length&&oe(r.reactiveWildcard,i,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const l=o[s];if(l.handler){l.handler(i,t,e.oldValue);continue}l.onAttributeChange&&i[l.attribute]?l.onAttributeChange(i,t):(ne(i,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(i))}}}function Fe(){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{Re(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function B(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 qe(e){const t=$();if(!t.length)return;const n=e.target;if(n){const r=n.nodeType===1?n:n.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const o=t[r];if(o.onSubtreeChange&&o.query){const c=o.query,i=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;i&&o.onSubtreeChange(i,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const s=t[i];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)o.matches&&o.matches(s.query)&&k(o,s);else if(o.matches&&o.matches(s.query)&&k(o,s),o.querySelectorAll){const l=o.querySelectorAll(s.query);for(let u=0;u<l.length;u++)k(l[u],s)}}s.onInit&&s.onInit(o)}}}for(let r=0;r<e.removedNodes.length;r++){const o=e.removedNodes[r];if(o.nodeType===1){const c=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const s=t[i],l=s.query;if(l){if(!c)o.matches&&o.matches(l)&&B(o,s);else if(o.matches&&o.matches(l)&&B(o,s),o.querySelectorAll){const u=o.querySelectorAll(l);for(let d=0;d<u.length;d++)B(u[d],s)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{qe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){$().push(e),ie()}function N(e,t,n,r,o={}){const c=o.extraAttributes||[],i=o.onAttributeChange||null,s=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,f=o.attributes||null,h=f?Te(f):d,_=f?new Set(Object.keys(f)):null,v=o.persist||null;function g(m){const b=m||document.body;if(ne(b,e,t,n),f&&W())for(const p in f){const T=f[p],C=Array.from(b.querySelectorAll("["+p+"]"));b.matches&&b.matches("["+p+"]")&&C.push(b);for(let A=0;A<C.length;A++){const O=C[A];R(O)&&te(T,O.getAttribute(p),p,r,O)}}l&&l(b)}const y=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let b;for(;(b=m.exec(e))!==null;)y.push(b[1])}else y.push(e);Ie({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:y.concat(c),onAttributeChange:i,onAttrChange:u,effects:h,declared:_,persist:v}),Fe();const E=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(E?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:s,query:a}),ie(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=N,window.lnCore.observeLifecycle=Me);function w(){Le()>0?De(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w):w(),g}function le(e){return(e||"").replace(/^#/,"")}function U(e){const t=e===void 0?location.hash:e,n={},r=le(t);if(!r)return n;const o=r.split("&");for(let c=0;c<o.length;c++){const i=o[c];if(!i)continue;const s=i.indexOf(":"),l=s>-1?i.slice(0,s):i,u=s>-1?i.slice(s+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function $e(e){if(!e)return null;const t=U();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=U();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(c){const i=n[c];return i===""?c:c+":"+encodeURIComponent(i)}).join("&");le(location.hash)!==o&&(location.hash=o)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ue(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 Ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function We(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=U,window.lnCore.hashGet=$e,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=Ue,window.lnCore.hashSortEncode=Ke,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=We,window.lnCore.hashFilterDecode=Ve);function He(){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=He);const x=["Ctrl","Alt","Shift","Meta"],Pe={alt:"Alt",control:"Ctrl",ctrl:"Ctrl",meta:"Meta",command:"Meta",cmd:"Meta",option:"Alt",shift:"Shift",esc:"Escape",escape:"Escape",space:"Space",spacebar:"Space",enter:"Enter",return:"Enter",tab:"Tab",backspace:"Backspace",delete:"Delete",del:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",arrowup:"ArrowUp",up:"ArrowUp",arrowdown:"ArrowDown",down:"ArrowDown",arrowleft:"ArrowLeft",left:"ArrowLeft",arrowright:"ArrowRight",right:"ArrowRight"};function se(e){if(e===" ")return"Space";const t=String(e||"").trim();if(!t)return"";const n=Pe[t.toLowerCase()];return n||(t.length===1||/^f\d{1,2}$/i.test(t)?t.toUpperCase():t.charAt(0).toUpperCase()+t.slice(1))}function ce(e){const t=String(e||"").replace(/\s*\+\s*/g,"+").trim();if(!t)return"";const n=t.split("+"),r=new Set;let o="";for(let i=0;i<n.length;i++){const s=se(n[i]);if(!s)return"";if(x.indexOf(s)!==-1){r.add(s);continue}if(o)return"";o=s}if(!o)return"";const c=[];for(let i=0;i<x.length;i++)r.has(x[i])&&c.push(x[i]);return c.push(o),c.join("+")}function ze(e){const t=String(e||"").replace(/\s*\+\s*/g,"+").trim();if(!t)return[];const n=t.split(/[\s,]+/),r=[];for(let o=0;o<n.length;o++){const c=ce(n[o]);c&&r.indexOf(c)===-1&&r.push(c)}return r}function Qe(e,t){const n=String(t||"").trim();if(!n||/[\s,]/.test(n))return"";const r=String(e||"").replace(/\s*\+\s*/g,"+").trim();return/[\s,]/.test(r)?"":ce(r?r+"+"+n:n)}function Je(e){if(!e)return"";const t=se(e.key);if(!t||x.indexOf(t)!==-1)return"";const n=[];return e.ctrlKey&&n.push("Ctrl"),e.altKey&&n.push("Alt"),e.shiftKey&&n.push("Shift"),e.metaKey&&n.push("Meta"),n.push(t),n.join("+")}function Ge(e){if(!e||!e.tagName)return null;const t=String(e.tagName).toLowerCase();if(t==="button"||t==="a"&&e.hasAttribute&&e.hasAttribute("href"))return"click";if(t==="input"||t==="textarea"||t==="select"||e.isContentEditable)return"focus";if(e.hasAttribute&&e.hasAttribute("contenteditable")){const n=e.getAttribute("contenteditable");if(n===""||String(n).toLowerCase()!=="false")return"focus"}return null}function Xe(e,t,n,r){if(!e||!t||n!=="click"||e.target!==t||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)return!1;const o=String(t.tagName||"").toLowerCase();return o==="button"?r==="Enter"||r==="Space":o==="a"&&t.hasAttribute&&t.hasAttribute("href")&&r==="Enter"}(function(){const e="data-ln-key",t="lnKey",n="data-ln-key-target",r="data-ln-key-allow-input",o="data-ln-key-modifier",c="data-ln-key-for",i="lnKeyFor";if(window[t]!==void 0)return;function s(a){const w=a[t];if(w){if(!a.hasAttribute(e)){w.destroy();return}w.sync()}}function l(a){const w=a[i];w&&!a.hasAttribute(c)&&w.destroy()}const u={"data-ln-key":{type:"string",effect:s,description:"Keyboard shortcut combination (e.g. meta+k, ctrl+s)"},"data-ln-key-target":{type:"string",effect:s,description:"Target element selector or ID to receive synthetic click or focus"},"data-ln-key-allow-input":{type:"boolean",effect:s,description:"Permits shortcut execution even when focused inside an editable input"}},d={"data-ln-key-for":{type:"string",effect:l,description:"Target element ID that this shortcut badge is displayed for"},"data-ln-key-modifier":{type:"string",description:"Platform modifier text representation override"}},f=new Set;let h=null;function _(){h||(h=function(a){if(a.defaultPrevented||a.isComposing||a.repeat)return;const w=Je(a);if(!w)return;const m=fe(a.target),b=document.querySelectorAll("["+e+"], ["+c+"]");let p=null,T=!1,C=!1;for(let K=0;K<b.length;K++){const j=b[K],L=j[t]||j[i];if(!L||!L.matches(w)||m&&!L.allowsInput())continue;const D=L.resolveTarget(),I=Ge(D);if(!(!I||!we(D,I))){if(Xe(a,D,I,w)){C=!0;continue}p?T=!0:p={host:j,target:D,action:I}}}if(C||!p)return;T&&console.warn('[ln-key] Duplicate active shortcut "'+w+'"; first DOM match wins.');const A={source:p.host,target:p.target,action:p.action,key:w,event:a};ue(p.host,"ln-key:before-trigger",A).defaultPrevented||(a.preventDefault(),p.target[p.action](),V(p.host,"ln-key:trigger",A))},document.addEventListener("keydown",h))}function v(){f.size>0||!h||(document.removeEventListener("keydown",h),h=null)}function g(a){return this.dom=a,this.shortcuts=[],f.add(this),this.sync(),_(),this}g.prototype.sync=function(){this.shortcuts=ze(this.dom.getAttribute(e))},g.prototype.matches=function(a){return this.shortcuts.indexOf(a)!==-1},g.prototype.allowsInput=function(){return this.dom.hasAttribute(r)},g.prototype.resolveTarget=function(){const a=this.dom.getAttribute(n);return a?E(a,n):this.dom},g.prototype.destroy=function(){this.dom[t]&&(f.delete(this),delete this.dom[t],v())};function y(a){return this.dom=a,f.add(this),_(),this}y.prototype._modifierContext=function(){return this.dom.closest("["+o+"]")},y.prototype.shortcut=function(){const a=this._modifierContext(),w=a?a.getAttribute(o):"";return Qe(w,this.dom.textContent)},y.prototype.matches=function(a){return this.shortcut()===a},y.prototype.allowsInput=function(){if(this.dom.hasAttribute(r))return!0;const a=this._modifierContext();return!!(a&&a.hasAttribute(r))},y.prototype.resolveTarget=function(){return E(this.dom.getAttribute(c),c)},y.prototype.destroy=function(){this.dom[i]&&(f.delete(this),delete this.dom[i],v())};function E(a,w){if(!a)return null;try{const m=document.querySelector(a);return m||console.warn("[ln-key] Target not found for "+w+' selector "'+a+'".'),m}catch{return console.warn("[ln-key] Invalid "+w+' selector "'+a+'".'),null}}N(e,t,g,"ln-key",{attributes:u}),N(c,i,y,"ln-key-for",{attributes:d})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function j(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function _(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!_(i))return}e.apply(console,t)}}function V(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function U(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function K(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function H(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let u=0;u<s.length;u++){const o=s[u];o.name&&o.type==="checkbox"&&!o.disabled&&(r[o.name]=(r[o.name]||0)+1)}for(let u=0;u<s.length;u++){const o=s[u];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&r[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&l[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);l[o.name]=o.value===""||isNaN(c)?null:c}else l[o.name]=o.value}return l}function J(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function z(e,t){const n=e.elements,i=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const u=r.getAttribute("data-ln-fill-as")||r.name;if(!u||!(u in t))continue;const o=t[u];if(r.type==="checkbox"){if(Array.isArray(o))r.checked=o.indexOf(r.value)!==-1;else if(l[r.name]>1){const c=String(o).split(",").map(function(f){return f.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=J(o);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(o),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<r.options.length;c++)r.options[c].selected=o.indexOf(r.options[c].value)!==-1;i.push(r)}else r.value=o,r.tagName==="SELECT"&&o!=null&&r.setAttribute("data-ln-value",o),i.push(r)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=z,window.lnCore.serializeForm=H,window.lnCore.resolveFormMethod=K);const x={};function P(e,t){x[e]=t}function Y(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=P,window.lnCore.getDataMapper=Y);function G(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){V(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const S={};function Q(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];S[n]=t}function X(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return S[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Q,window.lnCore.getLocaleFallback=X,window.lnCore.ensureLocaleObserver=G);const g={};function Z(e,t){g[e]||(g[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=g[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function L(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const u=n[r],o=u.getAttribute("data-ln-field");t[o]!=null&&(u.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const u=i[r],o=u.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const f=o[c].trim().split(":");if(f.length!==2)continue;const p=f[0].trim(),h=f[1].trim();t[h]!=null&&u.setAttribute(p,t[h])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const u=l[r],o=u.getAttribute("data-ln-show");o in t&&u.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const u=s[r],o=u.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const f=o[c].trim().split(":");if(f.length!==2)continue;const p=f[0].trim(),h=f[1].trim();h in t&&u.classList.toggle(p,!!t[h])}}return e}function ee(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)L(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function E(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(r,u){return t[u]!==void 0?t[u]:""}))}const i=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],u=r.attributes;for(let o=0;o<u.length;o++){const c=u[o];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function te(e,t,n,i,l,s){const r={};for(let o=0;o<e.children.length;o++){const c=e.children[o],f=c.getAttribute("data-ln-render-key");f&&(r[f]=c)}const u=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],f=String(i(c));let p=r[f];if(p)l(p,c,o);else{const h=Z(n,s);if(!h||(E(h,c),p=h.firstElementChild,!p))continue;p.setAttribute("data-ln-render-key",f),l(p,c,o)}u.appendChild(p)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=E,window.lnCore.fill=L,window.lnCore.lnFill=ee,window.lnCore.renderList=te);function C(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function O(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function D(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function T(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function $(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const i=new Set(e||[]),l=function(s,r){const u=s.getAttribute(r);return u!==null&&i.has(u)?u:t};return y.set(n,l),l}function F(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function I(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function ne(e,t,n,i,l){if(!e||t===null)return!0;const s=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const u=o=>{l?console.warn(o,l):console.warn(o)};if(r==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const o=e.values||[];return o.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(u(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(u(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(o){return u(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const i in n){const[l,s,r]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=$(i.values,i.fallback);break;case"integer":l=O;break;case"float":l=F;break;case"boolean":l=D;break;case"list":l=T;break;case"json":l=I;break;case"string":default:l=C;break}l||(l=C),t[i.prop]=[l,n,i.fallback]}return t}function ie(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=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=C,window.lnCore.attrInt=O,window.lnCore.attrBool=D,window.lnCore.attrList=T,window.lnCore.attrEnum=$,window.lnCore.attrFloat=F,window.lnCore.attrJson=I);function le(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const u of r)if(!u[n]){window.lnCore._persistSink&&u.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(u,t);try{u[n]=new i(u)}catch(o){console.error("["+n+"] init failed",u,o)}}}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 se(e){const t=B(),n=e.observed||[];for(let i=0;i<n.length;i++){const l=n[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ie(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function N(e,t,n,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function ue(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=B(),l=i.byAttr.get(n);if(j()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&_(t)){const s=i.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let u=0;u<s.length;u++)ne(s[u].spec,r,n,s[u].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=i.byReactive.get(n);s&&N(s,t,n,e.oldValue),i.reactiveWildcard.length&&N(i.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(le(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ue(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ce(e,t){se({observed:e,handler:t}),ae()}function R(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},i=R(t);if(!i)return n;const l=i.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const u=r.indexOf(":"),o=u>-1?r.slice(0,u):r,c=u>-1?r.slice(u+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function de(e){if(!e)return null;const t=k();return e in t?t[e]:null}function fe(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 r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");R(location.hash)!==l&&(location.hash=l)}function we(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function be(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function pe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function he(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 ge(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(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=de,window.lnCore.hashSet=fe,window.lnCore.hashLinkClick=we,window.lnCore.resolveHashNamespace=be,window.lnCore.hashSortEncode=pe,window.lnCore.hashSortDecode=he,window.lnCore.hashFilterEncode=me,window.lnCore.hashFilterDecode=ge);function Ce(){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=Ce),(function(){const e="data-ln-link",t="lnLink";if(window[t]!==void 0)return;let n=null;function i(){n=document.createElement("div"),n.className="ln-link-status",document.body.appendChild(n)}function l(a){n&&(n.textContent=a,n.classList.add("ln-link-status--visible"))}function s(){n&&n.classList.remove("ln-link-status--visible")}function r(a,d){if(d.target.closest("a, button, input, select, textarea"))return;const w=a.querySelector("a");if(!w)return;const b=w.getAttribute("href");if(!b)return;if(d.ctrlKey||d.metaKey||d.button===1){window.open(b,"_blank","noopener,noreferrer");return}U(a,"ln-link:navigate",{target:a,href:b,link:w}).defaultPrevented||w.click()}function u(a){const d=a.querySelector("a");if(!d)return;const w=d.getAttribute("href");w&&l(w)}function o(){s()}function c(a){a[t+"Row"]||!a.querySelector("a")||(a[t+"Row"]=!0,a._lnLinkClick=function(w){r(a,w)},a._lnLinkEnter=function(){u(a)},a.addEventListener("click",a._lnLinkClick),a.addEventListener("mouseenter",a._lnLinkEnter),a.addEventListener("mouseleave",o))}function f(a){a[t+"Row"]&&(a._lnLinkClick&&a.removeEventListener("click",a._lnLinkClick),a._lnLinkEnter&&a.removeEventListener("mouseenter",a._lnLinkEnter),a.removeEventListener("mouseleave",o),delete a._lnLinkClick,delete a._lnLinkEnter,delete a[t+"Row"])}function p(a){if(!a[t+"Init"])return;const d=a.tagName;if(d==="TABLE"||d==="TBODY"){const w=d==="TABLE"&&a.querySelector("tbody")||a;for(const b of w.querySelectorAll("tr"))f(b)}else f(a);delete a[t+"Init"]}function h(a){if(a[t+"Init"])return;a[t+"Init"]=!0;const d=a.tagName;if(d==="TABLE"||d==="TBODY"){const w=d==="TABLE"&&a.querySelector("tbody")||a;for(const b of w.querySelectorAll("tr"))c(b)}else c(a)}function A(a){a.hasAttribute&&a.hasAttribute(e)&&h(a);const d=a.querySelectorAll?a.querySelectorAll("["+e+"]"):[];for(const w of d)h(w)}function ye(){m(function(){new MutationObserver(function(d){for(const w of d)if(w.type==="childList"){for(const b of w.addedNodes)if(b.nodeType===1){A(b);const v=b.closest("["+e+"]");if(v)if(b.tagName==="TR")c(b);else{const W=v.tagName;if(W==="TABLE"||W==="TBODY"){const ke=b.querySelectorAll?b.querySelectorAll("tr"):[];for(const Ae of ke)c(Ae)}}}}}).observe(document.body,{childList:!0,subtree:!0}),ce([e],function(d){d.hasAttribute&&d.hasAttribute(e)?A(d):p(d)})},"ln-link")}function q(a){A(a)}window[t]={init:q,destroy:p};function M(){i(),ye(),q(document.body)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M()})()})();
|
|
1
|
+
(function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];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 i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function P(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(n)for(let s=0;s<c.length;s++){const r=c[s];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<c.length;s++){const r=c[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&i[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);i[r.name]=r.value===""||isNaN(u)?null:u}else i[r.name]=r.value}return i}function G(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Q(e,t){const n=e.elements,o=[],i={};for(let c=0;c<n.length;c++){const l=n[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<n.length;c++){const l=n[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const r=t[s];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(r).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=G(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Q,window.lnCore.serializeForm=P,window.lnCore.resolveFormMethod=z);const E={};function Y(e,t){E[e]=t}function X(e){return E[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Y,window.lnCore.getDataMapper=X);function Z(){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 O={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];O[n]=t}function te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return O[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ee,window.lnCore.getLocaleFallback=te,window.lnCore.ensureLocaleObserver=Z);const m={};function ne(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 l=0;l<n.length;l++){const s=n[l],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],r=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const d=r[u].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();t[p]!=null&&s.setAttribute(h,t[p])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],r=s.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const d=r[u].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();p in t&&s.classList.toggle(h,!!t[p])}}return e}function re(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 D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const c=n.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],s=l.attributes;for(let r=0;r<s.length;r++){const u=s[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function oe(e,t,n,o,i,c){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],d=String(o(u));let h=l[d];if(h)i(h,u,r);else{const p=ne(n,c);if(!p||(D(p,u),h=p.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",d),i(h,u,r)}s.appendChild(h)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=q,window.lnCore.lnFill=re,window.lnCore.renderList=oe);function C(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function T(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 i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function F(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function $(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),i=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return A.set(n,i),i}function N(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function R(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ie(e,t,n,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${c}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${c}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${c}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const o in n){const[i,c,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=$(o.values,o.fallback);break;case"integer":i=T;break;case"float":i=N;break;case"boolean":i=I;break;case"list":i=F;break;case"json":i=R;break;case"string":default:i=C;break}i||(i=C),t[o.prop]=[i,n,o.fallback]}return t}function ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=C,window.lnCore.attrInt=T,window.lnCore.attrBool=I,window.lnCore.attrList=F,window.lnCore.attrEnum=$,window.lnCore.attrFloat=N,window.lnCore.attrJson=R);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 c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(c)&&y(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let r=0;r<s.length;r++)y(s[r],l)}}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 ue(e){const t=B(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[n];l?l(t,n,o):c.onAttrChange&&(!c.declared||c.declared.has(n))&&c.onAttrChange(t,n,o)}}function de(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=B(),i=o.byAttr.get(t),c=K()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&L(l)){const s=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<s.length;u++)ie(s[u].spec,r,t,s[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const s=o.byReactive.get(t);s&&M(s,l,t,e.oldValue),o.reactiveWildcard.length&&M(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const r=i[s];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(ae(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function fe(){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{de(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 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 we(e){const t=j();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const i=t[o];if(i.onSubtreeChange&&i.query){const c=i.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&i.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)i.matches&&i.matches(s.query)&&y(i,s);else if(i.matches&&i.matches(s.query)&&y(i,s),i.querySelectorAll){const r=i.querySelectorAll(s.query);for(let u=0;u<r.length;u++)y(r[u],s)}}s.onInit&&s.onInit(i)}}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l],r=s.query;if(r){if(!c)i.matches&&i.matches(r)&&k(i,s);else if(i.matches&&i.matches(r)&&k(i,s),i.querySelectorAll){const u=i.querySelectorAll(r);for(let d=0;d<u.length;d++)k(u[d],s)}}}}}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{we(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function be(e,t){ue({observed:e,handler:t}),fe()}function pe(e){j().push(e),he()}function W(e){return(e||"").replace(/^#/,"")}function v(e){const t=e===void 0?location.hash:e,n={},o=W(t);if(!o)return n;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const s=l.indexOf(":"),r=s>-1?l.slice(0,s):l,u=s>-1?l.slice(s+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function ge(e){if(!e)return null;const t=v();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=v();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(c){const l=n[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");W(location.hash)!==i&&(location.hash=i)}function me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(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 Ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(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 _e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=v,window.lnCore.hashGet=ge,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=Ae,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=_e);function Se(){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=Se),(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 i(a){n&&(n.textContent=a,n.classList.add("ln-link-status--visible"))}function c(){n&&n.classList.remove("ln-link-status--visible")}function l(a,f){if(f.target.closest("a, button, input, select, textarea"))return;const w=a.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(a,"ln-link:navigate",{target:a,href:b,link:w}).defaultPrevented||w.click()}function s(a){const f=a.querySelector("a");if(!f)return;const w=f.getAttribute("href");w&&i(w)}function r(){c()}function u(a){a[t+"Row"]||!a.querySelector("a")||(a[t+"Row"]=!0,a._lnLinkClick=function(w){l(a,w)},a._lnLinkEnter=function(){s(a)},a.addEventListener("click",a._lnLinkClick),a.addEventListener("mouseenter",a._lnLinkEnter),a.addEventListener("mouseleave",r))}function d(a){a[t+"Row"]&&(a._lnLinkClick&&a.removeEventListener("click",a._lnLinkClick),a._lnLinkEnter&&a.removeEventListener("mouseenter",a._lnLinkEnter),a.removeEventListener("mouseleave",r),delete a._lnLinkClick,delete a._lnLinkEnter,delete a[t+"Row"])}function h(a){if(!a[t+"Init"])return;const f=a.tagName;if(f==="TABLE"||f==="TBODY"){const w=f==="TABLE"&&a.querySelector("tbody")||a;for(const b of w.querySelectorAll("tr"))d(b)}else d(a);delete a[t+"Init"]}function p(a){if(a[t+"Init"])return;a[t+"Init"]=!0;const f=a.tagName;if(f==="TABLE"||f==="TBODY"){const w=f==="TABLE"&&a.querySelector("tbody")||a;for(const b of w.querySelectorAll("tr"))u(b)}else u(a)}function _(a){a.hasAttribute&&a.hasAttribute(e)&&p(a);const f=a.querySelectorAll?a.querySelectorAll("["+e+"]"):[];for(const w of f)p(w)}function xe(){g(function(){pe({query:"["+e+"]",onInit:function(a){_(a)},onSubtreeChange:function(a,f){for(let w=0;w<f.addedNodes.length;w++){const b=f.addedNodes[w];if(b.nodeType===1){if(b.tagName==="TR")u(b);else if(b.querySelectorAll){const S=b.querySelectorAll("tr");for(let x=0;x<S.length;x++)u(S[x])}}}}}),be([e],function(a){a.hasAttribute&&a.hasAttribute(e)?_(a):h(a)})},"ln-link")}function V(a){_(a)}window[t]={init:V,destroy:h};function U(){o(),xe(),V(document.body)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",U):U()})()})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatchCancelable, guardBody, observeAttributes } from '../../ln-core';
|
|
1
|
+
import { dispatchCancelable, guardBody, observeAttributes, observeLifecycle } from '../../ln-core';
|
|
2
2
|
|
|
3
3
|
(function () {
|
|
4
4
|
const DOM_SELECTOR = 'data-ln-link';
|
|
@@ -151,26 +151,21 @@ import { dispatchCancelable, guardBody, observeAttributes } from '../../ln-core'
|
|
|
151
151
|
|
|
152
152
|
function _domObserver() {
|
|
153
153
|
guardBody(function () {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
for (const r of rows) {
|
|
170
|
-
_initRow(r);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
154
|
+
observeLifecycle({
|
|
155
|
+
query: '[' + DOM_SELECTOR + ']',
|
|
156
|
+
onInit: function (node) {
|
|
157
|
+
findElements(node);
|
|
158
|
+
},
|
|
159
|
+
onSubtreeChange: function (host, mutation) {
|
|
160
|
+
for (let i = 0; i < mutation.addedNodes.length; i++) {
|
|
161
|
+
const node = mutation.addedNodes[i];
|
|
162
|
+
if (node.nodeType === 1) {
|
|
163
|
+
if (node.tagName === 'TR') {
|
|
164
|
+
_initRow(node);
|
|
165
|
+
} else if (node.querySelectorAll) {
|
|
166
|
+
const rows = node.querySelectorAll('tr');
|
|
167
|
+
for (let r = 0; r < rows.length; r++) {
|
|
168
|
+
_initRow(rows[r]);
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
}
|
|
@@ -178,11 +173,6 @@ import { dispatchCancelable, guardBody, observeAttributes } from '../../ln-core'
|
|
|
178
173
|
}
|
|
179
174
|
});
|
|
180
175
|
|
|
181
|
-
observer.observe(document.body, {
|
|
182
|
-
childList: true,
|
|
183
|
-
subtree: true
|
|
184
|
-
});
|
|
185
|
-
|
|
186
176
|
observeAttributes([DOM_SELECTOR], function (el) {
|
|
187
177
|
if (el.hasAttribute && el.hasAttribute(DOM_SELECTOR)) {
|
|
188
178
|
findElements(el);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function Z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function j(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const 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 d=1;d<e.length;d++)if(e[d]&&e[d].nodeType===1){s=e[d];break}if(!j(s))return}t.apply(console,e)}}function D(t,e,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,s),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function bt(t,e,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const s={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};s[r]=t.name,D(t.dom,e,s)}function z(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){z(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function tt(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}function yt(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function Ct(t,e){const r=!!(e&&e.typed),s=e&&e.exclude,d={},u=t.elements,c={};if(r)for(let h=0;h<u.length;h++){const a=u[h];a.name&&a.type==="checkbox"&&!a.disabled&&(c[a.name]=(c[a.name]||0)+1)}for(let h=0;h<u.length;h++){const a=u[h];if(!(!a.name||a.disabled||a.type==="file"||a.type==="submit"||a.type==="button")&&!(s&&a.matches&&a.matches(s)))if(a.type==="checkbox")r&&c[a.name]===1?d[a.name]=a.checked:(d[a.name]||(d[a.name]=[]),a.checked&&d[a.name].push(a.value));else if(a.type==="radio")a.checked&&(d[a.name]=a.value);else if(a.type==="select-multiple"){d[a.name]=[];for(let _=0;_<a.options.length;_++)a.options[_].selected&&d[a.name].push(a.options[_].value)}else if(r&&a.type==="hidden")d[a.name]=a.value;else if(r&&(a.type==="number"||a.type==="range")){const _=Number(a.value);d[a.name]=a.value===""||isNaN(_)?null:_}else d[a.name]=a.value}return d}function vt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function St(t,e){const r=t.elements,s=[],d={};for(let u=0;u<r.length;u++){const c=r[u];c.name&&c.type==="checkbox"&&(d[c.name]=(d[c.name]||0)+1)}for(let u=0;u<r.length;u++){const c=r[u];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const h=c.getAttribute("data-ln-fill-as")||c.name;if(!h||!(h in e))continue;const a=e[h];if(c.type==="checkbox"){if(Array.isArray(a))c.checked=a.indexOf(c.value)!==-1;else if(d[c.name]>1){const _=String(a).split(",").map(function(w){return w.trim()});c.checked=_.indexOf(c.value)!==-1}else c.checked=vt(a);s.push(c)}else if(c.type==="radio")c.checked=c.value===String(a),s.push(c);else if(c.type==="select-multiple"){if(Array.isArray(a))for(let _=0;_<c.options.length;_++)c.options[_].selected=a.indexOf(c.options[_].value)!==-1;s.push(c)}else c.value=a,c.tagName==="SELECT"&&a!=null&&c.setAttribute("data-ln-value",a),s.push(c)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=St,window.lnCore.serializeForm=Ct,window.lnCore.resolveFormMethod=yt);const et={};function At(t,e){et[t]=e}function Et(t){return et[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=At,window.lnCore.getDataMapper=Et);function nt(t){const e=t?t.closest("[lang]"):null,r=(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 r?r.trim():"en-US"}function Dt(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,z(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const it={};function kt(t,e){if(!t||typeof e!="object")return;const r=t.toLowerCase().split("-")[0];it[r]=e}function xt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return it[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=kt,window.lnCore.getLocaleFallback=xt,window.lnCore.ensureLocaleObserver=Dt);const G={};function lt(t,e){G[t]||(G[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=G[t];return r?r.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function rt(t,e,r){if(t){const s=t.querySelector('[data-ln-template="'+e+'"]');if(s)return s.content.cloneNode(!0)}return lt(e,r)}function P(t,e){if(!t||!e)return t;const r=t.querySelectorAll("[data-ln-field]");for(let c=0;c<r.length;c++){const h=r[c],a=h.getAttribute("data-ln-field");e[a]!=null&&(h.textContent=e[a])}const s=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<s.length;c++){const h=s[c],a=h.getAttribute("data-ln-attr").split(",");for(let _=0;_<a.length;_++){const w=a[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();e[k]!=null&&h.setAttribute(b,e[k])}}const d=t.querySelectorAll("[data-ln-show]");for(let c=0;c<d.length;c++){const h=d[c],a=h.getAttribute("data-ln-show");a in e&&h.classList.toggle("hidden",!e[a])}const u=t.querySelectorAll("[data-ln-class]");for(let c=0;c<u.length;c++){const h=u[c],a=h.getAttribute("data-ln-class").split(",");for(let _=0;_<a.length;_++){const w=a[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();k in e&&h.classList.toggle(b,!!e[k])}}return t}function Lt(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 r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],e??null),r[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)P(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<e.length;r++)e[r].textContent=""}})));function K(t,e){if(!t||!e)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const u=r.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,h){return e[h]!==void 0?e[h]:""}))}const s=function(u,c){return e[c]!==void 0?e[c]:""},d=Array.from(t.querySelectorAll("*"));t.nodeType===1&&d.push(t);for(let u=0;u<d.length;u++){const c=d[u],h=c.attributes;for(let a=0;a<h.length;a++){const _=h[a];_.value.indexOf("{{")!==-1&&c.setAttribute(_.name,_.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function Tt(t,e,r,s,d,u){const c={};for(let a=0;a<t.children.length;a++){const _=t.children[a],w=_.getAttribute("data-ln-render-key");w&&(c[w]=_)}const h=document.createDocumentFragment();for(let a=0;a<e.length;a++){const _=e[a],w=String(s(_));let b=c[w];if(b)d(b,_,a);else{const k=lt(r,u);if(!k||(K(k,_),b=k.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",w),d(b,_,a)}h.appendChild(b)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=P,window.lnCore.lnFill=Lt,window.lnCore.renderList=Tt);function V(t,e,r){const s=t.getAttribute(e);return s===null?r:s}function st(t,e,r){const s=parseInt(t.getAttribute(e),10);return isNaN(s)?r:s}function Q(t,e,r=!1){const s=t.getAttribute(e);if(s===null)return!!r;const d=s.trim().toLowerCase();return!(d==="false"||d==="0")}function ot(t,e){return(t.getAttribute(e)||"").split(",").map(r=>r.trim()).filter(Boolean)}const Y=new Map;function at(t,e){const r=(t?t.join("|"):"")+"::"+e;if(Y.has(r))return Y.get(r);const s=new Set(t||[]),d=function(u,c){const h=u.getAttribute(c);return h!==null&&s.has(h)?h:e};return Y.set(r,d),d}function ct(t,e,r){const s=parseFloat(t.getAttribute(e));return isNaN(s)?r:s}function dt(t,e,r){const s=t.getAttribute(e);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function ut(t,e,r,s,d){if(!t||e===null)return!0;const u=s||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const h=a=>{d?console.warn(a,d):console.warn(a)};if(c==="boolean"){const a=e.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const a=t.values||[];return a.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${r}". Allowed: ${a.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const a=parseInt(e,10);return t.min!==void 0&&a<t.min?(h(`[${u}] Value ${a} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&a>t.max?(h(`[${u}] Value ${a} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(a){return h(`[${u}] Invalid JSON for attribute "${r}": ${a.message}. Fallback: ${t.fallback}.`),!1}return!0}function ht(t,e,r){for(const s in r){const[d,u,c]=r[s];Object.defineProperty(t,s,{get:function(){return d(e,u,c)},enumerable:!0,configurable:!0})}return t}function ft(t){const e={};for(const r in t){const s=t[r];if(!s||!s.prop)continue;let d=s.read;if(!d&&s.type)switch(s.type){case"enum":d=at(s.values,s.fallback);break;case"integer":d=st;break;case"float":d=ct;break;case"boolean":d=Q;break;case"list":d=ot;break;case"json":d=dt;break;case"string":default:d=V;break}d||(d=V),e[s.prop]=[d,r,s.fallback]}return e}function Ft(t){const e={};for(const r in t){const s=t[r];s&&s.effect&&(e[r]=s.effect)}return Object.keys(e).length?e:null}function It(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const r in t.effects)e.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)e.add(r);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ht,window.lnCore.attrSpec=ft,window.lnCore.attrStr=V,window.lnCore.attrInt=st,window.lnCore.attrBool=Q,window.lnCore.attrList=ot,window.lnCore.attrEnum=at,window.lnCore.attrFloat=ct,window.lnCore.attrJson=dt);function J(t,e,r,s){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c=Array.from(t.querySelectorAll(u));t.matches&&t.matches(u)&&c.push(t);for(const h of c)if(!h[r]){window.lnCore._persistSink&&h.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(h,e);try{h[r]=new s(h)}catch(a){console.error("["+r+"] init failed",h,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function qt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ot(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 _t(){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 Rt(t){const e=_t(),r=t.observed||[];for(let s=0;s<r.length;s++){const d=r[s];e.byAttr.has(d)||e.byAttr.set(d,[]),e.byAttr.get(d).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 d=e.byDeclaredAttr.get(s);d.some(u=>u.componentTag===t.componentTag)||d.push({spec:t.attributes[s],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const s=It(t);if(s===null)e.reactiveWildcard.push(t);else for(const d of s)e.byReactive.has(d)||e.byReactive.set(d,[]),e.byReactive.get(d).push(t)}t.persist&&e.persist.push(t)}function pt(t,e,r,s){for(let d=0;d<t.length;d++){const u=t[d];if(!e[u.attribute])continue;const c=u.effects&&u.effects[r];c?c(e,r,s):u.onAttrChange&&(!u.declared||u.declared.has(r))&&u.onAttrChange(e,r,s)}}function Mt(t){const e=t.target,r=t.attributeName;if(t.oldValue===e.getAttribute(r))return;const s=_t(),d=s.byAttr.get(r);if(Z()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(r)&&j(e)){const u=s.byDeclaredAttr.get(r),c=e.getAttribute(r);for(let h=0;h<u.length;h++)ut(u[h].spec,c,r,u[h].componentTag,e)}if(window.lnCore._debugSink&&(r.indexOf("data-ln-")===0||d)&&window.lnCore._debugSink("attr",r,e,{oldValue:t.oldValue,newValue:e.getAttribute(r)}),r.indexOf("data-ln-")===0){const u=s.byReactive.get(r);u&&pt(u,e,r,t.oldValue),s.reactiveWildcard.length&&pt(s.reactiveWildcard,e,r,t.oldValue)}if(d)for(let u=0;u<d.length;u++){const c=d[u];if(c.handler){c.handler(e,r,t.oldValue);continue}c.onAttributeChange&&e[c.attribute]?c.onAttributeChange(e,r):(J(e,c.selector,c.attribute,c.ComponentFn),c.onInit&&c.onInit(e))}}function Ht(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,z(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++)try{Mt(e[r])}catch(s){console.error("[ln-core] mutation handler failed",e[r].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function gt(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Nt(t){const e=gt();if(e.length){if(t.target)for(let r=0;r<e.length;r++){const s=e[r];if(s.onSubtreeChange){const d=s.query,u=t.target.nodeType===1?t.target.matches(d)?t.target:t.target.closest(d):t.target.parentElement?t.target.parentElement.closest(d):null;u&&s.onSubtreeChange(u,t)}}for(let r=0;r<t.addedNodes.length;r++){const s=t.addedNodes[r];if(s.nodeType===1)for(let d=0;d<e.length;d++){const u=e[d];J(s,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(s)}}for(let r=0;r<t.removedNodes.length;r++){const s=t.removedNodes[r];if(s.nodeType===1)for(let d=0;d<e.length;d++){const u=e[d],c=u.query,h=Array.from(s.querySelectorAll(c));s.matches&&s.matches(c)&&h.push(s);for(let a=0;a<h.length;a++){const _=h[a];if(!document.contains(_)){const w=_[u.attribute];if(w&&typeof w.destroy=="function")try{w.destroy()}catch(b){console.error("["+u.attribute+"] destroy failed",_,b)}delete _[u.attribute]}}}}}}function Wt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,z(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++){const s=e[r];if(s.type==="childList")try{Nt(s)}catch(d){console.error("[ln-core] lifecycle handler failed",s.target,d)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function mt(t,e,r,s,d={}){const u=d.extraAttributes||[],c=d.onAttributeChange||null,h=d.onSubtreeChange||null,a=d.onInit||null,_=d.onAttrChange||null,w=d.effects||null,b=d.attributes||null,k=b?Ft(b):w,I=b?new Set(Object.keys(b)):null,q=d.persist||null;function H(n){const i=n||document.body;if(J(i,t,e,r),b&&Z())for(const l in b){const o=b[l],f=Array.from(i.querySelectorAll("["+l+"]"));i.matches&&i.matches("["+l+"]")&&f.push(i);for(let p=0;p<f.length;p++){const g=f[p];j(g)&&ut(o,g.getAttribute(l),l,s,g)}}a&&a(i)}const T=[];if(t.indexOf("[")!==-1){const n=/\[([\w-]+)/g;let i;for(;(i=n.exec(t))!==null;)T.push(i[1])}else T.push(t);Rt({selector:t,attribute:e,componentTag:s,attributes:b,ComponentFn:r,onInit:a,observed:T.concat(u),onAttributeChange:c,onAttrChange:_,effects:k,declared:I,persist:q}),Ht();const F=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,N=d.subtreeQuery||(F?t:"["+t+"]");gt().push({selector:t,attribute:e,ComponentFn:r,onInit:a,onSubtreeChange:h,query:N}),Wt(),window[e]=H,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=mt);function C(){qt()>0?Ot(function(){H(document.body)}):H(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",C):C(),H}function Bt(t){let e=!1;for(let r=0;r<t.length;r++){const s=t[r];if(!(s===""||s==null)&&(e=!0,!Number.isFinite(Number(s))))return"string"}return e?"number":"string"}function Ut(t,e,r,s){if(r==="number"){const c=parseFloat(t),h=parseFloat(e);return(isNaN(c)?0:c)-(isNaN(h)?0:h)}const d=t!=null?String(t):"",u=e!=null?String(e):"";return s?s.compare(d,u):d<u?-1:d>u?1:0}function Vt(t,e){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function zt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,s=t.threshold!=null?t.threshold:25,d=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,a=new Map,_=new Set;let w=0,b=0,k=0,I={sort:null,filters:{},search:""},q=null,H=0,T=0,F=!1;function N(l){a.set(l,++H)}function C(){return!!(I&&(I.search||I.filters&&Object.keys(I.filters).length))}function n(){if(h.size<=e)return;const l=Array.from(h.keys()).sort(function(f,p){return(a.get(f)||0)-(a.get(p)||0)});let o=0;for(;h.size>e&&o<l.length;)h.delete(l[o]),a.delete(l[o]),o++}function i(l,o){_.add(l),u(I,l,o)}return{get:function(l){return h.get(l)},has:function(l){return h.has(l)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return w},get grandTotal(){return b},get queryGen(){return k},get size(){return h.size},ensure:function(l,o){clearTimeout(q),T=l;for(let m=l;m<o;m++)h.has(m)&&N(m);if(w<=0)return;const f=Math.max(0,l-s),p=Math.min(w,o+s),g=Math.floor(f/r),S=Math.floor(Math.max(0,p-1)/r);let E=-1;for(let m=g;m<=S;m++){const y=m*r,x=Math.min(r,w-y);let W=!1;const B=Math.max(y,f),R=Math.min(y+x,p);for(let O=B;O<R;O++)if(!h.has(O)){W=!0;break}if(W&&!_.has(y)){E=y;break}}E!==-1&&(q=setTimeout(function(){i(E,r)},d))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==k)return!1;const o=l.offset||0,f=l.data||[];let p=0;for(let g=0;g<f.length;g++)f[g]!=null&&p++;if(p===0&&(l.provisional||l.filtered>0))return _.delete(o),!1;F&&(h.clear(),a.clear(),F=!1),l.provisional||(b=l.total!=null?l.total:b,w=l.filtered!=null?l.filtered:l.data?l.data.length:w);for(let g=0;g<f.length;g++)f[g]!=null&&(h.set(o+g,f[g]),N(o+g));return _.delete(o),n(),c(),!0},requestInitial:function(l){l&&(I=l),i(0,r)},invalidate:function(l){k++,_.clear(),clearTimeout(q),l&&(I=l),F=!0,i(0,r)},revalidate:function(){k++,_.clear(),clearTimeout(q),F=!0;const l=Math.max(0,Math.floor(T/r)*r);i(l,r)},release:function(l){_.delete(l)},destroy:function(){clearTimeout(q),h.clear(),a.clear(),_.clear()},configure:function(l){l=l||{};let o=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==e){const f=l.windowSize<e;e=l.windowSize,f&&n(),o=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(s=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(d=l.fetchDebounce),o&&c()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(b=l,C()||(w=l),c())}}}function wt(t){return(t||"").replace(/^#/,"")}function X(t){const e=t===void 0?location.hash:t,r={},s=wt(e);if(!s)return r;const d=s.split("&");for(let u=0;u<d.length;u++){const c=d[u];if(!c)continue;const h=c.indexOf(":"),a=h>-1?c.slice(0,h):c,_=h>-1?c.slice(h+1):"";if(a)try{r[a]=decodeURIComponent(_)}catch{r[a]=_}}return r}function $t(t){if(!t)return null;const e=X();return t in e?e[t]:null}function jt(t,e){if(!t)return;const r=X();e==null?delete r[t]:r[t]=String(e);const d=Object.keys(r).map(function(u){const c=r[u];return c===""?u:u+":"+encodeURIComponent(c)}).join("&");wt(location.hash)!==d&&(location.hash=d)}function Gt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Pt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?e?s+"-"+e:s:e||null}function Kt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Qt(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 Yt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Jt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const r=t.slice(0,e),s=t.slice(e+1),d=s?s.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:r,values:d}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=X,window.lnCore.hashGet=$t,window.lnCore.hashSet=jt,window.lnCore.hashLinkClick=Gt,window.lnCore.resolveHashNamespace=Pt,window.lnCore.hashSortEncode=Kt,window.lnCore.hashSortDecode=Qt,window.lnCore.hashFilterEncode=Yt,window.lnCore.hashFilterDecode=Jt);function Xt(){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=Xt),(function(){const t="data-ln-list",e="lnList",r="data-ln-list-empty";if(window[e]!==void 0)return;function a(n,i){if(!n||!n.isDataDriven)return;const l=n.dom.hasAttribute("data-ln-list-window");if(l&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!l&&n._windowed)n._exitWindowedMode();else if(l&&n._windowed){const o=parseInt(i,10);o>0&&n._cache.configure({windowSize:o})}}function _(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>0&&n._cache.configure({pageSize:l})}function w(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.configure({threshold:l})}function b(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.setGrandTotal(l)}const k={"data-ln-list":{prop:"name",type:"string",read:V,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:V,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:Q,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:a,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:_,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:w,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"}},I=ft(k);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(nt(i)).format(n)}catch{return String(n)}}function H(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=getComputedStyle(i).overflowY;if(o==="auto"||o==="scroll")return i;i=i.parentElement}return null}function T(n){const i=n._scrollContainer||H(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 N(n){if(!n)return 0;const i=getComputedStyle(n),l=parseFloat(i.marginTop)||0,o=parseFloat(i.marginBottom)||0;return n.offsetHeight+l+o}function C(n){this.dom=n,ht(this,n,I),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(l){const o=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();i.isDataDriven?(i.currentSearch=o,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=o.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(l){l.preventDefault(),i._onSetSearch(l)},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(l){const o=l.detail||{},f=o.data||[],p=o.total!=null?o.total:f.length;if(!(i._hasInitialSeed&&!i.isLoaded&&f.length===0&&p===0)){if(i._windowed){i._cache.ingest(o)&&!o.provisional&&n.classList.remove("ln-list--loading");return}i._data=f,i._lastTotal=p,i._lastFiltered=o.filtered!=null?o.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(l){const o=l.detail&&l.detail.loading;n.classList.toggle("ln-list--loading",!!o),o&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!i._windowed||!i._cache||i._cache.release(l.detail&&l.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(l){!l.detail||l.detail.field==null||(l.preventDefault(),i.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const o=l.target.closest("[data-ln-item]");if(!o)return;const f=o.getAttribute("data-ln-item-id"),p=o._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:f,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const o=l.target.closest("[data-ln-item-action]");if(!o)return;const f=o.closest("[data-ln-item]");if(!f)return;const p=o.getAttribute("data-ln-item-action"),g=f.getAttribute("data-ln-item-id"),S=f._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:g,action:p,record:S})},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(l){if(l.preventDefault(),!l.detail)return;const o=l.detail.key,f=l.detail.values||[];if(o){if(f.length===0)delete i._filters[o];else{const p=[];for(let g=0;g<f.length;g++)p.push(f[g].toLowerCase());i._filters[o]=p}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(l){if(!l.detail||l.detail.field==null)return;l.preventDefault();const o=l.detail.direction==="none"?null:l.detail.direction;i._sortField=o===null?null:l.detail.field,i._sortDir=o,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:l.detail&&l.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}C.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=N(n[0])||50);for(let i=0;i<n.length;i++){const l=n[i],o=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),f=l.textContent.trim().toLowerCase();let p=null;if(this.isDataDriven){p={},o!=null&&(p.id=o);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const y=E[m],x=y.getAttribute("data-ln-list-field");x&&(p[x]=tt(y))}}const g={},S=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<S.length;E++){const m=S[E],y=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");y&&(g[y]=tt(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const y=m.name.slice(5);y&&(g[y]=m.value)}}this._data.push({html:l.outerHTML,id:o,searchText:f,fields:g,...p||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},C.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const n=this._searchTerm,i=n?n.split(/\s+/).filter(Boolean):[],l=this._filters||{},o=Object.keys(l).length>0;if(i.length===0&&!o?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(f){if(i.length>0&&!i.every(function(g){return f.searchText&&f.searchText.indexOf(g)!==-1}))return!1;if(o)for(const p in l){const g=l[p];if(g&&g.length>0){const S=f.fields&&f.fields[p]!==void 0?f.fields[p]:f[p]!==void 0?f[p]:null,E=S!=null?String(S).toLowerCase():"";if(g.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const f=this._sortField,p=this._sortDir==="desc"?-1:1,g=typeof Intl<"u"?new Intl.Collator(nt(this.dom),{sensitivity:"base"}):null,S=this._filteredData.map(function(m){return m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f]}),E=Bt(S);this._filteredData.sort(function(m,y){const x=m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f],W=y.fields&&y.fields[f]!==void 0?y.fields[f]:y[f];return Ut(x,W,E,g)*p})}}},C.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())}},C.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let o=0;o<n.length;o++){const f=this._buildItem(n[o]);f&&i.appendChild(f)}const l=T(this);this.tbody.replaceChildren(i),F(l),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let o=0;o<i.length;o++)n.push(i[o].html);const l=T(this);this.tbody.innerHTML=n.join(""),F(l),this._selectable&&this._restoreSelection()}},C.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let l=1;if(i&&i!=="none"){const f=i.trim().split(/\s+/).filter(Boolean);f.length>0&&(l=f.length)}const o=parseFloat(n.rowGap);return{columns:l,rowGap:isNaN(o)?0:o}},C.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=N(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=N(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=N(n[0])||50)}},C.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=H(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._resizeHandler=function(){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})},C.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},C.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,l=this._itemHeight;if(!l||!i)return;const o=this._scrollContainer;let f,p;if(o){const L=this.tbody.getBoundingClientRect(),A=o.getBoundingClientRect(),v=o===this.tbody?0:L.top-A.top+o.scrollTop;f=o.scrollTop-v,p=o.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;f=window.scrollY-A,p=window.innerHeight}const g=this._readGridLayout(),S=g.columns,E=g.rowGap,m=l+E,y=Math.ceil(i/S);let x=Math.max(0,Math.floor(f/m)-15);x=Math.min(x,y);const W=Math.ceil(p/m)+30,B=Math.min(x+W,y),R=Math.min(x*S,i),O=Math.min(B*S,i);if(R===this._vStart&&O===this._vEnd)return;this._vStart=R,this._vEnd=O;const U=x*m,M=(y-B)*m;if(this.isDataDriven){const L=document.createDocumentFragment();if(U>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=U+"px",L.appendChild(v)}for(let v=R;v<O;v++){const $=this._buildItem(n[v]);$&&L.appendChild($)}if(M>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=M+"px",L.appendChild(v)}const A=T(this);this.tbody.replaceChildren(L),F(A),this._selectable&&this._updateSelectAll()}else{let L="";U>0&&(L+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${U}px"></${this.isUl?"li":"div"}>`);for(let v=R;v<O;v++)L+=n[v].html;M>0&&(L+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${M}px"></${this.isUl?"li":"div"}>`);const A=T(this);this.tbody.innerHTML=L,F(A),this._selectable&&this._restoreSelection()}},C.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},C.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 l,o;if(i){const A=this.tbody.getBoundingClientRect(),v=i.getBoundingClientRect(),$=i===this.tbody?0:A.top-v.top+i.scrollTop;l=i.scrollTop-$,o=i.clientHeight}else{const v=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-v,o=window.innerHeight}const f=this._readGridLayout(),p=f.columns,g=f.rowGap,S=n+g,E=this._cache.logicalTotal,m=Math.ceil(E/p);let y=Math.max(0,Math.floor(l/S)-15);y=Math.min(y,m);const x=Math.ceil(o/S)+30,W=Math.min(y+x,m),B=Math.min(y*p,E),R=Math.min(W*p,E),O=y*S,U=(m-W)*S,M=document.createDocumentFragment();if(O>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=O+"px",M.appendChild(A)}for(let A=B;A<R;A++)if(this._cache.has(A)){const v=this._buildItem(this._cache.get(A));v&&M.appendChild(v)}else M.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",M.appendChild(A)}const L=T(this);this.tbody.replaceChildren(M),F(L),this._vStart=B,this._vEnd=R,this._cache.ensure(B,R)},C.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,o=this.visibleCount===0&&i>0,f=o?this.name+"-empty-filtered":this.name+"-empty";if(n=rt(this.dom,f,"ln-list"),!n){const p=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(p){const g=o?"search":"initial",S=p.content.querySelector(`[data-ln-empty-when="${g}"]`)||p.content.firstElementChild;S&&(n=document.importNode(S,!0))}}}else{const i=this.dom.querySelector(`template[${r}]`);if(i){const l=i.content.firstElementChild;l&&(n=document.importNode(l,!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})},C.prototype._buildItem=function(n){let i=rt(this.dom,this.name+"-row","ln-list");if(!i){const o=this.dom.querySelector("template[data-ln-item]");o&&(i=document.importNode(o.content,!0))}let l=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(l)K(l,n),P(l,n);else if(n&&n.html){const o=document.createElement(this.isUl?"ul":"div");o.innerHTML=n.html,l=o.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const o in n)if(o!=="html"&&n[o]!=null){const f=document.createElement("span");f.setAttribute("data-ln-field",o),f.textContent=String(n[o]),l.appendChild(f)}}if(l._lnRecord=n,n&&n.id!=null&&(l.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){l.classList.add("ln-item-selected");const o=l.querySelector("[data-ln-item-select]");o&&(o.checked=!0)}return l},C.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const l=n[i].getAttribute("data-ln-item-id"),o=l!=null&&this.selectedIds.has(String(l));n[i].classList.toggle("ln-item-selected",o);const f=n[i].querySelector("[data-ln-item-select]");f&&(f.checked=o)}this._updateSelectAll()},C.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const l=i.target.closest("[data-ln-item-select]");if(!l)return;const o=l.closest("[data-ln-item]");if(!o)return;const f=o.getAttribute("data-ln-item-id");f!=null&&(l.checked?(n.selectedIds.add(String(f)),o.classList.add("ln-item-selected")):(n.selectedIds.delete(String(f)),o.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,l=n.tbody.querySelectorAll("[data-ln-item]");for(let o=0;o<l.length;o++){const f=l[o],p=f.getAttribute("data-ln-item-id"),g=f.querySelector("[data-ln-item-select]");p!=null&&(i?(n.selectedIds.add(String(p)),f.classList.add("ln-item-selected")):(n.selectedIds.delete(String(p)),f.classList.remove("ln-item-selected")),g&&(g.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))},C.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let l=0;l<n.length;l++){const o=n[l].getAttribute("data-ln-item-id");if(o!=null&&!this.selectedIds.has(String(o))){i=!1;break}}this._selectAllCheckbox.checked=i},C.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}bt(this,"ln-list:request-data","list")},C.prototype._enterWindowedMode=function(){const n=this,i=this.dom,l=parseInt(i.getAttribute("data-ln-list-window"),10),o=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=Vt(this._onCacheChange),this._cache=zt({windowSize:l>0?l:1e3,pageSize:o>0?o:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(p,g,S){D(i,"ln-list:request-data",{list:n.name,sort:p.sort,filters:p.filters,search:p.search,offset:g,limit:S,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},C.prototype._kickWindowInitial=function(){if(this._data.length>0){const 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})},C.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},C.prototype._updateFooter=function(){let 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 l=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const o=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=o>0?q(o,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",o===0)}},C.prototype.destroy=function(){this.dom[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])},mt(t,e,C,"ln-list",{attributes:k})})()})();
|
|
1
|
+
(function(){"use strict";function et(){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,r){const s=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,s),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function vt(t,e,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const s={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};s[r]=t.name,D(t.dom,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 nt(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}function St(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function At(t,e){const r=!!(e&&e.typed),s=e&&e.exclude,a={},f=t.elements,c={};if(r)for(let u=0;u<f.length;u++){const o=f[u];o.name&&o.type==="checkbox"&&!o.disabled&&(c[o.name]=(c[o.name]||0)+1)}for(let u=0;u<f.length;u++){const o=f[u];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(s&&o.matches&&o.matches(s)))if(o.type==="checkbox")r&&c[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 _=0;_<o.options.length;_++)o.options[_].selected&&a[o.name].push(o.options[_].value)}else if(r&&o.type==="hidden")a[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const _=Number(o.value);a[o.name]=o.value===""||isNaN(_)?null:_}else a[o.name]=o.value}return a}function Et(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function Dt(t,e){const r=t.elements,s=[],a={};for(let f=0;f<r.length;f++){const c=r[f];c.name&&c.type==="checkbox"&&(a[c.name]=(a[c.name]||0)+1)}for(let f=0;f<r.length;f++){const c=r[f];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const u=c.getAttribute("data-ln-fill-as")||c.name;if(!u||!(u in e))continue;const o=e[u];if(c.type==="checkbox"){if(Array.isArray(o))c.checked=o.indexOf(c.value)!==-1;else if(a[c.name]>1){const _=String(o).split(",").map(function(w){return w.trim()});c.checked=_.indexOf(c.value)!==-1}else c.checked=Et(o);s.push(c)}else if(c.type==="radio")c.checked=c.value===String(o),s.push(c);else if(c.type==="select-multiple"){if(Array.isArray(o))for(let _=0;_<c.options.length;_++)c.options[_].selected=o.indexOf(c.options[_].value)!==-1;s.push(c)}else c.value=o,c.tagName==="SELECT"&&o!=null&&c.setAttribute("data-ln-value",o),s.push(c)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Dt,window.lnCore.serializeForm=At,window.lnCore.resolveFormMethod=St);const it={};function kt(t,e){it[t]=e}function Lt(t){return it[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=kt,window.lnCore.getDataMapper=Lt);function lt(t){const e=t?t.closest("[lang]"):null,r=(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 r?r.trim():"en-US"}function xt(){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 rt={};function Tt(t,e){if(!t||typeof e!="object")return;const r=t.toLowerCase().split("-")[0];rt[r]=e}function Ft(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return rt[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Tt,window.lnCore.getLocaleFallback=Ft,window.lnCore.ensureLocaleObserver=xt);const P={};function st(t,e){P[t]||(P[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=P[t];return r?r.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function ot(t,e,r){if(t){const s=t.querySelector('[data-ln-template="'+e+'"]');if(s)return s.content.cloneNode(!0)}return st(e,r)}function K(t,e){if(!t||!e)return t;const r=t.querySelectorAll("[data-ln-field]");for(let c=0;c<r.length;c++){const u=r[c],o=u.getAttribute("data-ln-field");e[o]!=null&&(u.textContent=e[o])}const s=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<s.length;c++){const u=s[c],o=u.getAttribute("data-ln-attr").split(",");for(let _=0;_<o.length;_++){const w=o[_].trim().split(":");if(w.length!==2)continue;const C=w[0].trim(),k=w[1].trim();e[k]!=null&&u.setAttribute(C,e[k])}}const a=t.querySelectorAll("[data-ln-show]");for(let c=0;c<a.length;c++){const u=a[c],o=u.getAttribute("data-ln-show");o in e&&u.classList.toggle("hidden",!e[o])}const f=t.querySelectorAll("[data-ln-class]");for(let c=0;c<f.length;c++){const u=f[c],o=u.getAttribute("data-ln-class").split(",");for(let _=0;_<o.length;_++){const w=o[_].trim().split(":");if(w.length!==2)continue;const C=w[0].trim(),k=w[1].trim();k in e&&u.classList.toggle(C,!!e[k])}}return t}function It(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<r.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[s],e??null),r[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)K(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<e.length;r++)e[r].textContent=""}})));function Q(t,e){if(!t||!e)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const f=r.currentNode;f.textContent.indexOf("{{")!==-1&&(f.textContent=f.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,u){return e[u]!==void 0?e[u]:""}))}const s=function(f,c){return e[c]!==void 0?e[c]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let f=0;f<a.length;f++){const c=a[f],u=c.attributes;for(let o=0;o<u.length;o++){const _=u[o];_.value.indexOf("{{")!==-1&&c.setAttribute(_.name,_.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function qt(t,e,r,s,a,f){const c={};for(let o=0;o<t.children.length;o++){const _=t.children[o],w=_.getAttribute("data-ln-render-key");w&&(c[w]=_)}const u=document.createDocumentFragment();for(let o=0;o<e.length;o++){const _=e[o],w=String(s(_));let C=c[w];if(C)a(C,_,o);else{const k=st(r,f);if(!k||(Q(k,_),C=k.firstElementChild,!C))continue;C.setAttribute("data-ln-render-key",w),a(C,_,o)}u.appendChild(C)}t.textContent="",t.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=K,window.lnCore.lnFill=It,window.lnCore.renderList=qt);function V(t,e,r){const s=t.getAttribute(e);return s===null?r:s}function at(t,e,r){const s=parseInt(t.getAttribute(e),10);return isNaN(s)?r:s}function Y(t,e,r=!1){const s=t.getAttribute(e);if(s===null)return!!r;const a=s.trim().toLowerCase();return!(a==="false"||a==="0")}function ct(t,e){return(t.getAttribute(e)||"").split(",").map(r=>r.trim()).filter(Boolean)}const J=new Map;function dt(t,e){const r=(t?t.join("|"):"")+"::"+e;if(J.has(r))return J.get(r);const s=new Set(t||[]),a=function(f,c){const u=f.getAttribute(c);return u!==null&&s.has(u)?u:e};return J.set(r,a),a}function ut(t,e,r){const s=parseFloat(t.getAttribute(e));return isNaN(s)?r:s}function ht(t,e,r){const s=t.getAttribute(e);if(!s)return r;try{return JSON.parse(s)}catch{return r}}function ft(t,e,r,s,a){if(!t||e===null)return!0;const f=s||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const u=o=>{a?console.warn(o,a):console.warn(o)};if(c==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(u(`[${f}] Invalid value "${e}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const o=t.values||[];return o.includes(e)?!0:(u(`[${f}] Invalid value "${e}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return u(`[${f}] Invalid integer "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(u(`[${f}] Value ${o} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(u(`[${f}] Value ${o} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(u(`[${f}] Invalid float "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(o){return u(`[${f}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function _t(t,e,r){for(const s in r){const[a,f,c]=r[s];Object.defineProperty(t,s,{get:function(){return a(e,f,c)},enumerable:!0,configurable:!0})}return t}function pt(t){const e={};for(const r in t){const s=t[r];if(!s||!s.prop)continue;let a=s.read;if(!a&&s.type)switch(s.type){case"enum":a=dt(s.values,s.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=V;break}a||(a=V),e[s.prop]=[a,r,s.fallback]}return e}function Ot(t){const e={};for(const r in t){const s=t[r];s&&s.effect&&(e[r]=s.effect)}return Object.keys(e).length?e:null}function Rt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const r in t.effects)e.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)e.add(r);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_t,window.lnCore.attrSpec=pt,window.lnCore.attrStr=V,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 z(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(r){console.error("["+e.attribute+"] init failed",t,r)}}}function gt(t,e,r,s){if(t.nodeType!==1)return;const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c={selector:e,attribute:r,ComponentFn:s};if(t.matches&&t.matches(f)&&z(t,c),t.querySelectorAll){const u=t.querySelectorAll(f);for(let o=0;o<u.length;o++)z(u[o],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Mt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ht(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 Nt(t){const e=mt(),r=t.observed||[];for(let s=0;s<r.length;s++){const a=r[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(f=>f.componentTag===t.componentTag)||a.push({spec:t.attributes[s],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const s=Rt(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 wt(t,e,r,s){for(let a=0;a<t.length;a++){const f=t[a];if(!e[f.attribute])continue;const c=f.effects&&f.effects[r];c?c(e,r,s):f.onAttrChange&&(!f.declared||f.declared.has(r))&&f.onAttrChange(e,r,s)}}function Wt(t){const e=t.attributeName,r=e.indexOf("data-ln-")===0,s=mt(),a=s.byAttr.get(e),f=et()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(e);if(!r&&!a&&!f)return;const c=t.target;if(t.oldValue!==c.getAttribute(e)){if(f&&G(c)){const u=s.byDeclaredAttr.get(e),o=c.getAttribute(e);for(let _=0;_<u.length;_++)ft(u[_].spec,o,e,u[_].componentTag,c)}if(window.lnCore._debugSink&&(r||a)&&window.lnCore._debugSink("attr",e,c,{oldValue:t.oldValue,newValue:c.getAttribute(e)}),r){const u=s.byReactive.get(e);u&&wt(u,c,e,t.oldValue),s.reactiveWildcard.length&&wt(s.reactiveWildcard,c,e,t.oldValue)}if(a)for(let u=0;u<a.length;u++){const o=a[u];if(o.handler){o.handler(c,e,t.oldValue);continue}o.onAttributeChange&&c[o.attribute]?o.onAttributeChange(c,e):(gt(c,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(c))}}}function Bt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++)try{Wt(e[r])}catch(s){console.error("[ln-core] mutation handler failed",e[r].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(t,e){if(!document.contains(t))if(e.attribute){const r=t[e.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(s){console.error("["+e.attribute+"] destroy failed",t,s)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ut(t){const e=X();if(!e.length)return;const r=t.target;if(r){const s=r.nodeType===1?r:r.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}if(t.target)for(let s=0;s<e.length;s++){const a=e[s];if(a.onSubtreeChange&&a.query){const f=a.query,c=t.target.nodeType===1?t.target.matches&&t.target.matches(f)?t.target:t.target.closest?t.target.closest(f):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(f):null;c&&a.onSubtreeChange(c,t)}}for(let s=0;s<t.addedNodes.length;s++){const a=t.addedNodes[s];if(a.nodeType===1){const f=!!(a.firstElementChild||a.children&&a.children.length);for(let c=0;c<e.length;c++){const u=e[c];if(u.selector&&u.attribute&&u.ComponentFn){if(!f)a.matches&&a.matches(u.query)&&z(a,u);else if(a.matches&&a.matches(u.query)&&z(a,u),a.querySelectorAll){const o=a.querySelectorAll(u.query);for(let _=0;_<o.length;_++)z(o[_],u)}}u.onInit&&u.onInit(a)}}}for(let s=0;s<t.removedNodes.length;s++){const a=t.removedNodes[s];if(a.nodeType===1){const f=!!(a.firstElementChild||a.children&&a.children.length);for(let c=0;c<e.length;c++){const u=e[c],o=u.query;if(o){if(!f)a.matches&&a.matches(o)&&Z(a,u);else if(a.matches&&a.matches(o)&&Z(a,u),a.querySelectorAll){const _=a.querySelectorAll(o);for(let w=0;w<_.length;w++)Z(_[w],u)}}}}}}function bt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++){const s=e[r];if(s.type==="childList")try{Ut(s)}catch(a){console.error("[ln-core] lifecycle handler failed",s.target,a)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Vt(t){X().push(t),bt()}function yt(t,e,r,s,a={}){const f=a.extraAttributes||[],c=a.onAttributeChange||null,u=a.onSubtreeChange||null,o=a.onInit||null,_=a.onAttrChange||null,w=a.effects||null,C=a.attributes||null,k=C?Ot(C):w,I=C?new Set(Object.keys(C)):null,q=a.persist||null;function H(n){const i=n||document.body;if(gt(i,t,e,r),C&&et())for(const l in C){const d=C[l],h=Array.from(i.querySelectorAll("["+l+"]"));i.matches&&i.matches("["+l+"]")&&h.push(i);for(let p=0;p<h.length;p++){const g=h[p];G(g)&&ft(d,g.getAttribute(l),l,s,g)}}o&&o(i)}const T=[];if(t.indexOf("[")!==-1){const n=/\[([\w-]+)/g;let i;for(;(i=n.exec(t))!==null;)T.push(i[1])}else T.push(t);Nt({selector:t,attribute:e,componentTag:s,attributes:C,ComponentFn:r,onInit:o,observed:T.concat(f),onAttributeChange:c,onAttrChange:_,effects:k,declared:I,persist:q}),Bt();const F=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,N=a.subtreeQuery||(F?t:"["+t+"]");X().push({selector:t,attribute:e,ComponentFn:r,onInit:o,onSubtreeChange:u,query:N}),bt(),window[e]=H,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=yt,window.lnCore.observeLifecycle=Vt);function y(){Mt()>0?Ht(function(){H(document.body)}):H(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),H}function zt(t){let e=!1;for(let r=0;r<t.length;r++){const s=t[r];if(!(s===""||s==null)&&(e=!0,!Number.isFinite(Number(s))))return"string"}return e?"number":"string"}function $t(t,e,r,s){if(r==="number"){const c=parseFloat(t),u=parseFloat(e);return(isNaN(c)?0:c)-(isNaN(u)?0:u)}const a=t!=null?String(t):"",f=e!=null?String(e):"";return s?s.compare(a,f):a<f?-1:a>f?1:0}function jt(t,e){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function Gt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,s=t.threshold!=null?t.threshold:25,a=t.fetchDebounce!=null?t.fetchDebounce:120;const f=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},u=new Map,o=new Map,_=new Set;let w=0,C=0,k=0,I={sort:null,filters:{},search:""},q=null,H=0,T=0,F=!1;function N(l){o.set(l,++H)}function y(){return!!(I&&(I.search||I.filters&&Object.keys(I.filters).length))}function n(){if(u.size<=e)return;const l=Array.from(u.keys()).sort(function(h,p){return(o.get(h)||0)-(o.get(p)||0)});let d=0;for(;u.size>e&&d<l.length;)u.delete(l[d]),o.delete(l[d]),d++}function i(l,d){_.add(l),f(I,l,d)}return{get:function(l){return u.get(l)},has:function(l){return u.has(l)},peek:function(){return u.size?u.values().next().value:void 0},get logicalTotal(){return w},get grandTotal(){return C},get queryGen(){return k},get size(){return u.size},ensure:function(l,d){clearTimeout(q),T=l;for(let m=l;m<d;m++)u.has(m)&&N(m);if(w<=0)return;const h=Math.max(0,l-s),p=Math.min(w,d+s),g=Math.floor(h/r),S=Math.floor(Math.max(0,p-1)/r);let E=-1;for(let m=g;m<=S;m++){const b=m*r,L=Math.min(r,w-b);let W=!1;const B=Math.max(b,h),R=Math.min(b+L,p);for(let O=B;O<R;O++)if(!u.has(O)){W=!0;break}if(W&&!_.has(b)){E=b;break}}E!==-1&&(q=setTimeout(function(){i(E,r)},a))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==k)return!1;const d=l.offset||0,h=l.data||[];let p=0;for(let g=0;g<h.length;g++)h[g]!=null&&p++;if(p===0&&(l.provisional||l.filtered>0))return _.delete(d),!1;F&&(u.clear(),o.clear(),F=!1),l.provisional||(C=l.total!=null?l.total:C,w=l.filtered!=null?l.filtered:l.data?l.data.length:w);for(let g=0;g<h.length;g++)h[g]!=null&&(u.set(d+g,h[g]),N(d+g));return _.delete(d),n(),c(),!0},requestInitial:function(l){l&&(I=l),i(0,r)},invalidate:function(l){k++,_.clear(),clearTimeout(q),l&&(I=l),F=!0,i(0,r)},revalidate:function(){k++,_.clear(),clearTimeout(q),F=!0;const l=Math.max(0,Math.floor(T/r)*r);i(l,r)},release:function(l){_.delete(l)},destroy:function(){clearTimeout(q),u.clear(),o.clear(),_.clear()},configure:function(l){l=l||{};let d=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==e){const h=l.windowSize<e;e=l.windowSize,h&&n(),d=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(s=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(a=l.fetchDebounce),d&&c()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(C=l,y()||(w=l),c())}}}function Ct(t){return(t||"").replace(/^#/,"")}function tt(t){const e=t===void 0?location.hash:t,r={},s=Ct(e);if(!s)return r;const a=s.split("&");for(let f=0;f<a.length;f++){const c=a[f];if(!c)continue;const u=c.indexOf(":"),o=u>-1?c.slice(0,u):c,_=u>-1?c.slice(u+1):"";if(o)try{r[o]=decodeURIComponent(_)}catch{r[o]=_}}return r}function Pt(t){if(!t)return null;const e=tt();return t in e?e[t]:null}function Kt(t,e){if(!t)return;const r=tt();e==null?delete r[t]:r[t]=String(e);const a=Object.keys(r).map(function(f){const c=r[f];return c===""?f:f+":"+encodeURIComponent(c)}).join("&");Ct(location.hash)!==a&&(location.hash=a)}function Qt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Yt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const s=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return s?e?s+"-"+e:s:e||null}function Jt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Xt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Zt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function te(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const r=t.slice(0,e),s=t.slice(e+1),a=s?s.split(",").map(function(f){try{return decodeURIComponent(f)}catch{return f}}).filter(Boolean):[];return{key:r,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=tt,window.lnCore.hashGet=Pt,window.lnCore.hashSet=Kt,window.lnCore.hashLinkClick=Qt,window.lnCore.resolveHashNamespace=Yt,window.lnCore.hashSortEncode=Jt,window.lnCore.hashSortDecode=Xt,window.lnCore.hashFilterEncode=Zt,window.lnCore.hashFilterDecode=te);function ee(){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=ee),(function(){const t="data-ln-list",e="lnList",r="data-ln-list-empty";if(window[e]!==void 0)return;function o(n,i){if(!n||!n.isDataDriven)return;const l=n.dom.hasAttribute("data-ln-list-window");if(l&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!l&&n._windowed)n._exitWindowedMode();else if(l&&n._windowed){const d=parseInt(i,10);d>0&&n._cache.configure({windowSize:d})}}function _(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>0&&n._cache.configure({pageSize:l})}function w(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.configure({threshold:l})}function C(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.setGrandTotal(l)}const k={"data-ln-list":{prop:"name",type:"string",read:V,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:V,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:_,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:w,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:C,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"}},I=pt(k);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(lt(i)).format(n)}catch{return String(n)}}function H(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const d=getComputedStyle(i).overflowY;if(d==="auto"||d==="scroll")return i;i=i.parentElement}return null}function T(n){const i=n._scrollContainer||H(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 N(n){if(!n)return 0;const i=getComputedStyle(n),l=parseFloat(i.marginTop)||0,d=parseFloat(i.marginBottom)||0;return n.offsetHeight+l+d}function y(n){this.dom=n,_t(this,n,I),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(l){const d=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();i.isDataDriven?(i.currentSearch=d,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=d.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(l){l.preventDefault(),i._onSetSearch(l)},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(l){const d=l.detail||{},h=d.data||[],p=d.total!=null?d.total:h.length;if(!(i._hasInitialSeed&&!i.isLoaded&&h.length===0&&p===0)){if(i._windowed){i._cache.ingest(d)&&!d.provisional&&n.classList.remove("ln-list--loading");return}i._data=h,i._lastTotal=p,i._lastFiltered=d.filtered!=null?d.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-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(l){const d=l.detail&&l.detail.loading;n.classList.toggle("ln-list--loading",!!d),d&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!i._windowed||!i._cache||i._cache.release(l.detail&&l.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(l){!l.detail||l.detail.field==null||(l.preventDefault(),i.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const d=l.target.closest("[data-ln-item]");if(!d)return;const h=d.getAttribute("data-ln-item-id"),p=d._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:h,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const d=l.target.closest("[data-ln-item-action]");if(!d)return;const h=d.closest("[data-ln-item]");if(!h)return;const p=d.getAttribute("data-ln-item-action"),g=h.getAttribute("data-ln-item-id"),S=h._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:g,action:p,record:S})},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(l){if(l.preventDefault(),!l.detail)return;const d=l.detail.key,h=l.detail.values||[];if(d){if(h.length===0)delete i._filters[d];else{const p=[];for(let g=0;g<h.length;g++)p.push(h[g].toLowerCase());i._filters[d]=p}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(l){if(!l.detail||l.detail.field==null)return;l.preventDefault();const d=l.detail.direction==="none"?null:l.detail.direction;i._sortField=d===null?null:l.detail.field,i._sortDir=d,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:l.detail&&l.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}y.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=N(n[0])||50);for(let i=0;i<n.length;i++){const l=n[i],d=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),h=l.textContent.trim().toLowerCase();let p=null;if(this.isDataDriven){p={},d!=null&&(p.id=d);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const b=E[m],L=b.getAttribute("data-ln-list-field");L&&(p[L]=nt(b))}}const g={},S=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<S.length;E++){const m=S[E],b=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");b&&(g[b]=nt(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const b=m.name.slice(5);b&&(g[b]=m.value)}}this._data.push({html:l.outerHTML,id:d,searchText:h,fields:g,...p||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},y.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):[],l=this._filters||{},d=Object.keys(l).length>0;if(i.length===0&&!d?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(h){if(i.length>0&&!i.every(function(g){return h.searchText&&h.searchText.indexOf(g)!==-1}))return!1;if(d)for(const p in l){const g=l[p];if(g&&g.length>0){const S=h.fields&&h.fields[p]!==void 0?h.fields[p]:h[p]!==void 0?h[p]:null,E=S!=null?String(S).toLowerCase():"";if(g.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const h=this._sortField,p=this._sortDir==="desc"?-1:1,g=typeof Intl<"u"?new Intl.Collator(lt(this.dom),{sensitivity:"base"}):null,S=this._filteredData.map(function(m){return m.fields&&m.fields[h]!==void 0?m.fields[h]:m[h]}),E=zt(S);this._filteredData.sort(function(m,b){const L=m.fields&&m.fields[h]!==void 0?m.fields[h]:m[h],W=b.fields&&b.fields[h]!==void 0?b.fields[h]:b[h];return $t(L,W,E,g)*p})}}},y.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())}},y.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let d=0;d<n.length;d++){const h=this._buildItem(n[d]);h&&i.appendChild(h)}const l=T(this);this.tbody.replaceChildren(i),F(l),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let d=0;d<i.length;d++)n.push(i[d].html);const l=T(this);this.tbody.innerHTML=n.join(""),F(l),this._selectable&&this._restoreSelection()}},y.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let l=1;if(i&&i!=="none"){const h=i.trim().split(/\s+/).filter(Boolean);h.length>0&&(l=h.length)}const d=parseFloat(n.rowGap);return{columns:l,rowGap:isNaN(d)?0:d}},y.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=N(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=N(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=N(n[0])||50)}},y.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=H(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._resizeHandler=function(){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})},y.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},y.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,l=this._itemHeight;if(!l||!i)return;const d=this._scrollContainer;let h,p;if(d){const x=this.tbody.getBoundingClientRect(),A=d.getBoundingClientRect(),v=d===this.tbody?0:x.top-A.top+d.scrollTop;h=d.scrollTop-v,p=d.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;h=window.scrollY-A,p=window.innerHeight}const g=this._readGridLayout(),S=g.columns,E=g.rowGap,m=l+E,b=Math.ceil(i/S);let L=Math.max(0,Math.floor(h/m)-15);L=Math.min(L,b);const W=Math.ceil(p/m)+30,B=Math.min(L+W,b),R=Math.min(L*S,i),O=Math.min(B*S,i);if(R===this._vStart&&O===this._vEnd)return;this._vStart=R,this._vEnd=O;const U=L*m,M=(b-B)*m;if(this.isDataDriven){const x=document.createDocumentFragment();if(U>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=U+"px",x.appendChild(v)}for(let v=R;v<O;v++){const j=this._buildItem(n[v]);j&&x.appendChild(j)}if(M>0){const v=document.createElement(this.isUl?"li":"div");v.className="ln-list__spacer",v.setAttribute("aria-hidden","true"),v.style.height=M+"px",x.appendChild(v)}const A=T(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 v=R;v<O;v++)x+=n[v].html;M>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${M}px"></${this.isUl?"li":"div"}>`);const A=T(this);this.tbody.innerHTML=x,F(A),this._selectable&&this._restoreSelection()}},y.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},y.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 l,d;if(i){const A=this.tbody.getBoundingClientRect(),v=i.getBoundingClientRect(),j=i===this.tbody?0:A.top-v.top+i.scrollTop;l=i.scrollTop-j,d=i.clientHeight}else{const v=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-v,d=window.innerHeight}const h=this._readGridLayout(),p=h.columns,g=h.rowGap,S=n+g,E=this._cache.logicalTotal,m=Math.ceil(E/p);let b=Math.max(0,Math.floor(l/S)-15);b=Math.min(b,m);const L=Math.ceil(d/S)+30,W=Math.min(b+L,m),B=Math.min(b*p,E),R=Math.min(W*p,E),O=b*S,U=(m-W)*S,M=document.createDocumentFragment();if(O>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=O+"px",M.appendChild(A)}for(let A=B;A<R;A++)if(this._cache.has(A)){const v=this._buildItem(this._cache.get(A));v&&M.appendChild(v)}else M.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",M.appendChild(A)}const x=T(this);this.tbody.replaceChildren(M),F(x),this._vStart=B,this._vEnd=R,this._cache.ensure(B,R)},y.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&i>0,h=d?this.name+"-empty-filtered":this.name+"-empty";if(n=ot(this.dom,h,"ln-list"),!n){const p=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(p){const g=d?"search":"initial",S=p.content.querySelector(`[data-ln-empty-when="${g}"]`)||p.content.firstElementChild;S&&(n=document.importNode(S,!0))}}}else{const i=this.dom.querySelector(`template[${r}]`);if(i){const l=i.content.firstElementChild;l&&(n=document.importNode(l,!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})},y.prototype._buildItem=function(n){let i=ot(this.dom,this.name+"-row","ln-list");if(!i){const d=this.dom.querySelector("template[data-ln-item]");d&&(i=document.importNode(d.content,!0))}let l=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(l)Q(l,n),K(l,n);else if(n&&n.html){const d=document.createElement(this.isUl?"ul":"div");d.innerHTML=n.html,l=d.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const d in n)if(d!=="html"&&n[d]!=null){const h=document.createElement("span");h.setAttribute("data-ln-field",d),h.textContent=String(n[d]),l.appendChild(h)}}if(l._lnRecord=n,n&&n.id!=null&&(l.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){l.classList.add("ln-item-selected");const d=l.querySelector("[data-ln-item-select]");d&&(d.checked=!0)}return l},y.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const l=n[i].getAttribute("data-ln-item-id"),d=l!=null&&this.selectedIds.has(String(l));n[i].classList.toggle("ln-item-selected",d);const h=n[i].querySelector("[data-ln-item-select]");h&&(h.checked=d)}this._updateSelectAll()},y.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const l=i.target.closest("[data-ln-item-select]");if(!l)return;const d=l.closest("[data-ln-item]");if(!d)return;const h=d.getAttribute("data-ln-item-id");h!=null&&(l.checked?(n.selectedIds.add(String(h)),d.classList.add("ln-item-selected")):(n.selectedIds.delete(String(h)),d.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,l=n.tbody.querySelectorAll("[data-ln-item]");for(let d=0;d<l.length;d++){const h=l[d],p=h.getAttribute("data-ln-item-id"),g=h.querySelector("[data-ln-item-select]");p!=null&&(i?(n.selectedIds.add(String(p)),h.classList.add("ln-item-selected")):(n.selectedIds.delete(String(p)),h.classList.remove("ln-item-selected")),g&&(g.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))},y.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let l=0;l<n.length;l++){const d=n[l].getAttribute("data-ln-item-id");if(d!=null&&!this.selectedIds.has(String(d))){i=!1;break}}this._selectAllCheckbox.checked=i},y.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}vt(this,"ln-list:request-data","list")},y.prototype._enterWindowedMode=function(){const n=this,i=this.dom,l=parseInt(i.getAttribute("data-ln-list-window"),10),d=parseInt(i.getAttribute("data-ln-list-window-page"),10),h=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=jt(this._onCacheChange),this._cache=Gt({windowSize:l>0?l:1e3,pageSize:d>0?d:200,threshold:h>=0?h:25,fetchDebounce:120,requestPage:function(p,g,S){D(i,"ln-list:request-data",{list:n.name,sort:p.sort,filters:p.filters,search:p.search,offset:g,limit:S,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},y.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})},y.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()},y.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 l=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const d=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=d>0?q(d,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",d===0)}},y.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])},yt(t,e,y,"ln-list",{attributes:k})})()})();
|