@livenetworks/ashlar 2.1.7 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/README.md +25 -0
- package/components/ln-core/index.js +1 -0
- package/components/ln-core/ln-core.schema.json +14 -4
- package/components/ln-core/query.js +113 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/README.md +4 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/src/generated-attributes.js +1 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-filter/README.md +1 -0
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +8 -0
- package/components/ln-filter/src/ln-filter.js +67 -2
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/README.md +1 -0
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +8 -0
- package/components/ln-search/src/ln-search.js +54 -2
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/README.md +1 -0
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +112 -104
- package/components/ln-sort/src/ln-sort.js +78 -3
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/ln-sortable.schema.json +38 -36
- package/components/ln-sortable/ln-sortable.scss +25 -0
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/README.md +1 -0
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +4 -0
- package/package.json +1 -1
- package/theme/components/_sortable.scss +19 -0
- package/theme/components/_table.scss +1 -0
- package/theme/config/mixins/_chart.scss +1 -0
- package/theme/config/mixins/_dropdown.scss +1 -0
- package/theme/config/mixins/_modal.scss +1 -0
- package/theme/config/mixins/_picklist.scss +1 -0
- package/theme/config/mixins/_popover.scss +1 -0
- package/theme/config/mixins/_position.scss +1 -1
- package/theme/config/mixins/_sidebar.scss +1 -0
- package/theme/config/mixins/_stat-card.scss +1 -0
- package/theme/config/mixins/_timeline.scss +2 -0
- package/theme/config/mixins/_toast.scss +4 -2
- package/theme/ln-ashlar-core.scss +1 -0
- package/theme/ln-ashlar-theme.scss +1 -0
- package/web-types.json +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function M(){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 s=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){s=t[i];break}if(!E(s))return}e.apply(console,t)}}function S(e,t,o){const s=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}function j(e,t,o){const s=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:s});return e.dispatchEvent(i),i}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const o=!!(t&&t.typed),s=t&&t.exclude,i={},l=e.elements,r={};if(o)for(let c=0;c<l.length;c++){const n=l[c];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let c=0;c<l.length;c++){const n=l[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(s&&n.matches&&n.matches(s)))if(n.type==="checkbox")o&&r[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&i[n.name].push(n.options[u].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const u=Number(n.value);i[n.name]=n.value===""||isNaN(u)?null:u}else i[n.name]=n.value}return i}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const o=e.elements,s=[],i={};for(let l=0;l<o.length;l++){const r=o[l];r.name&&r.type==="checkbox"&&(i[r.name]=(i[r.name]||0)+1)}for(let l=0;l<o.length;l++){const r=o[l];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const n=t[c];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(i[r.name]>1){const u=String(n).split(",").map(function(p){return p.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=ue(n);s.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),s.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<r.options.length;u++)r.options[u].selected=n.indexOf(r.options[u].value)!==-1;s.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),s.push(r)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=le);const W={};function de(e,t){W[e]=t}function fe(e){return W[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=fe);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){S(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function he(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];P[o]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=pe);const O={};function ge(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=O[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const c=o[r],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const s=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<s.length;r++){const c=s[r],n=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const p=n[u].trim().split(":");if(p.length!==2)continue;const f=p[0].trim(),a=p[1].trim();t[a]!=null&&c.setAttribute(f,t[a])}}const i=e.querySelectorAll("[data-ln-show]");for(let r=0;r<i.length;r++){const c=i[r],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let r=0;r<l.length;r++){const c=l[r],n=c.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const p=n[u].trim().split(":");if(p.length!==2)continue;const f=p[0].trim(),a=p[1].trim();a in t&&c.classList.toggle(f,!!t[a])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<o.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[s],t??null),o[s].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)H(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function V(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const s=function(l,r){return t[r]!==void 0?t[r]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const r=i[l],c=r.attributes;for(let n=0;n<c.length;n++){const u=c[n];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return e}function me(e,t,o,s,i,l){const r={};for(let n=0;n<e.children.length;n++){const u=e.children[n],p=u.getAttribute("data-ln-render-key");p&&(r[p]=u)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],p=String(s(u));let f=r[p];if(f)i(f,u,n);else{const a=ge(o,l);if(!a||(V(a,u),f=a.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",p),i(f,u,n)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=H,window.lnCore.lnFill=be,window.lnCore.renderList=me);function L(e,t,o){const s=e.getAttribute(t);return s===null?o:s}function U(e,t,o){const s=parseInt(e.getAttribute(t),10);return isNaN(s)?o:s}function K(e,t,o=!1){const s=e.getAttribute(t);if(s===null)return!!o;const i=s.trim().toLowerCase();return!(i==="false"||i==="0")}function Q(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const T=new Map;function z(e,t){const o=(e?e.join("|"):"")+"::"+t;if(T.has(o))return T.get(o);const s=new Set(e||[]),i=function(l,r){const c=l.getAttribute(r);return c!==null&&s.has(c)?c:t};return T.set(o,i),i}function J(e,t,o){const s=parseFloat(e.getAttribute(t));return isNaN(s)?o:s}function G(e,t,o){const s=e.getAttribute(t);if(!s)return o;try{return JSON.parse(s)}catch{return o}}function X(e,t,o,s,i){if(!e||t===null)return!0;const l=s||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${l}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${l}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${l}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,o){for(const s in o){const[i,l,r]=o[s];Object.defineProperty(e,s,{get:function(){return i(t,l,r)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const o in e){const s=e[o];if(!s||!s.prop)continue;let i=s.read;if(!i&&s.type)switch(s.type){case"enum":i=z(s.values,s.fallback);break;case"integer":i=U;break;case"float":i=J;break;case"boolean":i=K;break;case"list":i=Q;break;case"json":i=G;break;case"string":default:i=L;break}i||(i=L),t[s.prop]=[i,o,s.fallback]}return t}function ve(e){const t={};for(const o in e){const s=e[o];s&&s.effect&&(t[o]=s.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=L,window.lnCore.attrInt=U,window.lnCore.attrBool=K,window.lnCore.attrList=Q,window.lnCore.attrEnum=z,window.lnCore.attrFloat=J,window.lnCore.attrJson=G);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Y(e,t,o,s){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:s};if(e.matches&&e.matches(l)&&A(e,r),e.querySelectorAll){const c=e.querySelectorAll(l);for(let n=0;n<c.length;n++)A(c[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function xe(e){const t=Z(),o=e.observed||[];for(let s=0;s<o.length;s++){const i=o[s];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const s in e.attributes){t.byDeclaredAttr.has(s)||t.byDeclaredAttr.set(s,[]);const i=t.byDeclaredAttr.get(s);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[s],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const s=_e(e);if(s===null)t.reactiveWildcard.push(e);else for(const i of s)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,o,s){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const r=l.effects&&l.effects[o];r?r(t,o,s):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,s)}}function Ee(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,s=Z(),i=s.byAttr.get(t),l=M()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(t);if(!o&&!i&&!l)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(l&&E(r)){const c=s.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let u=0;u<c.length;u++)X(c[u].spec,n,t,c[u].componentTag,r)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const c=s.byReactive.get(t);c&&ee(c,r,t,e.oldValue),s.reactiveWildcard.length&&ee(s.reactiveWildcard,r,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(Y(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ee(t[o])}catch(s){console.error("[ln-core] mutation handler failed",t[o].target,s)}}).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 q(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function D(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(s){console.error("["+t.attribute+"] destroy failed",e,s)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=R();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const s=q();if(e.target&&s.length)for(let i=0;i<s.length;i++){const l=s[i],r=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const r=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)l.matches&&l.matches(n.query)&&A(l,n);else if(l.matches&&l.matches(n.query)&&A(l,n),l.querySelectorAll){const u=l.querySelectorAll(n.query);for(let p=0;p<u.length;p++)A(u[p],n)}}n.onInit&&n.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const r=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const n=t[c],u=n.query;if(u){if(!r)l.matches&&l.matches(u)&&D(l,n);else if(l.matches&&l.matches(u)&&D(l,n),l.querySelectorAll){const p=l.querySelectorAll(u);for(let f=0;f<p.length;f++)D(p[f],n)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){const e=new MutationObserver(function(t){for(let o=0;o<t.length;o++){const s=t[o];if(s.type==="childList")try{te(s)}catch(i){console.error("[ln-core] lifecycle handler failed",s.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const o=t.takeRecords();for(let s=0;s<o.length;s++){const i=o[s];if(i.type==="childList")try{te(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Le(e){R().push(e),e.onSubtreeChange&&e.query&&q().push(e),ne()}function I(e,t,o,s,i={}){const l=i.extraAttributes||[],r=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,u=i.onAttrChange||null,p=i.effects||null,f=i.attributes||null,a=f?ve(f):p,h=f?new Set(Object.keys(f)):null,w=i.persist||null;function b(v){const y=v||document.body;if(Y(y,e,t,o),f&&M())for(const k in f){const Me=f[k],$=Array.from(y.querySelectorAll("["+k+"]"));y.matches&&y.matches("["+k+"]")&&$.push(y);for(let N=0;N<$.length;N++){const B=$[N];E(B)&&X(Me,B.getAttribute(k),k,s,B)}}n&&n(y)}const d=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let y;for(;(y=v.exec(e))!==null;)d.push(y[1])}else d.push(e);xe({selector:e,attribute:t,componentTag:s,attributes:f,ComponentFn:o,onInit:n,observed:d.concat(l),onAttributeChange:r,onAttrChange:u,effects:a,declared:h,persist:w}),Se();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,_=i.subtreeQuery||(C?e:"["+e+"]"),g={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:_};R().push(g),c&&_&&q().push(g),ne(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=I,window.lnCore.observeLifecycle=Le,window.lnCore.withoutLifecycle=Oe);function m(){Ae()>0?ke(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m(),b}function oe(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,o={},s=oe(t);if(!s)return o;const i=s.split("&");for(let l=0;l<i.length;l++){const r=i[l];if(!r)continue;const c=r.indexOf(":"),n=c>-1?r.slice(0,c):r,u=c>-1?r.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(u)}catch{o[n]=u}}return o}function Te(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Re(e,t){if(!e)return;const o=F();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(l){const r=o[l];return r===""?l:l+":"+encodeURIComponent(r)}).join("&");oe(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const s=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return s?t?s+"-"+t:s:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ne(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),s=e.slice(t+1),i=s?s.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Te,window.lnCore.hashSet=Re,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Ne);function ie(e,t,o,s){const i=s,l=window.innerWidth,r=window.innerHeight,c=t.width,n=t.height,u=(o||"bottom").split("-"),p=u[0],f=u[1]==="start"||u[1]==="end"?u[1]:"center",a={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},h=a[p]||a.bottom;function w(g){return g==="top"||g==="bottom"?f==="start"?e.left:f==="end"?e.right-c:e.left+(e.width-c)/2:f==="start"?e.top:f==="end"?e.bottom-n:e.top+(e.height-n)/2}function b(g){let m,v,y=!0;return g==="top"?(m=e.top-i-n,v=w(g),m<0&&(y=!1)):g==="bottom"?(m=e.bottom+i,v=w(g),m+n>r&&(y=!1)):g==="left"?(m=w(g),v=e.left-i-c,v<0&&(y=!1)):(m=w(g),v=e.right+i,v+c>l&&(y=!1)),{top:m,left:v,side:g,fits:y}}let d=null;for(let g=0;g<h.length;g++){const m=b(h[g]);if(m.fits){d=m;break}}d||(d=b(h[0]));let C=d.top,_=d.left;return c>=l?_=0:(_<0&&(_=0),_+c>l&&(_=l-c)),n>=r?C=0:(C<0&&(C=0),C+n>r&&(C=r-n)),{top:C,left:_,placement:d.side}}function re(e){if(!e)return{width:0,height:0};const t=e.style,o=t.visibility,s=t.display,i=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const l=e.offsetWidth,r=e.offsetHeight;return t.visibility=o,t.display=s,t.position=i,{width:l,height:r}}function Be(){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=Be),(function(){const e="data-ln-popover",t="lnPopover",o="data-ln-popover-for",s="data-ln-popover-position";if(window[t]!==void 0)return;const i={"data-ln-popover":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the popover"},"data-ln-popover-for":{type:"string",description:"Target element ID that this trigger controls"},"data-ln-popover-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"bottom",description:"Preferred positioning anchor"},"data-ln-popover-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}},l=[];let r=null;function c(){r||(r=function(a){if(a.key!=="Escape"||l.length===0)return;l[l.length-1].close()},document.addEventListener("keydown",r))}function n(){l.length>0||r&&(document.removeEventListener("keydown",r),r=null)}function u(a){this.dom=a,this.isOpen=a.getAttribute(e)==="open",this.trigger=null,this._previousFocus=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundReposition=null;const h=this;return this._onRequestOpen=function(w){const b=w.detail&&w.detail.trigger?w.detail.trigger:null;h.open(b)},this._onRequestClose=function(){h.close()},this._onRequestToggle=function(w){const b=w.detail&&w.detail.trigger?w.detail.trigger:null;h.toggle(b)},this._onNativeToggle=function(w){w.newState==="closed"&&h.isOpen&&(h._applyClose(),h.dom.setAttribute(e,"closed"))},a.addEventListener("ln-popover:request-open",this._onRequestOpen),a.addEventListener("ln-popover:request-close",this._onRequestClose),a.addEventListener("ln-popover:request-toggle",this._onRequestToggle),a.addEventListener("toggle",this._onNativeToggle),a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.hasAttribute("role")||a.setAttribute("role","dialog"),a.hasAttribute("popover")||a.setAttribute("popover","manual"),this.isOpen&&this._applyOpen(null),this}u.prototype.open=function(a){this.isOpen||(this.trigger=a||null,this.dom.setAttribute(e,"open"))},u.prototype.close=function(){this.isOpen&&this.dom.setAttribute(e,"closed")},u.prototype.toggle=function(a){this.isOpen?this.close():this.open(a)},u.prototype._applyOpen=function(a){this.isOpen=!0,a&&(this.trigger=a),this._previousFocus=document.activeElement,typeof this.dom.showPopover=="function"&&this.dom.showPopover();const h=re(this.dom);if(this.trigger){const C=this.trigger.getBoundingClientRect(),_=this.dom.getAttribute(s)||"bottom",g=ie(C,h,_,8);this.dom.style.top=g.top+"px",this.dom.style.left=g.left+"px",this.dom.setAttribute("data-ln-popover-placement",g.placement),this.trigger.setAttribute("aria-expanded","true")}const w=this.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),b=Array.prototype.find.call(w,se);b?b.focus():this.dom.focus();const d=this;this._boundDocClick=function(C){d.dom.contains(C.target)||d.trigger&&d.trigger.contains(C.target)||d.close()},d._docClickTimeout=setTimeout(function(){d._docClickTimeout=null,document.addEventListener("click",d._boundDocClick)},0),this._repositionRaf=null,this._performReposition=function(){if(!d.trigger||!document.contains(d.dom))return;const C=d.trigger.getBoundingClientRect(),_=re(d.dom),g=d.dom.getAttribute(s)||"bottom",m=ie(C,_,g,8),v=m.top+"px",y=m.left+"px";d.dom.style.top!==v&&(d.dom.style.top=v),d.dom.style.left!==y&&(d.dom.style.left=y),d.dom.getAttribute("data-ln-popover-placement")!==m.placement&&d.dom.setAttribute("data-ln-popover-placement",m.placement)},this._boundReposition=function(){d._repositionRaf||(d._repositionRaf=requestAnimationFrame(function(){d._repositionRaf=null,d._performReposition()}))},window.addEventListener("scroll",this._boundReposition,{passive:!0,capture:!0}),window.addEventListener("resize",this._boundReposition),l.push(this),c(),S(this.dom,"ln-popover:open",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger})},u.prototype._applyClose=function(){this.isOpen=!1,this._repositionRaf&&(cancelAnimationFrame(this._repositionRaf),this._repositionRaf=null),this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null),this._boundReposition&&(window.removeEventListener("scroll",this._boundReposition,{capture:!0}),window.removeEventListener("resize",this._boundReposition),this._boundReposition=null),this.dom.style.top="",this.dom.style.left="",this.dom.removeAttribute("data-ln-popover-placement"),this.trigger&&this.trigger.setAttribute("aria-expanded","false"),typeof this.dom.hidePopover=="function"&&this.dom.matches(":popover-open")&&this.dom.hidePopover();const a=l.indexOf(this);a!==-1&&l.splice(a,1),n(),this._previousFocus&&this.trigger&&this._previousFocus===this.trigger?this.trigger.focus():this.trigger&&document.activeElement===document.body&&this.trigger.focus(),this._previousFocus=null,S(this.dom,"ln-popover:close",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger}),this.trigger=null},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-popover:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-popover:request-close",this._onRequestClose),this.dom.removeEventListener("ln-popover:request-toggle",this._onRequestToggle),this.dom.removeEventListener("toggle",this._onNativeToggle),this.isOpen&&this._applyClose(),delete this.dom[t])};function p(a){this.dom=a;const h=a.getAttribute(o);return a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",h),this._onClick=function(w){if(w.ctrlKey||w.metaKey||w.button===1)return;w.preventDefault();const b=document.getElementById(h);if(!b)return;b[t]&&(b[t].trigger=a);const d=b.getAttribute(e);b.setAttribute(e,d==="open"?"closed":"open")},a.addEventListener("click",this._onClick),this}p.prototype.destroy=function(){this.dom.removeEventListener("click",this._onClick),delete this.dom[t+"Trigger"]};function f(a){const h=a[t];if(!h)return;const b=a.getAttribute(e)==="open";if(b!==h.isOpen)if(b){if(j(a,"ln-popover:before-open",{popoverId:a.id,target:a,trigger:h.trigger}).defaultPrevented){a.setAttribute(e,"closed");return}h._applyOpen(h.trigger)}else{if(j(a,"ln-popover:before-close",{popoverId:a.id,target:a,trigger:h.trigger}).defaultPrevented){a.setAttribute(e,"open");return}h._applyClose()}}I(e,t,u,"ln-popover",{attributes:i}),I(o,t+"Trigger",p,"ln-popover-trigger")})()})();
|
|
1
|
+
(function(){"use strict";function M(){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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];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 j(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},l=e.elements,s={};if(n)for(let c=0;c<l.length;c++){const o=l[c];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<l.length;c++){const o=l[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&s[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&i[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);i[o.name]=o.value===""||isNaN(u)?null:u}else i[o.name]=o.value}return i}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const n=e.elements,r=[],i={};for(let l=0;l<n.length;l++){const s=n[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<n.length;l++){const s=n[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const o=t[c];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(i[s.name]>1){const u=String(o).split(",").map(function(p){return p.trim()});s.checked=u.indexOf(s.value)!==-1}else s.checked=ue(o);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<s.options.length;u++)s.options[u].selected=o.indexOf(s.options[u].value)!==-1;r.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),r.push(s)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=le);const W={};function ae(e,t){W[e]=t}function fe(e){return W[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=fe);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function he(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];P[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=he,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=pe);const O={};function ge(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 U(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const c=r[s],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const p=o[u].trim().split(":");if(p.length!==2)continue;const f=p[0].trim(),d=p[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const c=l[s],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const p=o[u].trim().split(":");if(p.length!==2)continue;const f=p[0].trim(),d=p[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function H(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],c=s.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&s.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function me(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const u=e.children[o],p=u.getAttribute("data-ln-render-key");p&&(s[p]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],p=String(r(u));let f=s[p];if(f)i(f,u,o);else{const d=ge(n,l);if(!d||(H(d,u),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",p),i(f,u,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=H,window.lnCore.fill=U,window.lnCore.lnFill=be,window.lnCore.renderList=me);function L(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function V(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function G(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const r=new Set(e||[]),i=function(l,s){const c=l.getAttribute(s);return c!==null&&r.has(c)?c:t};return q.set(n,i),i}function z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function X(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,n){for(const r in n){const[i,l,s]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=G(r.values,r.fallback);break;case"integer":i=V;break;case"float":i=z;break;case"boolean":i=Q;break;case"list":i=K;break;case"json":i=J;break;case"string":default:i=L;break}i||(i=L),t[r.prop]=[i,n,r.fallback]}return t}function ve(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=L,window.lnCore.attrInt=V,window.lnCore.attrBool=Q,window.lnCore.attrList=K,window.lnCore.attrEnum=G,window.lnCore.attrFloat=z,window.lnCore.attrJson=J);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Y(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(l)&&A(e,s),e.querySelectorAll){const c=e.querySelectorAll(l);for(let o=0;o<c.length;o++)A(c[o],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function xe(e){const t=Z(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function Se(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Z(),i=r.byAttr.get(t),l=M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&S(s)){const c=r.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let u=0;u<c.length;u++)X(c[u].spec,o,t,c[u].componentTag,s)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ee(c,s,t,e.oldValue),r.reactiveWildcard.length&&ee(r.reactiveWildcard,s,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(Y(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function T(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function D(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=R();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=T();if(e.target&&r.length)for(let i=0;i<r.length;i++){const l=r[i],s=l.query,c=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;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!s)l.matches&&l.matches(o.query)&&A(l,o);else if(l.matches&&l.matches(o.query)&&A(l,o),l.querySelectorAll){const u=l.querySelectorAll(o.query);for(let p=0;p<u.length;p++)A(u[p],o)}}o.onInit&&o.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c],u=o.query;if(u){if(!s)l.matches&&l.matches(u)&&D(l,o);else if(l.matches&&l.matches(u)&&D(l,o),l.querySelectorAll){const p=l.querySelectorAll(u);for(let f=0;f<p.length;f++)D(p[f],o)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{te(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{te(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Le(e){R().push(e),e.onSubtreeChange&&e.query&&T().push(e),ne()}function I(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,u=i.onAttrChange||null,p=i.effects||null,f=i.attributes||null,d=f?ve(f):p,h=f?new Set(Object.keys(f)):null,w=i.persist||null;function b(v){const y=v||document.body;if(Y(y,e,t,n),f&&M())for(const k in f){const Ge=f[k],$=Array.from(y.querySelectorAll("["+k+"]"));y.matches&&y.matches("["+k+"]")&&$.push(y);for(let N=0;N<$.length;N++){const B=$[N];S(B)&&X(Ge,B.getAttribute(k),k,r,B)}}o&&o(y)}const a=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let y;for(;(y=v.exec(e))!==null;)a.push(y[1])}else a.push(e);xe({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:a.concat(l),onAttributeChange:s,onAttrChange:u,effects:d,declared:h,persist:w}),Ee();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,_=i.subtreeQuery||(C?e:"["+e+"]"),g={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:_};R().push(g),c&&_&&T().push(g),ne(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=I,window.lnCore.observeLifecycle=Le,window.lnCore.withoutLifecycle=Oe);function m(){Ae()>0?ke(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m(),b}function oe(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const c=s.indexOf(":"),o=c>-1?s.slice(0,c):s,u=c>-1?s.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function qe(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Re(e,t){if(!e)return;const n=F();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==i&&(location.hash=i)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ne(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=qe,window.lnCore.hashSet=Re,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Ne);function Be(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Be(t);if(!r)return n;const i=new URLSearchParams(r);for(const[l,s]of i.entries())n[l]=s;return n}function je(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function We(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function Pe(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function Ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ve(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Qe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=je,window.lnCore.querySet=We,window.lnCore.resolveQueryParam=Pe,window.lnCore.querySortEncode=Ue,window.lnCore.querySortDecode=He,window.lnCore.queryFilterEncode=Ve,window.lnCore.queryFilterDecode=Qe);function re(e,t,n,r){const i=r,l=window.innerWidth,s=window.innerHeight,c=t.width,o=t.height,u=(n||"bottom").split("-"),p=u[0],f=u[1]==="start"||u[1]==="end"?u[1]:"center",d={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},h=d[p]||d.bottom;function w(g){return g==="top"||g==="bottom"?f==="start"?e.left:f==="end"?e.right-c:e.left+(e.width-c)/2:f==="start"?e.top:f==="end"?e.bottom-o:e.top+(e.height-o)/2}function b(g){let m,v,y=!0;return g==="top"?(m=e.top-i-o,v=w(g),m<0&&(y=!1)):g==="bottom"?(m=e.bottom+i,v=w(g),m+o>s&&(y=!1)):g==="left"?(m=w(g),v=e.left-i-c,v<0&&(y=!1)):(m=w(g),v=e.right+i,v+c>l&&(y=!1)),{top:m,left:v,side:g,fits:y}}let a=null;for(let g=0;g<h.length;g++){const m=b(h[g]);if(m.fits){a=m;break}}a||(a=b(h[0]));let C=a.top,_=a.left;return c>=l?_=0:(_<0&&(_=0),_+c>l&&(_=l-c)),o>=s?C=0:(C<0&&(C=0),C+o>s&&(C=s-o)),{top:C,left:_,placement:a.side}}function ie(e){if(!e)return{width:0,height:0};const t=e.style,n=t.visibility,r=t.display,i=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const l=e.offsetWidth,s=e.offsetHeight;return t.visibility=n,t.display=r,t.position=i,{width:l,height:s}}function Ke(){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=Ke),(function(){const e="data-ln-popover",t="lnPopover",n="data-ln-popover-for",r="data-ln-popover-position";if(window[t]!==void 0)return;const i={"data-ln-popover":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the popover"},"data-ln-popover-for":{type:"string",description:"Target element ID that this trigger controls"},"data-ln-popover-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"bottom",description:"Preferred positioning anchor"},"data-ln-popover-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}},l=[];let s=null;function c(){s||(s=function(d){if(d.key!=="Escape"||l.length===0)return;l[l.length-1].close()},document.addEventListener("keydown",s))}function o(){l.length>0||s&&(document.removeEventListener("keydown",s),s=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open",this.trigger=null,this._previousFocus=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundReposition=null;const h=this;return this._onRequestOpen=function(w){const b=w.detail&&w.detail.trigger?w.detail.trigger:null;h.open(b)},this._onRequestClose=function(){h.close()},this._onRequestToggle=function(w){const b=w.detail&&w.detail.trigger?w.detail.trigger:null;h.toggle(b)},this._onNativeToggle=function(w){w.newState==="closed"&&h.isOpen&&(h._applyClose(),h.dom.setAttribute(e,"closed"))},d.addEventListener("ln-popover:request-open",this._onRequestOpen),d.addEventListener("ln-popover:request-close",this._onRequestClose),d.addEventListener("ln-popover:request-toggle",this._onRequestToggle),d.addEventListener("toggle",this._onNativeToggle),d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.hasAttribute("role")||d.setAttribute("role","dialog"),d.hasAttribute("popover")||d.setAttribute("popover","manual"),this.isOpen&&this._applyOpen(null),this}u.prototype.open=function(d){this.isOpen||(this.trigger=d||null,this.dom.setAttribute(e,"open"))},u.prototype.close=function(){this.isOpen&&this.dom.setAttribute(e,"closed")},u.prototype.toggle=function(d){this.isOpen?this.close():this.open(d)},u.prototype._applyOpen=function(d){this.isOpen=!0,d&&(this.trigger=d),this._previousFocus=document.activeElement,typeof this.dom.showPopover=="function"&&this.dom.showPopover();const h=ie(this.dom);if(this.trigger){const C=this.trigger.getBoundingClientRect(),_=this.dom.getAttribute(r)||"bottom",g=re(C,h,_,8);this.dom.style.top=g.top+"px",this.dom.style.left=g.left+"px",this.dom.setAttribute("data-ln-popover-placement",g.placement),this.trigger.setAttribute("aria-expanded","true")}const w=this.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),b=Array.prototype.find.call(w,se);b?b.focus():this.dom.focus();const a=this;this._boundDocClick=function(C){a.dom.contains(C.target)||a.trigger&&a.trigger.contains(C.target)||a.close()},a._docClickTimeout=setTimeout(function(){a._docClickTimeout=null,document.addEventListener("click",a._boundDocClick)},0),this._repositionRaf=null,this._performReposition=function(){if(!a.trigger||!document.contains(a.dom))return;const C=a.trigger.getBoundingClientRect(),_=ie(a.dom),g=a.dom.getAttribute(r)||"bottom",m=re(C,_,g,8),v=m.top+"px",y=m.left+"px";a.dom.style.top!==v&&(a.dom.style.top=v),a.dom.style.left!==y&&(a.dom.style.left=y),a.dom.getAttribute("data-ln-popover-placement")!==m.placement&&a.dom.setAttribute("data-ln-popover-placement",m.placement)},this._boundReposition=function(){a._repositionRaf||(a._repositionRaf=requestAnimationFrame(function(){a._repositionRaf=null,a._performReposition()}))},window.addEventListener("scroll",this._boundReposition,{passive:!0,capture:!0}),window.addEventListener("resize",this._boundReposition),l.push(this),c(),E(this.dom,"ln-popover:open",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger})},u.prototype._applyClose=function(){this.isOpen=!1,this._repositionRaf&&(cancelAnimationFrame(this._repositionRaf),this._repositionRaf=null),this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null),this._boundReposition&&(window.removeEventListener("scroll",this._boundReposition,{capture:!0}),window.removeEventListener("resize",this._boundReposition),this._boundReposition=null),this.dom.style.top="",this.dom.style.left="",this.dom.removeAttribute("data-ln-popover-placement"),this.trigger&&this.trigger.setAttribute("aria-expanded","false"),typeof this.dom.hidePopover=="function"&&this.dom.matches(":popover-open")&&this.dom.hidePopover();const d=l.indexOf(this);d!==-1&&l.splice(d,1),o(),this._previousFocus&&this.trigger&&this._previousFocus===this.trigger?this.trigger.focus():this.trigger&&document.activeElement===document.body&&this.trigger.focus(),this._previousFocus=null,E(this.dom,"ln-popover:close",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger}),this.trigger=null},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-popover:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-popover:request-close",this._onRequestClose),this.dom.removeEventListener("ln-popover:request-toggle",this._onRequestToggle),this.dom.removeEventListener("toggle",this._onNativeToggle),this.isOpen&&this._applyClose(),delete this.dom[t])};function p(d){this.dom=d;const h=d.getAttribute(n);return d.setAttribute("aria-haspopup","dialog"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",h),this._onClick=function(w){if(w.ctrlKey||w.metaKey||w.button===1)return;w.preventDefault();const b=document.getElementById(h);if(!b)return;b[t]&&(b[t].trigger=d);const a=b.getAttribute(e);b.setAttribute(e,a==="open"?"closed":"open")},d.addEventListener("click",this._onClick),this}p.prototype.destroy=function(){this.dom.removeEventListener("click",this._onClick),delete this.dom[t+"Trigger"]};function f(d){const h=d[t];if(!h)return;const b=d.getAttribute(e)==="open";if(b!==h.isOpen)if(b){if(j(d,"ln-popover:before-open",{popoverId:d.id,target:d,trigger:h.trigger}).defaultPrevented){d.setAttribute(e,"closed");return}h._applyOpen(h.trigger)}else{if(j(d,"ln-popover:before-close",{popoverId:d.id,target:d,trigger:h.trigger}).defaultPrevented){d.setAttribute(e,"open");return}h._applyClose()}}I(e,t,u,"ln-popover",{attributes:i}),I(n,t+"Trigger",p,"ln-popover-trigger")})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function m(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!m(o))return}e.apply(console,t)}}function q(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}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 ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,o=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[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 n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(n).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=oe(n);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const I={};function le(e,t){I[e]=t}function se(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const C={};function de(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=C[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function T(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,r,o,l,s){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],d=String(o(a));let u=i[d];if(u)l(u,a,n);else{const f=de(r,s);if(!f||(T(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=N,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function y(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function R(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function M(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function j(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return A.set(r,l),l}function V(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function W(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function U(e,t,r,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,r){for(const o in r){const[l,s,i]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=j(o.values,o.fallback);break;case"integer":l=R;break;case"float":l=V;break;case"boolean":l=M;break;case"list":l=B;break;case"json":l=W;break;case"string":default:l=y;break}l||(l=y),t[o.prop]=[l,r,o.fallback]}return t}function pe(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=he,window.lnCore.attrSpec=be,window.lnCore.attrStr=y,window.lnCore.attrInt=R,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=V,window.lnCore.attrJson=W);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(r){console.error("["+t.attribute+"] init failed",e,r)}}}function H(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&h(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)h(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Q(e){const t=P(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ge(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,r,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function ye(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=P(),l=o.byAttr.get(t),s=F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=o.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<c.length;a++)U(c[a].spec,n,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=o.byReactive.get(t);c&&J(c,i,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const n=l[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(H(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ye(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function x(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=v();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=x();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&h(s,n);else if(s.matches&&s.matches(n.query)&&h(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let d=0;d<a.length;d++)h(a[d],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){if(document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!i)s.matches&&s.matches(a)&&_(s,n);else if(s.matches&&s.matches(a)&&_(s,n),s.querySelectorAll){const d=s.querySelectorAll(a);for(let u=0;u<d.length;u++)_(d[u],n)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{z(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const l=r[o];if(l.type==="childList")try{z(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ve(e,t){Q({observed:e,handler:t}),K()}function xe(e){v().push(e),e.onSubtreeChange&&e.query&&x().push(e),G()}function X(e,t,r,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,a=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?pe(u):d,Ne=u?new Set(Object.keys(u)):null,Te=l.persist||null;function g(O){const w=O||document.body;if(H(w,e,t,r),u&&F())for(const b in u){const Me=u[b],E=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&E.push(w);for(let L=0;L<E.length;L++){const D=E[L];m(D)&&U(Me,D.getAttribute(b),b,o,D)}}n&&n(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);Q({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:k.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:Ne,persist:Te}),K();const Re=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=l.subtreeQuery||(Re?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Z};v().push(ee),c&&Z&&x().push(ee),G(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Ae);function te(){me()>0?Ce(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),g}function Y(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},o=Y(t);if(!o)return r;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function _e(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=_e,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Fe);function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=qe);function Ie(e,t=100,r=0){const o=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(r))||0,i=Math.max(s,Math.min(o,l)),c=l-s;let n=0;return c>0&&(n=(i-s)/c*100),n=Math.max(0,Math.min(100,n)),{value:o,min:s,max:l,clampedValue:i,percentage:n}}function $e(e,t,r=100){if(t!=null&&t!==""){const o=parseFloat(String(t));if(!isNaN(o)&&o>0)return o}if(e!=null&&e!==""){const o=parseFloat(String(e));if(!isNaN(o)&&o>0)return o}return r}(function(){const e="[data-ln-progress]",t="lnProgress";if(window[t]!==void 0)return;function r(i){const c=i[t];c&&s.call(c)}const o={"data-ln-progress":{type:"float",fallback:0,min:0,effect:r,description:"Current progress value"},"data-ln-progress-max":{type:"float",fallback:100,min:0,effect:r,description:"Maximum progress scale value"}};function l(i){return this.dom=i,this._parentObserver=null,s.call(this),this}l.prototype.destroy=function(){this.dom[t]&&(this._parentObserver&&this._parentObserver.disconnect(),delete this.dom[t])};function s(){const i=this.dom.getAttribute("data-ln-progress"),c=this.dom.parentElement,n=c?c.getAttribute("data-ln-progress-max"):null,a=this.dom.getAttribute("data-ln-progress-max"),d=$e(a,n,100),u=Ie(i,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)),q(this.dom,"ln-progress:change",{target:this.dom,value:u.value,max:u.max,percentage:u.percentage})}X(e,t,l,"ln-progress",{attributes:o}),ve(["data-ln-progress-max"],function(i){const c=i.querySelectorAll?i.querySelectorAll(e):[];for(let n=0;n<c.length;n++){const a=c[n][t];a&&s.call(a)}})})()})();
|
|
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 o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!m(o))return}e.apply(console,t)}}function F(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&l[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);l[r.name]=r.value===""||isNaN(a)?null:a}else l[r.name]=r.value}return l}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(r).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=oe(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<i.options.length;a++)i.options[a].selected=r.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const I={};function le(e,t){I[e]=t}function se(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ae(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];R[n]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const y={};function de(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 N(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const a=e.children[r],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],d=String(o(a));let u=i[d];if(u)l(u,a,r);else{const f=de(n,s);if(!f||(N(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,a,r)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function C(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function T(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function M(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return A.set(n,l),l}function U(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function V(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=j(o.values,o.fallback);break;case"integer":l=T;break;case"float":l=U;break;case"boolean":l=M;break;case"list":l=B;break;case"json":l=W;break;case"string":default:l=C;break}l||(l=C),t[o.prop]=[l,n,o.fallback]}return t}function be(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 ge(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=he,window.lnCore.attrSpec=pe,window.lnCore.attrStr=C,window.lnCore.attrInt=T,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=W);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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function H(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&h(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)h(c[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Q(e){const t=P(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ge(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ce(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=P(),l=o.byAttr.get(t),s=D()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=o.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let a=0;a<c.length;a++)V(c[a].spec,r,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&J(c,i,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const r=l[c];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(H(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ce(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 x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function v(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function G(e){const t=x();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=S();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&h(s,r);else if(s.matches&&s.matches(r.query)&&h(s,r),s.querySelectorAll){const a=s.querySelectorAll(r.query);for(let d=0;d<a.length;d++)h(a[d],r)}}r.onInit&&r.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){if(document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a){if(!i)s.matches&&s.matches(a)&&v(s,r);else if(s.matches&&s.matches(a)&&v(s,r),s.querySelectorAll){const d=s.querySelectorAll(a);for(let u=0;u<d.length;u++)v(d[u],r)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{G(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const l=n[o];if(l.type==="childList")try{G(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e,t){Q({observed:e,handler:t}),K()}function Se(e){x().push(e),e.onSubtreeChange&&e.query&&S().push(e),z()}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,r=l.onInit||null,a=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?be(u):d,He=u?new Set(Object.keys(u)):null,Pe=l.persist||null;function g(O){const w=O||document.body;if(H(w,e,t,n),u&&D())for(const p in u){const Je=u[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const q=E[L];m(q)&&V(Je,q.getAttribute(p),p,o,q)}}r&&r(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);Q({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:n,onInit:r,observed:k.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:He,persist:Pe}),K();const Qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Z=l.subtreeQuery||(Qe?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:Z};x().push(ee),c&&Z&&S().push(ee),z(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=Se,window.lnCore.withoutLifecycle=Ae);function te(){me()>0?ye(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),g}function Y(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ve(e){if(!e)return null;const t=_();return e in t?t[e]:null}function _e(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(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 n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ve,window.lnCore.hashSet=_e,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=De);function Fe(e){return(e||"").replace(/^\?/,"")}function Ie(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Fe(t);if(!o)return n;const l=new URLSearchParams(o);for(const[s,i]of l.entries())n[s]=i;return n}function Re(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Ne(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Me(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Be(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function je(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ie,window.lnCore.queryGet=Re,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Ne,window.lnCore.querySortEncode=Te,window.lnCore.querySortDecode=Me,window.lnCore.queryFilterEncode=Be,window.lnCore.queryFilterDecode=je);function Ue(){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=Ue);function We(e,t=100,n=0){const o=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(n))||0,i=Math.max(s,Math.min(o,l)),c=l-s;let r=0;return c>0&&(r=(i-s)/c*100),r=Math.max(0,Math.min(100,r)),{value:o,min:s,max:l,clampedValue:i,percentage:r}}function Ve(e,t,n=100){if(t!=null&&t!==""){const o=parseFloat(String(t));if(!isNaN(o)&&o>0)return o}if(e!=null&&e!==""){const o=parseFloat(String(e));if(!isNaN(o)&&o>0)return o}return n}(function(){const e="[data-ln-progress]",t="lnProgress";if(window[t]!==void 0)return;function n(i){const c=i[t];c&&s.call(c)}const o={"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(i){return this.dom=i,this._parentObserver=null,s.call(this),this}l.prototype.destroy=function(){this.dom[t]&&(this._parentObserver&&this._parentObserver.disconnect(),delete this.dom[t])};function s(){const i=this.dom.getAttribute("data-ln-progress"),c=this.dom.parentElement,r=c?c.getAttribute("data-ln-progress-max"):null,a=this.dom.getAttribute("data-ln-progress-max"),d=Ve(a,r,100),u=We(i,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})}X(e,t,l,"ln-progress",{attributes:o}),xe(["data-ln-progress-max"],function(i){const c=i.querySelectorAll?i.querySelectorAll(e):[];for(let r=0;r<c.length;r++){const a=c[r][t];a&&s.call(a)}})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var LnAshlarComponent=(function(x){"use strict";function z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!E(i))return}e.apply(console,t)}}function O(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function Ie(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(r),r}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Me(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 $e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Te(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,r={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[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")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&l[o.name]===1?r[o.name]=o.checked:(r[o.name]||(r[o.name]=[]),o.checked&&r[o.name].push(o.value));else if(o.type==="radio")o.checked&&(r[o.name]=o.value);else if(o.type==="select-multiple"){r[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&r[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")r[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);r[o.name]=o.value===""||isNaN(c)?null:c}else r[o.name]=o.value}return r}function Fe(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 n=e.elements,i=[],r={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(r[l.name]=(r[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 o=t[a];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(o).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=Fe(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<l.options.length;c++)l.options[c].selected=o.indexOf(l.options[c].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ne,window.lnCore.serializeForm=Te,window.lnCore.resolveFormMethod=$e);const J={};function Be(e,t){J[e]=t}function We(e){return J[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Be,window.lnCore.getDataMapper=We);function je(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){O(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function Ke(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function Pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ke,window.lnCore.getLocaleFallback=Pe,window.lnCore.ensureLocaleObserver=je);const q={};function He(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 X(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],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const a=i[l],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].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 r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].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 Ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)X(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 Y(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 i=function(s,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const l=r[s],a=l.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ve(e,t,n,i,r,s){const l={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],d=String(i(c));let f=l[d];if(f)r(f,c,o);else{const p=He(n,s);if(!p||(Y(p,c),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),r(f,c,o)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=Ue,window.lnCore.renderList=Ve);function L(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function Z(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function ee(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const i=new Set(e||[]),r=function(s,l){const a=s.getAttribute(l);return a!==null&&i.has(a)?a:t};return R.set(n,r),r}function re(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function oe(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function ie(e,t,n,i,r){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{r?console.warn(o,r):console.warn(o)};if(l==="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(l==="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(l==="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(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(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Qe(e,t,n){for(const i in n){const[r,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return r(t,s,l)},enumerable:!0,configurable:!0})}return e}function ze(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=ne(i.values,i.fallback);break;case"integer":r=Z;break;case"float":r=re;break;case"boolean":r=ee;break;case"list":r=te;break;case"json":r=oe;break;case"string":default:r=L;break}r||(r=L),t[i.prop]=[r,n,i.fallback]}return t}function Je(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function Ge(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=Qe,window.lnCore.attrSpec=ze,window.lnCore.attrStr=L,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);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 le(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&C(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let o=0;o<a.length;o++)C(a[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ye(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 se(){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 Ze(e){const t=se(),n=e.observed||[];for(let i=0;i<n.length;i++){const r=n[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function ae(e,t,n,i){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function et(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=se(),r=i.byAttr.get(t),s=z()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!r&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&E(l)){const a=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let c=0;c<a.length;c++)ie(a[c].spec,o,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(n||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const a=i.byReactive.get(t);a&&ae(a,l,t,e.oldValue),i.reactiveWildcard.length&&ae(i.reactiveWildcard,l,t,e.oldValue)}if(r)for(let a=0;a<r.length;a++){const o=r[a];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(le(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function tt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{et(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function D(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ce(e){const t=D();if(!t.length)return;const n=e.target;if(n){const r=n.nodeType===1?n:n.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=I();if(e.target&&i.length)for(let r=0;r<i.length;r++){const s=i[r],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let r=0;r<e.addedNodes.length;r++){const s=e.addedNodes[r];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const o=t[a];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)s.matches&&s.matches(o.query)&&C(s,o);else if(s.matches&&s.matches(o.query)&&C(s,o),s.querySelectorAll){const c=s.querySelectorAll(o.query);for(let d=0;d<c.length;d++)C(c[d],o)}}o.onInit&&o.onInit(s)}}}for(let r=0;r<e.removedNodes.length;r++){const s=e.removedNodes[r];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const o=t[a],c=o.query;if(c){if(!l)s.matches&&s.matches(c)&&M(s,o);else if(s.matches&&s.matches(c)&&M(s,o),s.querySelectorAll){const d=s.querySelectorAll(c);for(let f=0;f<d.length;f++)M(d[f],o)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{ce(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function nt(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let i=0;i<n.length;i++){const r=n[i];if(r.type==="childList")try{ce(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function rt(e){D().push(e),e.onSubtreeChange&&e.query&&I().push(e),ue()}function de(e,t,n,i,r={}){const s=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,o=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,f=r.attributes||null,p=f?Je(f):d,S=f?new Set(Object.keys(f)):null,u=r.persist||null;function h(H){const b=H||document.body;if(le(b,e,t,n),f&&z())for(const v in f){const mt=f[v],U=Array.from(b.querySelectorAll("["+v+"]"));b.matches&&b.matches("["+v+"]")&&U.push(b);for(let V=0;V<U.length;V++){const Q=U[V];E(Q)&&ie(mt,Q.getAttribute(v),v,i,Q)}}o&&o(b)}const w=[];if(e.indexOf("[")!==-1){const H=/\[([\w-]+)/g;let b;for(;(b=H.exec(e))!==null;)w.push(b[1])}else w.push(e);Ze({selector:e,attribute:t,componentTag:i,attributes:f,ComponentFn:n,onInit:o,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:S,persist:u}),tt();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Le=r.subtreeQuery||(y?e:"["+e+"]"),Re={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le};D().push(Re),a&&Le&&I().push(Re),ue(),window[t]=h,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=rt,window.lnCore.withoutLifecycle=nt);function De(){Xe()>0?Ye(function(){h(document.body)}):h(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",De):De(),h}function fe(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},i=fe(t);if(!i)return n;const r=i.split("&");for(let s=0;s<r.length;s++){const l=r[s];if(!l)continue;const a=l.indexOf(":"),o=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function ot(e){if(!e)return null;const t=$();return e in t?t[e]:null}function it(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 l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");fe(location.hash)!==r&&(location.hash=r)}function lt(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function st(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function at(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ct(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 ut(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function dt(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),r=i?i.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=ot,window.lnCore.hashSet=it,window.lnCore.hashLinkClick=lt,window.lnCore.resolveHashNamespace=st,window.lnCore.hashSortEncode=at,window.lnCore.hashSortDecode=ct,window.lnCore.hashFilterEncode=ut,window.lnCore.hashFilterDecode=dt);function ft(){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=ft);function ht(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:i=null}={}){const r=n?!i:!e.some(c=>c.match),s=[],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&&s.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 o=l.find(c=>c.regionKey==="__primary__")||l[0]||null;return{notFound:r,clears:s,swaps:l,owner:o}}function _(e){if(!e||typeof e!="string")return"";let t=e.trim().replace(/\/+$/,"");return!t||t==="/"?"":t.startsWith("/")?t:"/"+t}function wt(e,t){const n=_(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const i=(e||"/").replace(/\/+$/,"")||"/";return i===n?"/":i.startsWith(n+"/")?i.slice(n.length).replace(/\/+$/,"")||"/":i}function he(e,t){const n=_(t);if(!n)return e||"/";const i=e||"/",r=i.indexOf("#"),s=r!==-1?i.slice(0,r):i,l=r!==-1?i.slice(r):"",a=s.indexOf("?"),o=a!==-1?s.slice(0,a):s,c=a!==-1?s.slice(a):"";let d;if(o===n)d=n+"/";else if(o.startsWith(n+"/"))d=o;else{const f=o.startsWith("/")?o:"/"+o;d=f==="/"?n+"/":n+f}return d+c+l}function T(){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 F={navigate:function(e){A(e,{historyAction:"push"})},replace:function(e){A(e,{historyAction:"replace"})},base:function(){return T()},toUrl:function(e){return he(e,T())},current:function(){return k===null?null:{path:k,fullPath:be,base:ye,params:me,query:Ce,route:_e,regions:pe}}},N="data-ln-route",we="lnRoute";typeof window<"u"&&(window.lnRouter=F);function B(e){Oe(e),Ee(e),g.size>0&&xe()}const pt={"data-ln-route":{effect:B,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:B,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:B,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,W=new WeakMap;let pe=new Map,ge=!1,k=null,be=null,ye="",me={},Ce={},_e=null,j=!1;function Ae(e,t,n){j?queueMicrotask(function(){O(e,t,n)}):O(e,t,n)}function K(e){try{const a=new URL(e,window.location.origin);e=a.pathname+a.search+a.hash}catch{}let[t]=e.split("#"),[n,i]=t.split("?");const r={};if(i){const a=new URLSearchParams(i);for(const[o,c]of a.entries())r[o]=c}const s=T();return{path:wt(n,s),query:r,base:s}}function ve(e,t){if(e.pattern==="*")return 1;if(t.pattern==="*")return-1;const n=e.segments,i=t.segments,r=Math.max(n.length,i.length);for(let s=0;s<r;s++){const l=n[s],a=i[s];if(l===void 0)return 1;if(a===void 0)return-1;if(l==="*")return 1;if(a==="*")return-1;const o=l.startsWith(":"),c=a.startsWith(":");if(o&&!c)return 1;if(!o&&c)return-1}return 0}function ke(e,t){const n=e.split("/").filter(Boolean);for(const i of t){if(i.pattern==="*")return{route:i,params:{wildcard:e}};const r=i.segments,s={};let l=!0;if(!(n.length>r.length&&r[r.length-1]!=="*")){for(let a=0;a<r.length;a++){const o=r[a],c=n[a];if(o==="*"){s.wildcard=n.slice(a).join("/");break}if(c===void 0){l=!1;break}if(o.startsWith(":"))s[o.slice(1)]=decodeURIComponent(c);else if(o!==c){l=!1;break}}if(l&&(r.indexOf("*")!==-1||n.length<=r.length))return{route:i,params:s}}}return null}function P(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 i=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return!i&&n&&console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),i}function Se(e){if(!e)return;const t=Array.from(e.querySelectorAll("*")),n=[e].concat(t);for(const r of n)for(const s of Object.keys(r))if(s.startsWith("ln")&&r[s]&&typeof r[s].destroy=="function")try{r[s].destroy()}catch(l){console.error(`[ln-router] Error destroying component ${s} on element:`,r,l)}const i=document.querySelectorAll('[data-ln-popover="open"]');for(const r of i){const s=r.lnPopover;if(s&&s.trigger&&e.contains(s.trigger))try{s.destroy()}catch(l){console.error("[ln-router] Error destroying open popover:",l)}}}function A(e,t={}){const{path:n,query:i,base:r}=K(e),s=he(e,r),l=new Map;for(const[u,h]of g)l.set(u,ke(n,h.sorted));const a=l.get("__primary__")||null,o=P("__primary__",{warn:!!a}),c=g.has("__primary__"),d=[];for(const[u,h]of l){const w=u==="__primary__"?o:P(u,{warn:!1}),y=!w&&!!(a&&a.route&&a.route.templateNode&&a.route.templateNode.content&&a.route.templateNode.content.querySelector("#"+CSS.escape(u)));!w&&!y&&h&&console.warn(`[ln-router] Explicit target element #${u} not found in DOM`),d.push({regionKey:u,match:h,targetEl:w,isPending:y,hasKeep:!!w&&w.hasAttribute("data-ln-route-keep"),hasHydrate:!!w&&w.hasAttribute("data-ln-router-hydrate"),hasChildren:!!w&&w.children.length>0,mountedTemplate:w&&W.get(w)||null})}const f=ht(d,{isHydration:!!t.isHydration,hasPrimaryRegion:c,primaryMatch:a});if(f.notFound){Ae(document.body,"ln-router:not-found",{path:n});return}if(Ie(o||document.body,"ln-router:before-navigate",{from:k,to:s,path:n,params:a?a.params:{},query:i}).defaultPrevented)return;t.historyAction==="push"?window.history.pushState(null,"",s):t.historyAction==="replace"&&window.history.replaceState(null,"",s);const S=function(){for(const u of f.clears)Se(u.targetEl),u.targetEl.replaceChildren(),W.delete(u.targetEl);for(const u of f.swaps){if((u.isPending||!u.targetEl||!document.contains(u.targetEl))&&(u.targetEl=u.regionKey==="__primary__"?o:document.getElementById(u.regionKey)),!u.targetEl){console.warn(`[ln-router] Target element #${u.regionKey} could not be resolved`);continue}if(u.skipMount||(Se(u.targetEl),u.targetEl.replaceChildren(u.match.route.templateNode.content.cloneNode(!0))),W.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,y]of Object.entries(u.match.params))h=h.replace(new RegExp("\\{\\{\\s*"+w+"\\s*\\}\\}","g"),y);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"})}}Ae(u.targetEl,"ln-router:navigated",{path:n,fullPath:s,base:r,params:u.match.params,query:i,route:u.match.route,target:u.targetEl,region:u.regionKey})}k=n,be=s,ye=r,Ce=i,_e=a?a.route:null,me=a?a.params:{},pe=new Map(Array.from(l.entries()).map(([u,h])=>[u,h?{route:h.route,params:h.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(S):S()}function gt(e){const t=e.target.closest("a");if(!t||!Me(e,t))return;const n=t.getAttribute("href"),{path:i}=K(n);for(const r of g.values())if(ke(i,r.sorted)){e.preventDefault(),A(n,{historyAction:"push"});return}}function bt(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let r=0;r<n.length;r++){const s=n[r];if(e[s]!==t[s])return!1}return!0}function yt(){const e=window.location.pathname+window.location.search,t=F.current();if(t&&t.path!=null){const n=K(e);if(t.path===n.path&&bt(t.query,n.query))return}A(e,{historyAction:"skip"})}function xe(){ge||(ge=!0,m(function(){document.addEventListener("click",gt),window.addEventListener("popstate",yt),j=!0;const e=window.location.pathname+window.location.search+window.location.hash;A(e,{historyAction:"replace",isHydration:!0}),j=!1},"ln-router"))}function Ee(e){const t=e.getAttribute(N);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 i=n||"__primary__";g.has(i)||g.set(i,{routes:new Map,sorted:[]});const r=g.get(i);if(r.routes.has(t)){console.warn(`[ln-router] Duplicate route pattern registered: "${t}" in region "${i}"`);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},o=P(i);o&&o.contains(e)&&console.warn(`[ln-router] Route template with pattern "${t}" is declared inside its own outlet element:`,e),r.routes.set(t,a),r.sorted=Array.from(r.routes.values()).sort(ve)}function Oe(e){const t=e.getAttribute(N);if(!t)return;const i=e.getAttribute("data-ln-route-target")||null||"__primary__",r=g.get(i);r&&(r.routes.delete(t),r.sorted=Array.from(r.routes.values()).sort(ve),r.routes.size===0&&g.delete(i))}function qe(e){return this.dom=e,Ee(e),this}return qe.prototype.destroy=function(){Oe(this.dom),delete this.dom[we]},de(N,we,qe,"ln-router",{attributes:pt,onInit:function(){g.size>0&&xe()}}),x.router=F,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
|
|
1
|
+
var LnAshlarComponent=(function(x){"use strict";function z(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!E(r))return}e.apply(console,t)}}function O(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 Ie(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 m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Me(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 $e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Te(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 c=0;c<i.options.length;c++)i.options[c].selected&&o[i.name].push(i.options[c].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const c=Number(i.value);o[i.name]=i.value===""||isNaN(c)?null:c}else o[i.name]=i.value}return o}function Fe(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 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 c=String(i).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=Fe(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 c=0;c<l.options.length;c++)l.options[c].selected=i.indexOf(l.options[c].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=Ne,window.lnCore.serializeForm=Te,window.lnCore.resolveFormMethod=$e);const J={};function We(e,t){J[e]=t}function Be(e){return J[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=We,window.lnCore.getDataMapper=Be);function je(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){O(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function Pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function Ke(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Pe,window.lnCore.getLocaleFallback=Ke,window.lnCore.ensureLocaleObserver=je);const q={};function Ue(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 X(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 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&&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 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&&a.classList.toggle(f,!!t[p])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)X(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 Y(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 c=a[i];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ve(e,t,n,r,o,s){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 a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],d=String(r(c));let f=l[d];if(f)o(f,c,i);else{const p=Ue(n,s);if(!p||(Y(p,c),f=p.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",d),o(f,c,i)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=He,window.lnCore.renderList=Ve);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function ee(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 te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const L=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if(L.has(n))return L.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 L.set(n,o),o}function re(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function oe(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ie(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 Qe(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 ze(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=ne(r.values,r.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function Je(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 Ge(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=Qe,window.lnCore.attrSpec=ze,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);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 le(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&C(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let i=0;i<a.length;i++)C(a[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ye(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 se(){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 Ze(e){const t=se(),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=Ge(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 ae(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 et(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=se(),o=r.byAttr.get(t),s=z()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&E(l)){const a=r.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let c=0;c<a.length;c++)ie(a[c].spec,i,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const a=r.byReactive.get(t);a&&ae(a,l,t,e.oldValue),r.reactiveWildcard.length&&ae(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const i=o[a];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(le(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function tt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{et(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 D(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ce(e){const t=D();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}const r=I();if(e.target&&r.length)for(let o=0;o<r.length;o++){const s=r[o],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const i=t[a];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)s.matches&&s.matches(i.query)&&C(s,i);else if(s.matches&&s.matches(i.query)&&C(s,i),s.querySelectorAll){const c=s.querySelectorAll(i.query);for(let d=0;d<c.length;d++)C(c[d],i)}}i.onInit&&i.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const i=t[a],c=i.query;if(c){if(!l)s.matches&&s.matches(c)&&M(s,i);else if(s.matches&&s.matches(c)&&M(s,i),s.querySelectorAll){const d=s.querySelectorAll(c);for(let f=0;f<d.length;f++)M(d[f],i)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ce(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function nt(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const o=n[r];if(o.type==="childList")try{ce(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function rt(e){D().push(e),e.onSubtreeChange&&e.query&&I().push(e),ue()}function de(e,t,n,r,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,a=o.onSubtreeChange||null,i=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,f=o.attributes||null,p=f?Je(f):d,k=f?new Set(Object.keys(f)):null,u=o.persist||null;function w(U){const b=U||document.body;if(le(b,e,t,n),f&&z())for(const S in f){const Ot=f[S],H=Array.from(b.querySelectorAll("["+S+"]"));b.matches&&b.matches("["+S+"]")&&H.push(b);for(let V=0;V<H.length;V++){const Q=H[V];E(Q)&&ie(Ot,Q.getAttribute(S),S,r,Q)}}i&&i(b)}const h=[];if(e.indexOf("[")!==-1){const U=/\[([\w-]+)/g;let b;for(;(b=U.exec(e))!==null;)h.push(b[1])}else h.push(e);Ze({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:h.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:k,persist:u}),tt();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Re=o.subtreeQuery||(y?e:"["+e+"]"),Le={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:a,query:Re};D().push(Le),a&&Re&&I().push(Le),ue(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=rt,window.lnCore.withoutLifecycle=nt);function De(){Xe()>0?Ye(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",De):De(),w}function fe(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=fe(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,c=a>-1?l.slice(a+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function ot(e){if(!e)return null;const t=$();return e in t?t[e]:null}function it(e,t){if(!e)return;const n=$();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("&");fe(location.hash)!==o&&(location.hash=o)}function lt(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function st(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 at(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ct(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 ut(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function dt(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=$,window.lnCore.hashGet=ot,window.lnCore.hashSet=it,window.lnCore.hashLinkClick=lt,window.lnCore.resolveHashNamespace=st,window.lnCore.hashSortEncode=at,window.lnCore.hashSortDecode=ct,window.lnCore.hashFilterEncode=ut,window.lnCore.hashFilterDecode=dt);function ft(e){return(e||"").replace(/^\?/,"")}function wt(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=ft(t);if(!r)return n;const o=new URLSearchParams(r);for(const[s,l]of o.entries())n[s]=l;return n}function ht(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function pt(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function gt(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function bt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function yt(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function mt(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ct(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=wt,window.lnCore.queryGet=ht,window.lnCore.querySet=pt,window.lnCore.resolveQueryParam=gt,window.lnCore.querySortEncode=bt,window.lnCore.querySortDecode=yt,window.lnCore.queryFilterEncode=mt,window.lnCore.queryFilterDecode=Ct);function _t(){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=_t);function At(e,{isHydration:t=!1,hasPrimaryRegion:n=!1,primaryMatch:r=null}={}){const o=n?!r:!e.some(c=>c.match),s=[],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&&s.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:o,clears:s,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 St(e,t){const n=_(t);if(!n)return e&&e.replace(/\/+$/,"")||"/";const r=(e||"/").replace(/\/+$/,"")||"/";return r===n?"/":r.startsWith(n+"/")?r.slice(n.length).replace(/\/+$/,"")||"/":r}function we(e,t){const n=_(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,c=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+c+l}function T(){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 F={navigate:function(e){A(e,{historyAction:"push"})},replace:function(e){A(e,{historyAction:"replace"})},base:function(){return T()},toUrl:function(e){return we(e,T())},current:function(){return v===null?null:{path:v,fullPath:be,base:ye,params:me,query:Ce,route:_e,regions:pe}}},N="data-ln-route",he="lnRoute";typeof window<"u"&&(window.lnRouter=F);function W(e){Oe(e),Ee(e),g.size>0&&xe()}const vt={"data-ln-route":{effect:W,type:"string",description:"URL path pattern matched by this route template"},"data-ln-route-target":{effect:W,type:"string",description:"Target outlet element selector where route content is rendered"},"data-ln-route-title":{effect:W,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 pe=new Map,ge=!1,v=null,be=null,ye="",me={},Ce={},_e=null,j=!1;function Ae(e,t,n){j?queueMicrotask(function(){O(e,t,n)}):O(e,t,n)}function P(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,c]of a.entries())o[i]=c}const s=T();return{path:St(n,s),query:o,base:s}}function Se(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(":"),c=a.startsWith(":");if(i&&!c)return 1;if(!i&&c)return-1}return 0}function ve(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],c=n[a];if(i==="*"){s.wildcard=n.slice(a).join("/");break}if(c===void 0){l=!1;break}if(i.startsWith(":"))s[i.slice(1)]=decodeURIComponent(c);else if(i!==c){l=!1;break}}if(l&&(o.indexOf("*")!==-1||n.length<=o.length))return{route:r,params:s}}}return null}function K(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 ke(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 A(e,t={}){const{path:n,query:r,base:o}=P(e),s=we(e,o),l=new Map;for(const[u,w]of g)l.set(u,ve(n,w.sorted));const a=l.get("__primary__")||null,i=K("__primary__",{warn:!!a}),c=g.has("__primary__"),d=[];for(const[u,w]of l){const h=u==="__primary__"?i:K(u,{warn:!1}),y=!h&&!!(a&&a.route&&a.route.templateNode&&a.route.templateNode.content&&a.route.templateNode.content.querySelector("#"+CSS.escape(u)));!h&&!y&&w&&console.warn(`[ln-router] Explicit target element #${u} not found in DOM`),d.push({regionKey:u,match:w,targetEl:h,isPending:y,hasKeep:!!h&&h.hasAttribute("data-ln-route-keep"),hasHydrate:!!h&&h.hasAttribute("data-ln-router-hydrate"),hasChildren:!!h&&h.children.length>0,mountedTemplate:h&&B.get(h)||null})}const f=At(d,{isHydration:!!t.isHydration,hasPrimaryRegion:c,primaryMatch:a});if(f.notFound){Ae(document.body,"ln-router:not-found",{path:n});return}if(Ie(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 u of f.clears)ke(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||(ke(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 w=u.match.route.title;if(u.match.params)for(const[h,y]of Object.entries(u.match.params))w=w.replace(new RegExp("\\{\\{\\s*"+h+"\\s*\\}\\}","g"),y);document.title=w}if(!t.isHydration){u.targetEl.hasAttribute("tabindex")||u.targetEl.setAttribute("tabindex","-1");const w=u.targetEl.querySelector("h1, h2, h3, h4, h5, h6");w?(w.setAttribute("tabindex","-1"),w.focus()):u.targetEl.focus(),u.regionKey==="__primary__"&&u.targetEl.scrollIntoView({block:"start",behavior:"instant"})}}Ae(u.targetEl,"ln-router:navigated",{path:n,fullPath:s,base:o,params:u.match.params,query:r,route:u.match.route,target:u.targetEl,region:u.regionKey})}v=n,be=s,ye=o,Ce=r,_e=a?a.route:null,me=a?a.params:{},pe=new Map(Array.from(l.entries()).map(([u,w])=>[u,w?{route:w.route,params:w.params}:null]))};document.startViewTransition&&!t.isHydration?document.startViewTransition(k):k()}function kt(e){const t=e.target.closest("a");if(!t||!Me(e,t))return;const n=t.getAttribute("href"),{path:r}=P(n);for(const o of g.values())if(ve(r,o.sorted)){e.preventDefault(),A(n,{historyAction:"push"});return}}function xt(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 Et(){const e=window.location.pathname+window.location.search,t=F.current();if(t&&t.path!=null){const n=P(e);if(t.path===n.path&&xt(t.query,n.query))return}A(e,{historyAction:"skip"})}function xe(){ge||(ge=!0,m(function(){document.addEventListener("click",kt),window.addEventListener("popstate",Et),j=!0;const e=window.location.pathname+window.location.search+window.location.hash;A(e,{historyAction:"replace",isHydration:!0}),j=!1},"ln-router"))}function Ee(e){const t=e.getAttribute(N);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=K(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(Se)}function Oe(e){const t=e.getAttribute(N);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(Se),o.routes.size===0&&g.delete(r))}function qe(e){return this.dom=e,Ee(e),this}return qe.prototype.destroy=function(){Oe(this.dom),delete this.dom[he]},de(N,he,qe,"ln-router",{attributes:vt,onInit:function(){g.size>0&&xe()}}),x.router=F,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),x})({});
|