@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.
Files changed (64) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-ajax/src/ln-ajax.js +15 -26
  4. package/components/ln-api-connector/ln-api-connector.js +1 -1
  5. package/components/ln-api-queue/ln-api-queue.js +1 -1
  6. package/components/ln-autoresize/ln-autoresize.js +1 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/helpers.js +1 -1
  12. package/components/ln-core/index.js +1 -1
  13. package/components/ln-core/lifecycle.js +106 -40
  14. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  15. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  16. package/components/ln-data-store/ln-data-store.js +1 -1
  17. package/components/ln-date/ln-date.js +1 -1
  18. package/components/ln-debug/ln-debug.js +1 -1
  19. package/components/ln-dropdown/ln-dropdown.js +1 -1
  20. package/components/ln-editor/ln-editor.js +1 -1
  21. package/components/ln-editor/src/ln-editor.js +45 -12
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-external-links/src/ln-external-links.js +9 -21
  24. package/components/ln-filter/ln-filter.js +1 -1
  25. package/components/ln-form/ln-form.js +1 -1
  26. package/components/ln-icon/ln-icon.js +1 -1
  27. package/components/ln-icon/src/ln-icon.js +14 -16
  28. package/components/ln-include/ln-include.js +1 -1
  29. package/components/ln-key/ln-key.js +1 -1
  30. package/components/ln-link/ln-link.js +1 -1
  31. package/components/ln-link/src/ln-link.js +16 -26
  32. package/components/ln-list/ln-list.js +1 -1
  33. package/components/ln-modal/ln-modal.js +1 -1
  34. package/components/ln-nav/ln-nav.js +1 -1
  35. package/components/ln-nav/src/ln-nav.js +5 -4
  36. package/components/ln-number/ln-number.js +1 -1
  37. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  38. package/components/ln-options/ln-options.js +1 -1
  39. package/components/ln-persist/ln-persist.js +1 -1
  40. package/components/ln-picklist/ln-picklist.js +1 -1
  41. package/components/ln-popover/ln-popover.js +1 -1
  42. package/components/ln-progress/ln-progress.js +1 -1
  43. package/components/ln-progress/src/ln-progress.js +9 -21
  44. package/components/ln-router/ln-router.js +1 -1
  45. package/components/ln-scroll/ln-scroll.js +1 -1
  46. package/components/ln-search/ln-search.js +1 -1
  47. package/components/ln-slug/ln-slug.js +1 -1
  48. package/components/ln-sort/ln-sort.js +1 -1
  49. package/components/ln-sortable/ln-sortable.js +1 -1
  50. package/components/ln-stat/ln-stat.js +1 -1
  51. package/components/ln-table/ln-table.js +1 -1
  52. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  53. package/components/ln-tabs/ln-tabs.js +1 -1
  54. package/components/ln-time/ln-time.js +1 -1
  55. package/components/ln-toast/ln-toast.js +1 -1
  56. package/components/ln-toggle/ln-toggle.js +1 -1
  57. package/components/ln-tooltip/ln-tooltip.js +1 -1
  58. package/components/ln-translations/ln-translations.js +1 -1
  59. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  60. package/components/ln-upload/ln-upload.js +1 -1
  61. package/components/ln-validate/ln-validate.js +1 -1
  62. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  63. package/package.json +1 -1
  64. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function E(){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(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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!g(r))return}e.apply(console,t)}}function F(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function K(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&i[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 z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function G(e,t){const n=e.elements,r=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const o=t[a];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(o).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=z(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<i.options.length;c++)i.options[c].selected=o.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=G,window.lnCore.serializeForm=K,window.lnCore.resolveFormMethod=J);const L={};function X(e,t){L[e]=t}function Y(e){return L[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=X,window.lnCore.getDataMapper=Y);function Z(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=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 N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}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 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)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function oe(e,t,n,r,l,s){const i={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=i[u];if(d)l(d,c,o);else{const f=ne(n,s);if(!f||($(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=N,window.lnCore.lnFill=re,window.lnCore.renderList=oe);function C(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function D(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function T(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return y.set(n,l),l}function R(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function B(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function j(e,t,n,r,l){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 a=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e,t,n){for(const r in n){const[l,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function le(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=q(r.values,r.fallback);break;case"integer":l=D;break;case"float":l=R;break;case"boolean":l=T;break;case"list":l=M;break;case"json":l=B;break;case"string":default:l=C;break}l||(l=C),t[r.prop]=[l,n,r.fallback]}return t}function se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ae(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=ie,window.lnCore.attrSpec=le,window.lnCore.attrStr=C,window.lnCore.attrInt=D,window.lnCore.attrBool=T,window.lnCore.attrList=M,window.lnCore.attrEnum=q,window.lnCore.attrFloat=R,window.lnCore.attrJson=B);function A(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ue(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 V(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function de(e){const t=V(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];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 r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ae(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function W(e,t,n,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=V(),l=r.byAttr.get(n);if(E()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&g(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)j(s[a].spec,i,n,s[a].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=r.byReactive.get(n);s&&W(s,t,n,e.oldValue),r.reactiveWildcard.length&&W(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const i=l[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(A(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function U(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function pe(e){const t=U();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):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 l=0;l<t.length;l++){const s=t[l];A(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function he(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{pe(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function H(e,t,n,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,o=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?se(d):u,Oe=d?new Set(Object.keys(d)):null,Ee=l.persist||null;function b(_){const w=_||document.body;if(A(w,e,t,n),d&&E())for(const p in d){const Ie=d[p],k=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&k.push(w);for(let S=0;S<k.length;S++){const O=k[S];g(O)&&j(Ie,O.getAttribute(p),p,r,O)}}o&&o(w)}const v=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let w;for(;(w=_.exec(e))!==null;)v.push(w[1])}else v.push(e);de({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:v.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:Oe,persist:Ee}),we();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Le=l.subtreeQuery||(Fe?e:"["+e+"]");U().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le}),he(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=H);function Q(){ce()>0?ue(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Q):Q(),b}function P(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=P(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),o=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function be(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");P(location.hash)!==l&&(location.hash=l)}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 r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.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=x,window.lnCore.hashGet=be,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=ve);function _e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=_e);function ke(e,t=100,n=0){const r=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(n))||0,i=Math.max(s,Math.min(r,l)),a=l-s;let o=0;return a>0&&(o=(i-s)/a*100),o=Math.max(0,Math.min(100,o)),{value:r,min:s,max:l,clampedValue:i,percentage:o}}function Se(e,t,n=100){if(t!=null&&t!==""){const r=parseFloat(String(t));if(!isNaN(r)&&r>0)return r}if(e!=null&&e!==""){const r=parseFloat(String(e));if(!isNaN(r)&&r>0)return r}return n}(function(){const e="[data-ln-progress]",t="lnProgress";if(window[t]!==void 0)return;function n(a){const o=a[t];o&&i.call(o)}const r={"data-ln-progress":{type:"float",fallback:0,min:0,effect:n,description:"Current progress value"},"data-ln-progress-max":{type:"float",fallback:100,min:0,effect:n,description:"Maximum progress scale value"}};function l(a){return this.dom=a,this._parentObserver=null,i.call(this),s.call(this),this}l.prototype.destroy=function(){this.dom[t]&&(this._parentObserver&&this._parentObserver.disconnect(),delete this.dom[t])};function s(){const a=this,o=this.dom.parentElement;if(!o)return;const c=new MutationObserver(function(u){for(const d of u)d.attributeName==="data-ln-progress-max"&&i.call(a)});c.observe(o,{attributes:!0,attributeFilter:["data-ln-progress-max"]}),this._parentObserver=c}function i(){const a=this.dom.getAttribute("data-ln-progress"),o=this.dom.parentElement,c=o?o.getAttribute("data-ln-progress-max"):null,u=this.dom.getAttribute("data-ln-progress-max"),d=Se(u,c,100),f=ke(a,d);this.dom.style.width=f.percentage+"%",this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(f.min)),this.dom.setAttribute("aria-valuemax",String(f.max)),this.dom.setAttribute("aria-valuenow",String(f.clampedValue)),F(this.dom,"ln-progress:change",{target:this.dom,value:f.value,max:f.max,percentage:f.percentage})}H(e,t,l,"ln-progress",{attributes:r})})()})();
1
+ (function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function m(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!m(r))return}e.apply(console,t)}}function F(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,l={};if(i)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")i&&l[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&o[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")o[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);o[n.name]=n.value===""||isNaN(c)?null:c}else o[n.name]=n.value}return o}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const i=e.elements,r=[],o={};for(let a=0;a<i.length;a++){const l=i[a];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let a=0;a<i.length;a++){const l=i[a];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 n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(o[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ee(n);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].value)!==-1;r.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const q={};function ne(e,t){q[e]=t}function re(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function ie(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];I[i]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const C={};function se(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=C[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function 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 i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function N(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const l=o[a],s=l.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ce(e,t,i,r,o,a){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=l[d];if(u)o(u,c,n);else{const f=se(i,a);if(!f||(N(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),o(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function y(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function T(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function M(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const A=new Map;function B(e,t){const i=(e?e.join("|"):"")+"::"+t;if(A.has(i))return A.get(i);const r=new Set(e||[]),o=function(a,l){const s=a.getAttribute(l);return s!==null&&r.has(s)?s:t};return A.set(i,o),o}function j(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function V(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function W(e,t,i,r,o){if(!e||t===null)return!0;const a=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{o?console.warn(n,o):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,i){for(const r in i){const[o,a,l]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,a,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=B(r.values,r.fallback);break;case"integer":o=T;break;case"float":o=j;break;case"boolean":o=M;break;case"list":o=R;break;case"json":o=V;break;case"string":default:o=y;break}o||(o=y),t[r.prop]=[o,i,r.fallback]}return t}function fe(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function we(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ue,window.lnCore.attrSpec=de,window.lnCore.attrStr=y,window.lnCore.attrInt=T,window.lnCore.attrBool=M,window.lnCore.attrList=R,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=V);function h(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(i){console.error("["+t.attribute+"] init failed",e,i)}}}function U(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(a)&&h(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)h(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(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 H(){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 P(e){const t=H(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[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(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=we(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,i,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const l=a.effects&&a.effects[i];l?l(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function pe(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=H(),o=r.byAttr.get(t),a=D()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!o&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&m(l)){const s=r.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<s.length;c++)W(s[c].spec,n,t,s[c].componentTag,l)}if(window.lnCore._debugSink&&(i||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&Q(s,l,t,e.oldValue),r.reactiveWildcard.length&&Q(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const n=o[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(U(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function J(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{pe(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function x(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=v();if(!t.length)return;const i=e.target;if(i){const r=i.nodeType===1?i:i.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 a=o.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&o.onSubtreeChange(l,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)o.matches&&o.matches(s.query)&&h(o,s);else if(o.matches&&o.matches(s.query)&&h(o,s),o.querySelectorAll){const n=o.querySelectorAll(s.query);for(let c=0;c<n.length;c++)h(n[c],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 a=!!(o.firstElementChild||o.children&&o.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!a)o.matches&&o.matches(n)&&x(o,s);else if(o.matches&&o.matches(n)&&x(o,s),o.querySelectorAll){const c=o.querySelectorAll(n);for(let d=0;d<c.length;d++)x(c[d],s)}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{ge(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,t){P({observed:e,handler:t}),J()}function Ce(e){v().push(e),K()}function z(e,t,i,r,o={}){const a=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,n=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,u=o.attributes||null,f=u?fe(u):d,Fe=u?new Set(Object.keys(u)):null,qe=o.persist||null;function g(k){const w=k||document.body;if(U(w,e,t,i),u&&D())for(const b in u){const Ne=u[b],O=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&O.push(w);for(let E=0;E<O.length;E++){const L=O[E];m(L)&&W(Ne,L.getAttribute(b),b,r,L)}}n&&n(w)}const _=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)_.push(w[1])}else _.push(e);P({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:i,onInit:n,observed:_.concat(a),onAttributeChange:l,onAttrChange:c,effects:f,declared:Fe,persist:qe}),J();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,$e=o.subtreeQuery||(Ie?e:"["+e+"]");v().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:$e}),K(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ce);function X(){he()>0?be(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),g}function G(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,i={},r=G(t);if(!r)return i;const o=r.split("&");for(let a=0;a<o.length;a++){const l=o[a];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function ye(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const i=S();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const l=i[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");G(location.hash)!==o&&(location.hash=o)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.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 Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Oe);function Ee(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ee);function Le(e,t=100,i=0){const r=parseFloat(String(e))||0,o=parseFloat(String(t))||100,a=parseFloat(String(i))||0,l=Math.max(a,Math.min(r,o)),s=o-a;let n=0;return s>0&&(n=(l-a)/s*100),n=Math.max(0,Math.min(100,n)),{value:r,min:a,max:o,clampedValue:l,percentage:n}}function De(e,t,i=100){if(t!=null&&t!==""){const r=parseFloat(String(t));if(!isNaN(r)&&r>0)return r}if(e!=null&&e!==""){const r=parseFloat(String(e));if(!isNaN(r)&&r>0)return r}return i}(function(){const e="[data-ln-progress]",t="lnProgress";if(window[t]!==void 0)return;function i(l){const s=l[t];s&&a.call(s)}const r={"data-ln-progress":{type:"float",fallback:0,min:0,effect:i,description:"Current progress value"},"data-ln-progress-max":{type:"float",fallback:100,min:0,effect:i,description:"Maximum progress scale value"}};function o(l){return this.dom=l,this._parentObserver=null,a.call(this),this}o.prototype.destroy=function(){this.dom[t]&&(this._parentObserver&&this._parentObserver.disconnect(),delete this.dom[t])};function a(){const l=this.dom.getAttribute("data-ln-progress"),s=this.dom.parentElement,n=s?s.getAttribute("data-ln-progress-max"):null,c=this.dom.getAttribute("data-ln-progress-max"),d=De(c,n,100),u=Le(l,d);this.dom.style.width=u.percentage+"%",this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(u.min)),this.dom.setAttribute("aria-valuemax",String(u.max)),this.dom.setAttribute("aria-valuenow",String(u.clampedValue)),F(this.dom,"ln-progress:change",{target:this.dom,value:u.value,max:u.max,percentage:u.percentage})}z(e,t,o,"ln-progress",{attributes:r}),me(["data-ln-progress-max"],function(l){const s=l.querySelectorAll?l.querySelectorAll(e):[];for(let n=0;n<s.length;n++){const c=s[n][t];c&&a.call(c)}})})()})();
@@ -1,4 +1,4 @@
1
- import { calculateProgress, dispatch, registerComponent } from '../../ln-core';
1
+ import { calculateProgress, dispatch, registerComponent, observeAttributes } from '../../ln-core';
2
2
  import { resolveProgressMax } from './progress-model.js';
3
3
 
4
4
  (function () {
@@ -22,7 +22,6 @@ import { resolveProgressMax } from './progress-model.js';
22
22
  this.dom = dom;
23
23
  this._parentObserver = null;
24
24
  _render.call(this);
25
- _listenParent.call(this);
26
25
  return this;
27
26
  }
28
27
 
@@ -34,26 +33,7 @@ import { resolveProgressMax } from './progress-model.js';
34
33
  delete this.dom[DOM_ATTRIBUTE];
35
34
  };
36
35
 
37
- function _listenParent() {
38
- const self = this;
39
- const parent = this.dom.parentElement;
40
- if (!parent) return;
41
-
42
- const observer = new MutationObserver(function (mutations) {
43
- for (const mutation of mutations) {
44
- if (mutation.attributeName === 'data-ln-progress-max') {
45
- _render.call(self);
46
- }
47
- }
48
- });
49
-
50
- observer.observe(parent, {
51
- attributes: true,
52
- attributeFilter: ['data-ln-progress-max']
53
- });
54
36
 
55
- this._parentObserver = observer;
56
- }
57
37
 
58
38
  function _render() {
59
39
  const rawVal = this.dom.getAttribute('data-ln-progress');
@@ -88,4 +68,12 @@ import { resolveProgressMax } from './progress-model.js';
88
68
  attributes: ATTRIBUTES
89
69
  }
90
70
  );
71
+
72
+ observeAttributes(['data-ln-progress-max'], function (parent) {
73
+ const bars = parent.querySelectorAll ? parent.querySelectorAll(DOM_SELECTOR) : [];
74
+ for (let i = 0; i < bars.length; i++) {
75
+ const inst = bars[i][DOM_ATTRIBUTE];
76
+ if (inst) _render.call(inst);
77
+ }
78
+ });
91
79
  })();
@@ -1 +1 @@
1
- var LnAshlarComponent=(function(x){"use strict";function U(){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 S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const 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(!S(r))return}e.apply(console,t)}}function E(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function Se(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 y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Ee(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function Oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Re(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const i=s[a];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<s.length;a++){const i=s[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&l[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&o[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);o[i.name]=i.value===""||isNaN(u)?null:u}else o[i.name]=i.value}return o}function Ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Me(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const i=t[a];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(i).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=Ie(i);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<l.options.length;u++)l.options[u].selected=i.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Me,window.lnCore.serializeForm=Re,window.lnCore.resolveFormMethod=Oe);const V={};function qe(e,t){V[e]=t}function Le(e){return V[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=qe,window.lnCore.getDataMapper=Le);function $e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function De(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];Q[n]=t}function Te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=De,window.lnCore.getLocaleFallback=Te,window.lnCore.ensureLocaleObserver=$e);const O={};function Ne(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],i=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(f,t[p])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const a=o[l],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],i=a.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const d=i[u].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(f,!!t[p])}}return e}function Fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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 J(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],a=l.attributes;for(let i=0;i<a.length;i++){const u=a[i];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Be(e,t,n,r,o,s){const l={};for(let i=0;i<e.children.length;i++){const u=e.children[i],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],d=String(r(u));let f=l[d];if(f)o(f,u,i);else{const p=Ne(n,s);if(!p||(J(p,u),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),o(f,u,i)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=z,window.lnCore.lnFill=Fe,window.lnCore.renderList=Be);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function G(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function X(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 Y(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return I.set(n,o),o}function ee(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function te(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ne(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=i=>{o?console.warn(i,o):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function We(e,t,n){for(const r in n){const[o,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function je(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Z(r.values,r.fallback);break;case"integer":o=G;break;case"float":o=ee;break;case"boolean":o=X;break;case"list":o=Y;break;case"json":o=te;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function Ke(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 Pe(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=We,window.lnCore.attrSpec=je,window.lnCore.attrStr=R,window.lnCore.attrInt=G,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function M(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(i){console.error("["+n+"] init failed",a,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function He(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ue(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 Ve(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(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=Pe(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 s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Qe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=re(),o=r.byAttr.get(n);if(U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&S(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)ne(s[a].spec,l,n,s[a].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&&oe(s,t,n,e.oldValue),r.reactiveWildcard.length&&oe(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const l=o[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(M(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ze(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Qe(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 ie(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Je(e){const t=ie();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];M(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],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let i=0;i<a.length;i++){const u=a[i];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 Ge(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Je(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t,n,r,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,a=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,f=o.attributes||null,p=f?Ke(f):d,k=f?new Set(Object.keys(f)):null,c=o.persist||null;function w(j){const b=j||document.body;if(M(b,e,t,n),f&&U())for(const A in f){const wt=f[A],K=Array.from(b.querySelectorAll("["+A+"]"));b.matches&&b.matches("["+A+"]")&&K.push(b);for(let P=0;P<K.length;P++){const H=K[P];S(H)&&ne(wt,H.getAttribute(A),A,r,H)}}i&&i(b)}const h=[];if(e.indexOf("[")!==-1){const j=/\[([\w-]+)/g;let b;for(;(b=j.exec(e))!==null;)h.push(b[1])}else h.push(e);Ve({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:h.concat(s),onAttributeChange:l,onAttrChange:u,effects:p,declared:k,persist:c}),ze();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ft=o.subtreeQuery||(m?e:"["+e+"]");ie().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:a,query:ft}),Ge(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le);function xe(){He()>0?Ue(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xe):xe(),w}function se(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const a=l.indexOf(":"),i=a>-1?l.slice(0,a):l,u=a>-1?l.slice(a+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Xe(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Ye(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Ze(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function et(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 tt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function nt(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 rt(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ot(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=q,window.lnCore.hashGet=Xe,window.lnCore.hashSet=Ye,window.lnCore.hashLinkClick=Ze,window.lnCore.resolveHashNamespace=et,window.lnCore.hashSortEncode=tt,window.lnCore.hashSortDecode=nt,window.lnCore.hashFilterEncode=rt,window.lnCore.hashFilterDecode=ot);function it(){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=it);function lt(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:r=null}={}){const o=n?!r:!e.some(u=>u.match),s=[],l=[];for(const u of e)if(!(!u.targetEl&&!u.isPending)){if(!u.match){const d=t&&u.hasHydrate&&u.hasChildren;!u.hasKeep&&u.hasChildren&&!d&&u.targetEl&&s.push(u);continue}u.hasKeep&&u.mountedTemplate===u.match.route.templateNode||l.push(Object.assign({},u,{skipMount:t&&u.hasHydrate&&u.hasChildren}))}l.sort((u,d)=>u.regionKey==="__primary__"?-1:d.regionKey==="__primary__"?1:0);const i=l.find(u=>u.regionKey==="__primary__")||l[0]||null;return{notFound:o,clears:s,swaps:l,owner:i}}function C(e){if(!e||typeof e!="string")return"";let t=e.trim().replace(/\/+$/,"");return!t||t==="/"?"":t.startsWith("/")?t:"/"+t}function st(e,t){const n=C(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const r=(e||"/").replace(/\/+$/,"")||"/";return r===n?"/":r.startsWith(n+"/")?r.slice(n.length).replace(/\/+$/,"")||"/":r}function ae(e,t){const n=C(t);if(!n)return e||"/";const r=e||"/",o=r.indexOf("#"),s=o!==-1?r.slice(0,o):r,l=o!==-1?r.slice(o):"",a=s.indexOf("?"),i=a!==-1?s.slice(0,a):s,u=a!==-1?s.slice(a):"";let d;if(i===n)d=n+"/";else if(i.startsWith(n+"/"))d=i;else{const f=i.startsWith("/")?i:"/"+i;d=f==="/"?n+"/":n+f}return d+u+l}function L(){if(typeof document>"u")return"";const e=document.querySelector("[data-ln-outlet]")||document.querySelector("[data-ln-router-base]");if(e&&e.hasAttribute("data-ln-router-base"))return C(e.getAttribute("data-ln-router-base"));const t=document.querySelector("base[href]");if(t)try{const n=new URL(t.getAttribute("href"),window.location.origin);return C(n.pathname)}catch{return C(t.getAttribute("href"))}return""}const $={navigate:function(e){_(e,{historyAction:"push"})},replace:function(e){_(e,{historyAction:"replace"})},base:function(){return L()},toUrl:function(e){return ae(e,L())},current:function(){return v===null?null:{path:v,fullPath:fe,base:we,params:he,query:pe,route:ge,regions:ce}}},D="data-ln-route",ue="lnRoute";typeof window<"u"&&(window.lnRouter=$);function T(e){ve(e),Ae(e),g.size>0&&_e()}const at={"data-ln-route":{effect:T,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:T,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:T,type:"string",description:"Document title template set when route is activated"},"data-ln-route-keep":{type:"boolean",fallback:!1,description:"Preserve mounted DOM nodes in memory instead of rebuilding"},"data-ln-router-base":{type:"string",description:'Base URL prefix for subdirectory routing (e.g. "/spa")'},"data-ln-router-hydrate":{type:"boolean",fallback:!1,description:"Hydrate existing DOM content on initial router boot"}},g=new Map,N=new WeakMap;let ce=new Map,de=!1,v=null,fe=null,we="",he={},pe={},ge=null,F=!1;function be(e,t,n){F?queueMicrotask(function(){E(e,t,n)}):E(e,t,n)}function B(e){try{const a=new URL(e,window.location.origin);e=a.pathname+a.search+a.hash}catch{}let[t]=e.split("#"),[n,r]=t.split("?");const o={};if(r){const a=new URLSearchParams(r);for(const[i,u]of a.entries())o[i]=u}const s=L();return{path:st(n,s),query:o,base:s}}function me(e,t){if(e.pattern==="*")return 1;if(t.pattern==="*")return-1;const n=e.segments,r=t.segments,o=Math.max(n.length,r.length);for(let s=0;s<o;s++){const l=n[s],a=r[s];if(l===void 0)return 1;if(a===void 0)return-1;if(l==="*")return 1;if(a==="*")return-1;const i=l.startsWith(":"),u=a.startsWith(":");if(i&&!u)return 1;if(!i&&u)return-1}return 0}function ye(e,t){const n=e.split("/").filter(Boolean);for(const r of t){if(r.pattern==="*")return{route:r,params:{wildcard:e}};const o=r.segments,s={};let l=!0;if(!(n.length>o.length&&o[o.length-1]!=="*")){for(let a=0;a<o.length;a++){const i=o[a],u=n[a];if(i==="*"){s.wildcard=n.slice(a).join("/");break}if(u===void 0){l=!1;break}if(i.startsWith(":"))s[i.slice(1)]=decodeURIComponent(u);else if(i!==u){l=!1;break}}if(l&&(o.indexOf("*")!==-1||n.length<=o.length))return{route:r,params:s}}}return null}function W(e,t={}){const n=t.warn!==!1;if(e!=="__primary__"){const o=document.getElementById(e);return!o&&n&&console.warn(`[ln-router] Explicit target element #${e} not found in DOM`),o}const r=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return!r&&n&&console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),r}function Ce(e){if(!e)return;const t=Array.from(e.querySelectorAll("*")),n=[e].concat(t);for(const o of n)for(const s of Object.keys(o))if(s.startsWith("ln")&&o[s]&&typeof o[s].destroy=="function")try{o[s].destroy()}catch(l){console.error(`[ln-router] Error destroying component ${s} on element:`,o,l)}const r=document.querySelectorAll('[data-ln-popover="open"]');for(const o of r){const s=o.lnPopover;if(s&&s.trigger&&e.contains(s.trigger))try{s.destroy()}catch(l){console.error("[ln-router] Error destroying open popover:",l)}}}function _(e,t={}){const{path:n,query:r,base:o}=B(e),s=ae(e,o),l=new Map;for(const[c,w]of g)l.set(c,ye(n,w.sorted));const a=l.get("__primary__")||null,i=W("__primary__",{warn:!!a}),u=g.has("__primary__"),d=[];for(const[c,w]of l){const h=c==="__primary__"?i:W(c,{warn:!1}),m=!h&&!!(a&&a.route&&a.route.templateNode&&a.route.templateNode.content&&a.route.templateNode.content.querySelector("#"+CSS.escape(c)));!h&&!m&&w&&console.warn(`[ln-router] Explicit target element #${c} not found in DOM`),d.push({regionKey:c,match:w,targetEl:h,isPending:m,hasKeep:!!h&&h.hasAttribute("data-ln-route-keep"),hasHydrate:!!h&&h.hasAttribute("data-ln-router-hydrate"),hasChildren:!!h&&h.children.length>0,mountedTemplate:h&&N.get(h)||null})}const f=lt(d,{isHydration:!!t.isHydration,hasPrimaryRegion:u,primaryMatch:a});if(f.notFound){be(document.body,"ln-router:not-found",{path:n});return}if(Se(i||document.body,"ln-router:before-navigate",{from:v,to:s,path:n,params:a?a.params:{},query:r}).defaultPrevented)return;t.historyAction==="push"?window.history.pushState(null,"",s):t.historyAction==="replace"&&window.history.replaceState(null,"",s);const k=function(){for(const c of f.clears)Ce(c.targetEl),c.targetEl.replaceChildren(),N.delete(c.targetEl);for(const c of f.swaps){if((c.isPending||!c.targetEl||!document.contains(c.targetEl))&&(c.targetEl=c.regionKey==="__primary__"?i:document.getElementById(c.regionKey)),!c.targetEl){console.warn(`[ln-router] Target element #${c.regionKey} could not be resolved`);continue}if(c.skipMount||(Ce(c.targetEl),c.targetEl.replaceChildren(c.match.route.templateNode.content.cloneNode(!0))),N.set(c.targetEl,c.match.route.templateNode),f.owner&&c.regionKey===f.owner.regionKey){if(c.match.route.title){let w=c.match.route.title;if(c.match.params)for(const[h,m]of Object.entries(c.match.params))w=w.replace(new RegExp("\\{\\{\\s*"+h+"\\s*\\}\\}","g"),m);document.title=w}if(!t.isHydration){c.targetEl.hasAttribute("tabindex")||c.targetEl.setAttribute("tabindex","-1");const w=c.targetEl.querySelector("h1, h2, h3, h4, h5, h6");w?(w.setAttribute("tabindex","-1"),w.focus()):c.targetEl.focus(),c.regionKey==="__primary__"&&c.targetEl.scrollIntoView({block:"start",behavior:"instant"})}}be(c.targetEl,"ln-router:navigated",{path:n,fullPath:s,base:o,params:c.match.params,query:r,route:c.match.route,target:c.targetEl,region:c.regionKey})}v=n,fe=s,we=o,pe=r,ge=a?a.route:null,he=a?a.params:{},ce=new Map(Array.from(l.entries()).map(([c,w])=>[c,w?{route:w.route,params:w.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(k):k()}function ut(e){const t=e.target.closest("a");if(!t||!Ee(e,t))return;const n=t.getAttribute("href"),{path:r}=B(n);for(const o of g.values())if(ye(r,o.sorted)){e.preventDefault(),_(n,{historyAction:"push"});return}}function ct(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){const s=n[o];if(e[s]!==t[s])return!1}return!0}function dt(){const e=window.location.pathname+window.location.search,t=$.current();if(t&&t.path!=null){const n=B(e);if(t.path===n.path&&ct(t.query,n.query))return}_(e,{historyAction:"skip"})}function _e(){de||(de=!0,y(function(){document.addEventListener("click",ut),window.addEventListener("popstate",dt),F=!0;const e=window.location.pathname+window.location.search+window.location.hash;_(e,{historyAction:"replace",isHydration:!0}),F=!1},"ln-router"))}function Ae(e){const t=e.getAttribute(D);if(!t)return;const n=e.getAttribute("data-ln-route-target")||null;if(n==="__primary__"){console.warn(`[ln-router] "__primary__" is a reserved region key and cannot be used as data-ln-route-target. Route "${t}" rejected.`);return}const r=n||"__primary__";g.has(r)||g.set(r,{routes:new Map,sorted:[]});const o=g.get(r);if(o.routes.has(t)){console.warn(`[ln-router] Duplicate route pattern registered: "${t}" in region "${r}"`);return}const s=e.getAttribute("data-ln-route-title"),l=t.split("/").filter(Boolean),a={pattern:t,segments:l,target:n,title:s,templateNode:e},i=W(r);i&&i.contains(e)&&console.warn(`[ln-router] Route template with pattern "${t}" is declared inside its own outlet element:`,e),o.routes.set(t,a),o.sorted=Array.from(o.routes.values()).sort(me)}function ve(e){const t=e.getAttribute(D);if(!t)return;const r=e.getAttribute("data-ln-route-target")||null||"__primary__",o=g.get(r);o&&(o.routes.delete(t),o.sorted=Array.from(o.routes.values()).sort(me),o.routes.size===0&&g.delete(r))}function ke(e){return this.dom=e,Ae(e),this}return ke.prototype.destroy=function(){ve(this.dom),delete this.dom[ue]},le(D,ue,ke,"ln-router",{attributes:at,onInit:function(){g.size>0&&_e()}}),x.router=$,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
1
+ var LnAshlarComponent=(function(x){"use strict";function Q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!E(o))return}e.apply(console,t)}}function O(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 qe(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function De(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function Le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Re(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},a=e.elements,l={};if(n)for(let s=0;s<a.length;s++){const i=a[s];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<a.length;s++){const i=a[s];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&l[i.name]===1?r[i.name]=i.checked:(r[i.name]||(r[i.name]=[]),i.checked&&r[i.name].push(i.value));else if(i.type==="radio")i.checked&&(r[i.name]=i.value);else if(i.type==="select-multiple"){r[i.name]=[];for(let c=0;c<i.options.length;c++)i.options[c].selected&&r[i.name].push(i.options[c].value)}else if(n&&i.type==="hidden")r[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const c=Number(i.value);r[i.name]=i.value===""||isNaN(c)?null:c}else r[i.name]=i.value}return r}function Ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Me(e,t){const n=e.elements,o=[],r={};for(let a=0;a<n.length;a++){const l=n[a];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let a=0;a<n.length;a++){const l=n[a];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 i=t[s];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(i).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=Ie(i);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<l.options.length;c++)l.options[c].selected=i.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Me,window.lnCore.serializeForm=Re,window.lnCore.resolveFormMethod=Le);const z={};function $e(e,t){z[e]=t}function Te(e){return z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=$e,window.lnCore.getDataMapper=Te);function Fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){O(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const J={};function Ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];J[n]=t}function Be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return J[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ne,window.lnCore.getLocaleFallback=Be,window.lnCore.ensureLocaleObserver=Fe);const q={};function We(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function G(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],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],i=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const d=i[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();t[p]!=null&&s.setAttribute(f,t[p])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const s=r[l],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],i=s.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const d=i[c].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),p=d[1].trim();p in t&&s.classList.toggle(f,!!t[p])}}return e}function je(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)G(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 X(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(a,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let a=0;a<r.length;a++){const l=r[a],s=l.attributes;for(let i=0;i<s.length;i++){const c=s[i];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ke(e,t,n,o,r,a){const l={};for(let i=0;i<e.children.length;i++){const c=e.children[i],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],d=String(o(c));let f=l[d];if(f)r(f,c,i);else{const p=We(n,a);if(!p||(X(p,c),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),r(f,c,i)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=G,window.lnCore.lnFill=je,window.lnCore.renderList=Ke);function D(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function Y(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function Z(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const L=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(L.has(n))return L.get(n);const o=new Set(e||[]),r=function(a,l){const s=a.getAttribute(l);return s!==null&&o.has(s)?s:t};return L.set(n,r),r}function ne(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function re(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function oe(e,t,n,o,r){if(!e||t===null)return!0;const a=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=i=>{r?console.warn(i,r):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Pe(e,t,n){for(const o in n){const[r,a,l]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,a,l)},enumerable:!0,configurable:!0})}return e}function He(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=te(o.values,o.fallback);break;case"integer":r=Y;break;case"float":r=ne;break;case"boolean":r=Z;break;case"list":r=ee;break;case"json":r=re;break;case"string":default:r=D;break}r||(r=D),t[o.prop]=[r,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function 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=Pe,window.lnCore.attrSpec=He,window.lnCore.attrStr=D,window.lnCore.attrInt=Y,window.lnCore.attrBool=Z,window.lnCore.attrList=ee,window.lnCore.attrEnum=te,window.lnCore.attrFloat=ne,window.lnCore.attrJson=re);function C(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 ie(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(a)&&C(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let i=0;i<s.length;i++)C(s[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Qe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ze(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 le(){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 Je(e){const t=le(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).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 r=t.byDeclaredAttr.get(o);r.some(a=>a.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ve(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function se(e,t,n,o){for(let r=0;r<e.length;r++){const a=e[r];if(!t[a.attribute])continue;const l=a.effects&&a.effects[n];l?l(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=le(),r=o.byAttr.get(t),a=Q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!r&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&E(l)){const s=o.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let c=0;c<s.length;c++)oe(s[c].spec,i,t,s[c].componentTag,l)}if(window.lnCore._debugSink&&(n||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const s=o.byReactive.get(t);s&&se(s,l,t,e.oldValue),o.reactiveWildcard.length&&se(o.reactiveWildcard,l,t,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const i=r[s];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(ie(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function Xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(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 R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(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 Ye(e){const t=R();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 r=t[o];if(r.onSubtreeChange&&r.query){const a=r.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&r.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)r.matches&&r.matches(s.query)&&C(r,s);else if(r.matches&&r.matches(s.query)&&C(r,s),r.querySelectorAll){const i=r.querySelectorAll(s.query);for(let c=0;c<i.length;c++)C(i[c],s)}}s.onInit&&s.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l],i=s.query;if(i){if(!a)r.matches&&r.matches(i)&&I(r,s);else if(r.matches&&r.matches(i)&&I(r,s),r.querySelectorAll){const c=r.querySelectorAll(i);for(let d=0;d<c.length;d++)I(c[d],s)}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Ye(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ze(e){R().push(e),ae()}function ce(e,t,n,o,r={}){const a=r.extraAttributes||[],l=r.onAttributeChange||null,s=r.onSubtreeChange||null,i=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,f=r.attributes||null,p=f?Ue(f):d,k=f?new Set(Object.keys(f)):null,u=r.persist||null;function h(P){const b=P||document.body;if(ie(b,e,t,n),f&&Q())for(const v in f){const gt=f[v],H=Array.from(b.querySelectorAll("["+v+"]"));b.matches&&b.matches("["+v+"]")&&H.push(b);for(let U=0;U<H.length;U++){const V=H[U];E(V)&&oe(gt,V.getAttribute(v),v,o,V)}}i&&i(b)}const w=[];if(e.indexOf("[")!==-1){const P=/\[([\w-]+)/g;let b;for(;(b=P.exec(e))!==null;)w.push(b[1])}else w.push(e);Je({selector:e,attribute:t,componentTag:o,attributes:f,ComponentFn:n,onInit:i,observed:w.concat(a),onAttributeChange:l,onAttrChange:c,effects:p,declared:k,persist:u}),Xe();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,pt=r.subtreeQuery||(m?e:"["+e+"]");R().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:s,query:pt}),ae(),window[t]=h,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ce,window.lnCore.observeLifecycle=Ze);function Oe(){Qe()>0?ze(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oe):Oe(),h}function ue(e){return(e||"").replace(/^#/,"")}function M(e){const t=e===void 0?location.hash:e,n={},o=ue(t);if(!o)return n;const r=o.split("&");for(let a=0;a<r.length;a++){const l=r[a];if(!l)continue;const s=l.indexOf(":"),i=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function et(e){if(!e)return null;const t=M();return e in t?t[e]:null}function tt(e,t){if(!e)return;const n=M();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(a){const l=n[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");ue(location.hash)!==r&&(location.hash=r)}function nt(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function rt(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 ot(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function it(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 lt(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function st(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),r=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=M,window.lnCore.hashGet=et,window.lnCore.hashSet=tt,window.lnCore.hashLinkClick=nt,window.lnCore.resolveHashNamespace=rt,window.lnCore.hashSortEncode=ot,window.lnCore.hashSortDecode=it,window.lnCore.hashFilterEncode=lt,window.lnCore.hashFilterDecode=st);function at(){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=at);function ct(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:o=null}={}){const r=n?!o:!e.some(c=>c.match),a=[],l=[];for(const c of e)if(!(!c.targetEl&&!c.isPending)){if(!c.match){const d=t&&c.hasHydrate&&c.hasChildren;!c.hasKeep&&c.hasChildren&&!d&&c.targetEl&&a.push(c);continue}c.hasKeep&&c.mountedTemplate===c.match.route.templateNode||l.push(Object.assign({},c,{skipMount:t&&c.hasHydrate&&c.hasChildren}))}l.sort((c,d)=>c.regionKey==="__primary__"?-1:d.regionKey==="__primary__"?1:0);const i=l.find(c=>c.regionKey==="__primary__")||l[0]||null;return{notFound:r,clears:a,swaps:l,owner:i}}function _(e){if(!e||typeof e!="string")return"";let t=e.trim().replace(/\/+$/,"");return!t||t==="/"?"":t.startsWith("/")?t:"/"+t}function ut(e,t){const n=_(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const o=(e||"/").replace(/\/+$/,"")||"/";return o===n?"/":o.startsWith(n+"/")?o.slice(n.length).replace(/\/+$/,"")||"/":o}function de(e,t){const n=_(t);if(!n)return e||"/";const o=e||"/",r=o.indexOf("#"),a=r!==-1?o.slice(0,r):o,l=r!==-1?o.slice(r):"",s=a.indexOf("?"),i=s!==-1?a.slice(0,s):a,c=s!==-1?a.slice(s):"";let d;if(i===n)d=n+"/";else if(i.startsWith(n+"/"))d=i;else{const f=i.startsWith("/")?i:"/"+i;d=f==="/"?n+"/":n+f}return d+c+l}function $(){if(typeof document>"u")return"";const e=document.querySelector("[data-ln-outlet]")||document.querySelector("[data-ln-router-base]");if(e&&e.hasAttribute("data-ln-router-base"))return _(e.getAttribute("data-ln-router-base"));const t=document.querySelector("base[href]");if(t)try{const n=new URL(t.getAttribute("href"),window.location.origin);return _(n.pathname)}catch{return _(t.getAttribute("href"))}return""}const T={navigate:function(e){A(e,{historyAction:"push"})},replace:function(e){A(e,{historyAction:"replace"})},base:function(){return $()},toUrl:function(e){return de(e,$())},current:function(){return S===null?null:{path:S,fullPath:pe,base:ge,params:be,query:me,route:ye,regions:he}}},F="data-ln-route",fe="lnRoute";typeof window<"u"&&(window.lnRouter=T);function N(e){xe(e),ke(e),g.size>0&&Se()}const dt={"data-ln-route":{effect:N,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:N,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:N,type:"string",description:"Document title template set when route is activated"},"data-ln-route-keep":{type:"boolean",fallback:!1,description:"Preserve mounted DOM nodes in memory instead of rebuilding"},"data-ln-router-base":{type:"string",description:'Base URL prefix for subdirectory routing (e.g. "/spa")'},"data-ln-router-hydrate":{type:"boolean",fallback:!1,description:"Hydrate existing DOM content on initial router boot"}},g=new Map,B=new WeakMap;let he=new Map,we=!1,S=null,pe=null,ge="",be={},me={},ye=null,W=!1;function Ce(e,t,n){W?queueMicrotask(function(){O(e,t,n)}):O(e,t,n)}function j(e){try{const s=new URL(e,window.location.origin);e=s.pathname+s.search+s.hash}catch{}let[t]=e.split("#"),[n,o]=t.split("?");const r={};if(o){const s=new URLSearchParams(o);for(const[i,c]of s.entries())r[i]=c}const a=$();return{path:ut(n,a),query:r,base:a}}function _e(e,t){if(e.pattern==="*")return 1;if(t.pattern==="*")return-1;const n=e.segments,o=t.segments,r=Math.max(n.length,o.length);for(let a=0;a<r;a++){const l=n[a],s=o[a];if(l===void 0)return 1;if(s===void 0)return-1;if(l==="*")return 1;if(s==="*")return-1;const i=l.startsWith(":"),c=s.startsWith(":");if(i&&!c)return 1;if(!i&&c)return-1}return 0}function Ae(e,t){const n=e.split("/").filter(Boolean);for(const o of t){if(o.pattern==="*")return{route:o,params:{wildcard:e}};const r=o.segments,a={};let l=!0;if(!(n.length>r.length&&r[r.length-1]!=="*")){for(let s=0;s<r.length;s++){const i=r[s],c=n[s];if(i==="*"){a.wildcard=n.slice(s).join("/");break}if(c===void 0){l=!1;break}if(i.startsWith(":"))a[i.slice(1)]=decodeURIComponent(c);else if(i!==c){l=!1;break}}if(l&&(r.indexOf("*")!==-1||n.length<=r.length))return{route:o,params:a}}}return null}function K(e,t={}){const n=t.warn!==!1;if(e!=="__primary__"){const r=document.getElementById(e);return!r&&n&&console.warn(`[ln-router] Explicit target element #${e} not found in DOM`),r}const o=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return!o&&n&&console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),o}function ve(e){if(!e)return;const t=Array.from(e.querySelectorAll("*")),n=[e].concat(t);for(const r of n)for(const a of Object.keys(r))if(a.startsWith("ln")&&r[a]&&typeof r[a].destroy=="function")try{r[a].destroy()}catch(l){console.error(`[ln-router] Error destroying component ${a} on element:`,r,l)}const o=document.querySelectorAll('[data-ln-popover="open"]');for(const r of o){const a=r.lnPopover;if(a&&a.trigger&&e.contains(a.trigger))try{a.destroy()}catch(l){console.error("[ln-router] Error destroying open popover:",l)}}}function A(e,t={}){const{path:n,query:o,base:r}=j(e),a=de(e,r),l=new Map;for(const[u,h]of g)l.set(u,Ae(n,h.sorted));const s=l.get("__primary__")||null,i=K("__primary__",{warn:!!s}),c=g.has("__primary__"),d=[];for(const[u,h]of l){const w=u==="__primary__"?i:K(u,{warn:!1}),m=!w&&!!(s&&s.route&&s.route.templateNode&&s.route.templateNode.content&&s.route.templateNode.content.querySelector("#"+CSS.escape(u)));!w&&!m&&h&&console.warn(`[ln-router] Explicit target element #${u} not found in DOM`),d.push({regionKey:u,match:h,targetEl:w,isPending:m,hasKeep:!!w&&w.hasAttribute("data-ln-route-keep"),hasHydrate:!!w&&w.hasAttribute("data-ln-router-hydrate"),hasChildren:!!w&&w.children.length>0,mountedTemplate:w&&B.get(w)||null})}const f=ct(d,{isHydration:!!t.isHydration,hasPrimaryRegion:c,primaryMatch:s});if(f.notFound){Ce(document.body,"ln-router:not-found",{path:n});return}if(qe(i||document.body,"ln-router:before-navigate",{from:S,to:a,path:n,params:s?s.params:{},query:o}).defaultPrevented)return;t.historyAction==="push"?window.history.pushState(null,"",a):t.historyAction==="replace"&&window.history.replaceState(null,"",a);const k=function(){for(const u of f.clears)ve(u.targetEl),u.targetEl.replaceChildren(),B.delete(u.targetEl);for(const u of f.swaps){if((u.isPending||!u.targetEl||!document.contains(u.targetEl))&&(u.targetEl=u.regionKey==="__primary__"?i:document.getElementById(u.regionKey)),!u.targetEl){console.warn(`[ln-router] Target element #${u.regionKey} could not be resolved`);continue}if(u.skipMount||(ve(u.targetEl),u.targetEl.replaceChildren(u.match.route.templateNode.content.cloneNode(!0))),B.set(u.targetEl,u.match.route.templateNode),f.owner&&u.regionKey===f.owner.regionKey){if(u.match.route.title){let h=u.match.route.title;if(u.match.params)for(const[w,m]of Object.entries(u.match.params))h=h.replace(new RegExp("\\{\\{\\s*"+w+"\\s*\\}\\}","g"),m);document.title=h}if(!t.isHydration){u.targetEl.hasAttribute("tabindex")||u.targetEl.setAttribute("tabindex","-1");const h=u.targetEl.querySelector("h1, h2, h3, h4, h5, h6");h?(h.setAttribute("tabindex","-1"),h.focus()):u.targetEl.focus(),u.regionKey==="__primary__"&&u.targetEl.scrollIntoView({block:"start",behavior:"instant"})}}Ce(u.targetEl,"ln-router:navigated",{path:n,fullPath:a,base:r,params:u.match.params,query:o,route:u.match.route,target:u.targetEl,region:u.regionKey})}S=n,pe=a,ge=r,me=o,ye=s?s.route:null,be=s?s.params:{},he=new Map(Array.from(l.entries()).map(([u,h])=>[u,h?{route:h.route,params:h.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(k):k()}function ft(e){const t=e.target.closest("a");if(!t||!De(e,t))return;const n=t.getAttribute("href"),{path:o}=j(n);for(const r of g.values())if(Ae(o,r.sorted)){e.preventDefault(),A(n,{historyAction:"push"});return}}function ht(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++){const a=n[r];if(e[a]!==t[a])return!1}return!0}function wt(){const e=window.location.pathname+window.location.search,t=T.current();if(t&&t.path!=null){const n=j(e);if(t.path===n.path&&ht(t.query,n.query))return}A(e,{historyAction:"skip"})}function Se(){we||(we=!0,y(function(){document.addEventListener("click",ft),window.addEventListener("popstate",wt),W=!0;const e=window.location.pathname+window.location.search+window.location.hash;A(e,{historyAction:"replace",isHydration:!0}),W=!1},"ln-router"))}function ke(e){const t=e.getAttribute(F);if(!t)return;const n=e.getAttribute("data-ln-route-target")||null;if(n==="__primary__"){console.warn(`[ln-router] "__primary__" is a reserved region key and cannot be used as data-ln-route-target. Route "${t}" rejected.`);return}const o=n||"__primary__";g.has(o)||g.set(o,{routes:new Map,sorted:[]});const r=g.get(o);if(r.routes.has(t)){console.warn(`[ln-router] Duplicate route pattern registered: "${t}" in region "${o}"`);return}const a=e.getAttribute("data-ln-route-title"),l=t.split("/").filter(Boolean),s={pattern:t,segments:l,target:n,title:a,templateNode:e},i=K(o);i&&i.contains(e)&&console.warn(`[ln-router] Route template with pattern "${t}" is declared inside its own outlet element:`,e),r.routes.set(t,s),r.sorted=Array.from(r.routes.values()).sort(_e)}function xe(e){const t=e.getAttribute(F);if(!t)return;const o=e.getAttribute("data-ln-route-target")||null||"__primary__",r=g.get(o);r&&(r.routes.delete(t),r.sorted=Array.from(r.routes.values()).sort(_e),r.routes.size===0&&g.delete(o))}function Ee(e){return this.dom=e,ke(e),this}return Ee.prototype.destroy=function(){xe(this.dom),delete this.dom[fe]},ce(F,fe,Ee,"ln-router",{attributes:dt,onInit:function(){g.size>0&&Se()}}),x.router=T,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
@@ -1 +1 @@
1
- (function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!C(o))return}e.apply(console,t)}}function T(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 z(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},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")&&!(o&&l.matches&&l.matches(o)))if(l.type==="checkbox")n&&i[l.name]===1?r[l.name]=l.checked:(r[l.name]||(r[l.name]=[]),l.checked&&r[l.name].push(l.value));else if(l.type==="radio")l.checked&&(r[l.name]=l.value);else if(l.type==="select-multiple"){r[l.name]=[];for(let a=0;a<l.options.length;a++)l.options[a].selected&&r[l.name].push(l.options[a].value)}else if(n&&l.type==="hidden")r[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const a=Number(l.value);r[l.name]=l.value===""||isNaN(a)?null:a}else r[l.name]=l.value}return r}function Y(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,o=[],r={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(r[i.name]=(r[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(r[i.name]>1){const a=String(l).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=Y(l);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let a=0;a<i.options.length;a++)i.options[a].selected=l.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=G);const N={};function ee(e,t){N[e]=t}function te(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function re(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=re,window.lnCore.ensureLocaleObserver=ne);const A={};function ie(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(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 o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<l.length;a++){const u=l[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let i=0;i<r.length;i++){const c=r[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 a=0;a<l.length;a++){const u=l[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const i=r[s],c=i.attributes;for(let l=0;l<c.length;l++){const a=c[l];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function se(e,t,n,o,r,s){const i={};for(let l=0;l<e.children.length;l++){const a=e.children[l],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const a=t[l],u=String(o(a));let d=i[u];if(d)r(d,a,l);else{const f=ie(n,s);if(!f||(q(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,a,l)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=F,window.lnCore.lnFill=le,window.lnCore.renderList=se);function v(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function B(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function k(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const x=new Map;function R(e,t){const n=(e?e.join("|"):"")+"::"+t;if(x.has(n))return x.get(n);const o=new Set(e||[]),r=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return x.set(n,r),r}function W(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function j(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(e,t,n,o,r){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{r?console.warn(l,r):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 ce(e,t,n){for(const o in n){const[r,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,s,i)},enumerable:!0,configurable:!0})}return e}function ae(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=R(o.values,o.fallback);break;case"integer":r=B;break;case"float":r=W;break;case"boolean":r=k;break;case"list":r=M;break;case"json":r=j;break;case"string":default:r=v;break}r||(r=v),t[o.prop]=[r,n,o.fallback]}return t}function ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function de(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=ce,window.lnCore.attrSpec=ae,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=k,window.lnCore.attrList=M,window.lnCore.attrEnum=R,window.lnCore.attrFloat=W,window.lnCore.attrJson=j);function S(e,t,n,o){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 o(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 fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function V(){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 he(e){const t=V(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).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 r=t.byDeclaredAttr.get(o);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=de(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function H(e,t,n,o){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=V(),r=o.byAttr.get(n);if(D()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&C(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)U(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&H(s,t,n,e.oldValue),o.reactiveWildcard.length&&H(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const i=r[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(S(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(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 K(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=K();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,s=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r];S(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r],i=s.query,c=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&c.push(o);for(let l=0;l<c.length;l++){const a=c[l];if(!document.contains(a)){const u=a[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",a,d)}delete a[s.attribute]}}}}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ge(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Q(e,t,n,o,r={}){const s=r.extraAttributes||[],i=r.onAttributeChange||null,c=r.onSubtreeChange||null,l=r.onInit||null,a=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?ue(d):u,h=d?new Set(Object.keys(d)):null,g=r.persist||null;function w(O){const p=O||document.body;if(S(p,e,t,n),d&&D())for(const m in d){const Le=d[m],E=Array.from(p.querySelectorAll("["+m+"]"));p.matches&&p.matches("["+m+"]")&&E.push(p);for(let I=0;I<E.length;I++){const L=E[I];C(L)&&U(Le,L.getAttribute(m),m,o,L)}}l&&l(p)}const b=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let p;for(;(p=O.exec(e))!==null;)b.push(p[1])}else b.push(e);he({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:l,observed:b.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:h,persist:g}),pe();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ie=r.subtreeQuery||(Ee?e:"["+e+"]");K().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:Ie}),me(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Q);function P(){fe()>0?we(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",P):P(),w}function J(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},o=J(t);if(!o)return n;const r=o.split("&");for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(a)}catch{n[l]=a}}return n}function ye(e){if(!e)return null;const t=_();return e in t?t[e]:null}function Ce(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");J(location.hash)!==r&&(location.hash=r)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(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 Se(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),r=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ce,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=ke,window.lnCore.hashSortDecode=xe,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=_e);function Oe(){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=Oe),(function(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const n={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function o(r){if(r[t])return r[t];if(!(!r||r.tagName!=="A"&&r.tagName!=="BUTTON"))return r[t]=this,this.dom=r,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}o.prototype._handleClick=function(r){if(this.dom.tagName==="A"&&(r.ctrlKey||r.metaKey||r.shiftKey||r.altKey||r.button!==0))return;let s=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(s||(s=(this.dom.getAttribute("href")||"").trim()),!s||s==="#")return;!s.startsWith("#")&&!s.startsWith(".")&&!s.startsWith("[")&&(s="#"+s);let i=null;try{i=document.querySelector(s)}catch{const g=s.replace(/^#/,"");i=document.getElementById(g)}if(!i)return;r.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const g=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(g);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(z(this.dom,"ln-scroll:before-scroll",{target:i,link:this.dom,href:s}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(i.scrollIntoView({behavior:a,block:u}),k(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",s)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),g=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=i.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&i.getAttribute("tabindex")!==null&&(w=i),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},g)}T(this.dom,"ln-scroll:scrolled",{target:i,link:this.dom,href:s})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},Q(e,t,o,"ln-scroll",{attributes:n})})()})();
1
+ (function(){"use strict";function T(){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 A(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 n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){o=t[n];break}if(!A(o))return}e.apply(console,t)}}function F(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Y(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(n),n}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),o=t&&t.exclude,n={},s=e.elements,l={};if(i)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")i&&l[r.name]===1?n[r.name]=r.checked:(n[r.name]||(n[r.name]=[]),r.checked&&n[r.name].push(r.value));else if(r.type==="radio")r.checked&&(n[r.name]=r.value);else if(r.type==="select-multiple"){n[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&n[r.name].push(r.options[a].value)}else if(i&&r.type==="hidden")n[r.name]=r.value;else if(i&&(r.type==="number"||r.type==="range")){const a=Number(r.value);n[r.name]=r.value===""||isNaN(a)?null:a}else n[r.name]=r.value}return n}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const i=e.elements,o=[],n={};for(let s=0;s<i.length;s++){const l=i[s];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<i.length;s++){const l=i[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(n[l.name]>1){const a=String(r).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=te(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 a=0;a<l.options.length;a++)l.options[a].selected=r.indexOf(l.options[a].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=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const N={};function oe(e,t){N[e]=t}function re(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=re);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];$[i]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ce(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=v[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const u=r[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const u=r[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}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 i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<i.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[o],t??null),i[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)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function M(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const s=i.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let s=0;s<n.length;s++){const l=n[s],c=l.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ue(e,t,i,o,n,s){const l={};for(let r=0;r<e.children.length;r++){const a=e.children[r],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],u=String(o(a));let d=l[u];if(d)n(d,a,r);else{const f=ce(i,s);if(!f||(M(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),n(d,a,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=ue);function k(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function R(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function x(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const n=o.trim().toLowerCase();return!(n==="false"||n==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const S=new Map;function j(e,t){const i=(e?e.join("|"):"")+"::"+t;if(S.has(i))return S.get(i);const o=new Set(e||[]),n=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return S.set(i,n),n}function U(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function V(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function H(e,t,i,o,n){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{n?console.warn(r,n):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${i}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${i}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,i){for(const o in i){const[n,s,l]=i[o];Object.defineProperty(e,o,{get:function(){return n(t,s,l)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let n=o.read;if(!n&&o.type)switch(o.type){case"enum":n=j(o.values,o.fallback);break;case"integer":n=R;break;case"float":n=U;break;case"boolean":n=x;break;case"list":n=W;break;case"json":n=V;break;case"string":default:n=k;break}n||(n=k),t[o.prop]=[n,i,o.fallback]}return t}function we(e){const t={};for(const i in e){const o=e[i];o&&o.effect&&(t[i]=o.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=de,window.lnCore.attrSpec=fe,window.lnCore.attrStr=k,window.lnCore.attrInt=R,window.lnCore.attrBool=x,window.lnCore.attrList=W,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function K(e,t,i,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(s)&&m(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)m(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(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 Q(){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 ge(e){const t=Q(),i=e.observed||[];for(let o=0;o<i.length;o++){const n=i[o];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).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 n=t.byDeclaredAttr.get(o);n.some(s=>s.componentTag===e.componentTag)||n.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=he(e);if(o===null)t.reactiveWildcard.push(e);else for(const n of o)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,o){for(let n=0;n<e.length;n++){const s=e[n];if(!t[s.attribute])continue;const l=s.effects&&s.effects[i];l?l(t,i,o):s.onAttrChange&&(!s.declared||s.declared.has(i))&&s.onAttrChange(t,i,o)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=Q(),n=o.byAttr.get(t),s=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!n&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&A(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let a=0;a<c.length;a++)H(c[a].spec,r,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(i||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const c=o.byReactive.get(t);c&&J(c,l,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,l,t,e.oldValue)}if(n)for(let c=0;c<n.length;c++){const r=n[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(K(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(t[i])}catch(o){console.error("[ln-core] mutation handler failed",t[i].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ce(e){const t=_();if(!t.length)return;const i=e.target;if(i){const o=i.nodeType===1?i:i.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 n=t[o];if(n.onSubtreeChange&&n.query){const s=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;l&&n.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l];if(c.selector&&c.attribute&&c.ComponentFn){if(!s)n.matches&&n.matches(c.query)&&m(n,c);else if(n.matches&&n.matches(c.query)&&m(n,c),n.querySelectorAll){const r=n.querySelectorAll(c.query);for(let a=0;a<r.length;a++)m(r[a],c)}}c.onInit&&c.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l],r=c.query;if(r){if(!s)n.matches&&n.matches(r)&&E(n,c);else if(n.matches&&n.matches(r)&&E(n,c),n.querySelectorAll){const a=n.querySelectorAll(r);for(let u=0;u<a.length;u++)E(a[u],c)}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{Ce(o)}catch(n){console.error("[ln-core] lifecycle handler failed",o.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){_().push(e),P()}function z(e,t,i,o,n={}){const s=n.extraAttributes||[],l=n.onAttributeChange||null,c=n.onSubtreeChange||null,r=n.onInit||null,a=n.onAttrChange||null,u=n.effects||null,d=n.attributes||null,f=d?we(d):u,h=d?new Set(Object.keys(d)):null,g=n.persist||null;function w(D){const p=D||document.body;if(K(p,e,t,i),d&&T())for(const y in d){const Te=d[y],L=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&L.push(p);for(let I=0;I<L.length;I++){const q=L[I];A(q)&&H(Te,q.getAttribute(y),y,o,q)}}r&&r(p)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let p;for(;(p=D.exec(e))!==null;)b.push(p[1])}else b.push(e);ge({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:i,onInit:r,observed:b.concat(s),onAttributeChange:l,onAttrChange:a,effects:f,declared:h,persist:g}),ye();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=n.subtreeQuery||(Ie?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:i,onInit:r,onSubtreeChange:c,query:qe}),P(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ae);function X(){be()>0?pe(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),w}function G(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,i={},o=G(t);if(!o)return i;const n=o.split("&");for(let s=0;s<n.length;s++){const l=n[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(r)try{i[r]=decodeURIComponent(a)}catch{i[r]=a}}return i}function ve(e){if(!e)return null;const t=O();return e in t?t[e]:null}function ke(e,t){if(!e)return;const i=O();t==null?delete i[e]:i[e]=String(t);const n=Object.keys(i).map(function(s){const l=i[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");G(location.hash)!==n&&(location.hash=n)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function _e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),o=e.slice(t+1),n=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:i,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ve,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=_e,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=De);function Le(){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=Le),(function(){const e="data-ln-scroll",t="lnScroll";if(window[t]!==void 0)return;const i={"data-ln-scroll":{effect:null,type:"string",description:"Target element ID or CSS selector to scroll into view"},"data-ln-scroll-behavior":{effect:null,type:"enum",values:["smooth","auto"],fallback:"smooth",description:"Scroll animation behavior transition"},"data-ln-scroll-block":{effect:null,type:"enum",values:["start","center","end","nearest"],fallback:"start",description:"Vertical alignment positioning of scrolled target"},"data-ln-scroll-set":{effect:null,type:"string",description:"Optional state attribute assignment on target after scroll (e.g. data-ln-toggle=open)"},"data-ln-scroll-focus":{effect:null,type:"string",description:'CSS selector of element to focus after scroll, or "false" to disable'},"data-ln-scroll-delay":{effect:null,type:"integer",fallback:450,min:0,description:"Delay in milliseconds before shifting keyboard focus"},"data-ln-scroll-update-hash":{effect:null,type:"boolean",fallback:!1,description:"Whether to update URL hash with target ID"}};function o(n){if(n[t])return n[t];if(!(!n||n.tagName!=="A"&&n.tagName!=="BUTTON"))return n[t]=this,this.dom=n,this._handleClick=this._handleClick.bind(this),this.dom.addEventListener("click",this._handleClick),this}o.prototype._handleClick=function(n){if(this.dom.tagName==="A"&&(n.ctrlKey||n.metaKey||n.shiftKey||n.altKey||n.button!==0))return;let s=(this.dom.getAttribute("data-ln-scroll")||"").trim();if(s||(s=(this.dom.getAttribute("href")||"").trim()),!s||s==="#")return;!s.startsWith("#")&&!s.startsWith(".")&&!s.startsWith("[")&&(s="#"+s);let l=null;try{l=document.querySelector(s)}catch{const g=s.replace(/^#/,"");l=document.getElementById(g)}if(!l)return;n.preventDefault();const c=this.dom.getAttribute("data-ln-scroll-set");if(c){const h=c.indexOf(":");if(h!==-1){const g=c.slice(0,h).trim(),w=c.slice(h+1).trim();try{const b=document.querySelector(g);b&&(b.value=w,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})))}catch{}}}if(Y(this.dom,"ln-scroll:before-scroll",{target:l,link:this.dom,href:s}).defaultPrevented)return;const a=this.dom.getAttribute("data-ln-scroll-behavior")||"smooth",u=this.dom.getAttribute("data-ln-scroll-block")||"start";if(l.scrollIntoView({behavior:a,block:u}),x(this.dom,"data-ln-scroll-update-hash",!1))try{window.history&&window.history.pushState&&window.history.pushState(null,"",s)}catch{}const f=this.dom.getAttribute("data-ln-scroll-focus");if(f!=="false"&&f!=="0"){const h=parseInt(this.dom.getAttribute("data-ln-scroll-delay"),10),g=isNaN(h)?450:h;window.setTimeout(function(){let w=null;if(f&&f!=="true"&&f!=="1")try{w=document.querySelector(f)}catch{}w||(w=l.querySelector('input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])')),!w&&l.getAttribute("tabindex")!==null&&(w=l),w&&typeof w.focus=="function"&&w.focus({preventScroll:!0})},g)}F(this.dom,"ln-scroll:scrolled",{target:l,link:this.dom,href:s})},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("click",this._handleClick),delete this.dom[t])},z(e,t,o,"ln-scroll",{attributes:i})})()})();