@livenetworks/ashlar 2.0.9 → 2.0.10
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-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/lifecycle.js +1 -1
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-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-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +161 -153
- package/components/ln-filter/src/ln-filter.js +77 -5
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.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-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/ln-search.js +1 -1
- package/components/ln-search/src/ln-search.js +17 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +5 -0
- package/package.json +1 -1
- package/web-types.json +8 -1
|
@@ -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 k(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(!k(o))return}e.apply(console,t)}}function A(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 M(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function x(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function Z(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ee(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&r[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.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 re(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const i=t[c];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=oe(i);o.push(r)}else if(r.type==="radio")r.checked=r.value===String(i),o.push(r);else if(r.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<r.options.length;u++)r.options[u].selected=i.indexOf(r.options[u].value)!==-1;o.push(r)}else r.value=i,r.tagName==="SELECT"&&i!=null&&r.setAttribute("data-ln-value",i),o.push(r)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const $={};function ie(e,t){$[e]=t}function le(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ce(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=se);const S={};function ue(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=S[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const c=n[r],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const c=o[r],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],c=r.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function fe(e,t,n,o,l,s){const r={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(r[f]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(o(u));let d=r[f];if(d)l(d,u,i);else{const a=ue(n,s);if(!a||(j(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,u,i)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=fe);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function W(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function U(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 V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(s,r){const c=s.getAttribute(r);return c!==null&&o.has(c)?c:t};return E.set(n,l),l}function K(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function G(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function J(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(r==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function we(e,t,n){for(const o in n){const[l,s,r]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,r)},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=H(o.values,o.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=G;break;case"string":default:l=O;break}l||(l=O),t[o.prop]=[l,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=we,window.lnCore.attrSpec=pe,window.lnCore.attrStr=O,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=G);function L(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const c of r)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(i){console.error("["+n+"] init failed",c,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 ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=Q(),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=be(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 P(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ye(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),l=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&k(t)){const s=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let c=0;c<s.length;c++)J(s[c].spec,r,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&P(s,t,n,e.oldValue),o.reactiveWildcard.length&&P(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(L(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ye(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ve(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];L(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,c=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&c.push(o);for(let i=0;i<c.length;i++){const u=c[i];if(!document.contains(u)){const f=u[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",u,d)}delete u[s.attribute]}}}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ve(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,a=d?he(d):f,w=d?new Set(Object.keys(d)):null,p=l.persist||null;function b(C){const h=C||document.body;if(L(h,e,t,n),d&&F())for(const y in d){const Re=d[y],q=Array.from(h.querySelectorAll("["+y+"]"));h.matches&&h.matches("["+y+"]")&&q.push(h);for(let R=0;R<q.length;R++){const D=q[R];k(D)&&J(Re,D.getAttribute(y),y,o,D)}}i&&i(h)}const m=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let h;for(;(h=C.exec(e))!==null;)m.push(h[1])}else m.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:m.concat(s),onAttributeChange:r,onAttrChange:u,effects:a,declared:w,persist:p}),Ae();const T=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:T}),_e(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function g(){me()>0?ge(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),b}function Y(e){return(e||"").replace(/^#/,"")}function I(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 r=l[s];if(!r)continue;const c=r.indexOf(":"),i=c>-1?r.slice(0,c):r,u=c>-1?r.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Se(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 Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(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=I,window.lnCore.hashGet=ke,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Te);function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=qe),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",o="data-ln-modal-close";if(window[t]!==void 0)return;const l={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},s=new Set;let r=null;function c(){r||(r=function(d){if(Z(d))return;const a=d.target.closest("["+n+"]");if(!a||ee(a))return;const w=a.getAttribute(n);if(!w)return;const p=document.getElementById(w);!p||!p[t]||(d.preventDefault(),a.hasAttribute("data-ln-modal-mode")?p.setAttribute("data-ln-modal-mode",a.getAttribute("data-ln-modal-mode")):p.hasAttribute("data-ln-modal-mode")&&p.setAttribute("data-ln-modal-mode","new"),p.setAttribute(e,"open"))},document.addEventListener("click",r))}function i(){s.size>0||!r||(document.removeEventListener("click",r),r=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open";const a=this;return this._onRequestOpen=function(){a.dom.setAttribute(e,"open")},this._onRequestClose=function(){a.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),a.dom.setAttribute(e,"close")},this._onClose=function(){!a.isOpen||a.dom.getAttribute(e)!=="open"||a.dom.open||(a._isNativeClosing=!0,a.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const p=w.target.closest("["+o+"]");p&&a.dom.contains(p)&&(w.preventDefault(),a.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),s.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),A(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}u.prototype.open=function(){this.dom.setAttribute(e,"open")},u.prototype.close=function(){this.dom.setAttribute(e,"close")},u.prototype.toggle=function(){const d=this.dom.getAttribute(e);this.dom.setAttribute(e,d==="open"?"close":"open")},u.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),s.delete(this),i(),this.isOpen){const d=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==d})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(d){const a=d[t];if(!a)return;const w=!!a._isNativeClosing;a._isNativeClosing=!1;const b=d.getAttribute(e)==="open";if(b===a.isOpen){b&&d.isConnected&&!d.open&&typeof d.showModal=="function"&&d.showModal();return}if(b){if(M(d,"ln-modal:before-open",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"close");return}a.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof d.showModal=="function"&&d.showModal();const _=d.querySelector("[autofocus]");if(_&&x(_))_.focus();else{const T=d.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),g=Array.prototype.find.call(T,x);if(g)g.focus();else{const C=d.querySelectorAll("a[href], button:not([disabled])"),h=Array.prototype.find.call(C,x);h&&h.focus()}}A(d,"ln-modal:open",{modalId:d.id,target:d})}else{if(!w&&M(d,"ln-modal:before-close",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"open");return}a.isOpen=!1,d.hasAttribute("data-ln-modal-mode")&&d.setAttribute("data-ln-modal-mode","new"),typeof d.close=="function"&&d.open&&d.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),A(d,"ln-modal:close",{modalId:d.id,target:d})}}X(e,t,u,"ln-modal",{attributes:l})})()})();
|
|
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 k(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(!k(o))return}e.apply(console,t)}}function v(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 M(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}function _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function x(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function Z(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ee(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&r[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.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 re(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const i=t[c];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=oe(i);o.push(r)}else if(r.type==="radio")r.checked=r.value===String(i),o.push(r);else if(r.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<r.options.length;u++)r.options[u].selected=i.indexOf(r.options[u].value)!==-1;o.push(r)}else r.value=i,r.tagName==="SELECT"&&i!=null&&r.setAttribute("data-ln-value",i),o.push(r)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const $={};function ie(e,t){$[e]=t}function le(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ce(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=se);const S={};function ue(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=S[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const c=n[r],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const c=o[r],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],c=r.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function fe(e,t,n,o,l,s){const r={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(r[f]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(o(u));let d=r[f];if(d)l(d,u,i);else{const a=ue(n,s);if(!a||(j(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,u,i)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=fe);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function W(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function U(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 V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(s,r){const c=s.getAttribute(r);return c!==null&&o.has(c)?c:t};return E.set(n,l),l}function K(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function G(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Q(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(r==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function we(e,t,n){for(const o in n){const[l,s,r]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,r)},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=H(o.values,o.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=G;break;case"string":default:l=O;break}l||(l=O),t[o.prop]=[l,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=we,window.lnCore.attrSpec=pe,window.lnCore.attrStr=O,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=G);function L(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const c of r)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(i){console.error("["+n+"] init failed",c,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 ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=J(),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=be(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 P(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ye(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=J(),l=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&k(t)){const s=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let c=0;c<s.length;c++)Q(s[c].spec,r,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&P(s,t,n,e.oldValue),o.reactiveWildcard.length&&P(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(L(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ye(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ve(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];L(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,c=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&c.push(o);for(let i=0;i<c.length;i++){const u=c[i];if(!document.contains(u)){const f=u[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",u,d)}delete u[s.attribute]}}}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ve(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,a=d?he(d):f,w=d?new Set(Object.keys(d)):null,p=l.persist||null;function b(y){const h=y||document.body;if(L(h,e,t,n),d&&F())for(const A in d){const Re=d[A],q=Array.from(h.querySelectorAll("["+A+"]"));h.matches&&h.matches("["+A+"]")&&q.push(h);for(let R=0;R<q.length;R++){const D=q[R];k(D)&&Q(Re,D.getAttribute(A),A,o,D)}}i&&i(h)}const m=[];if(e.indexOf("[")!==-1){const y=/\[([\w-]+)/g;let h;for(;(h=y.exec(e))!==null;)m.push(h[1])}else m.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:m.concat(s),onAttributeChange:r,onAttrChange:u,effects:a,declared:w,persist:p}),Ae();const g=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,T=l.subtreeQuery||(g?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:T}),_e(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function C(){me()>0?ge(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",C):C(),b}function Y(e){return(e||"").replace(/^#/,"")}function I(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 r=l[s];if(!r)continue;const c=r.indexOf(":"),i=c>-1?r.slice(0,c):r,u=c>-1?r.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Se(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 Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(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=I,window.lnCore.hashGet=ke,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Te);function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=qe),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",o="data-ln-modal-close";if(window[t]!==void 0)return;const l={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},s=new Set;let r=null;function c(){r||(r=function(d){if(Z(d))return;const a=d.target.closest("["+n+"]");if(!a||ee(a))return;const w=a.getAttribute(n);if(!w)return;const p=document.getElementById(w);!p||!p[t]||(d.preventDefault(),a.hasAttribute("data-ln-modal-mode")?p.setAttribute("data-ln-modal-mode",a.getAttribute("data-ln-modal-mode")):p.hasAttribute("data-ln-modal-mode")&&p.setAttribute("data-ln-modal-mode","new"),p.setAttribute(e,"open"))},document.addEventListener("click",r))}function i(){s.size>0||!r||(document.removeEventListener("click",r),r=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open";const a=this;return this._onRequestOpen=function(){a.dom.setAttribute(e,"open")},this._onRequestClose=function(){a.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),a.dom.setAttribute(e,"close")},this._onClose=function(){!a.isOpen||a.dom.getAttribute(e)!=="open"||a.dom.open||(a._isNativeClosing=!0,a.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const p=w.target.closest("["+o+"]");p&&a.dom.contains(p)&&(w.preventDefault(),a.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),s.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),v(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}u.prototype.open=function(){this.dom.setAttribute(e,"open")},u.prototype.close=function(){this.dom.setAttribute(e,"close")},u.prototype.toggle=function(){const d=this.dom.getAttribute(e);this.dom.setAttribute(e,d==="open"?"close":"open")},u.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),s.delete(this),i(),this.isOpen){const d=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==d})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(d){const a=d[t];if(!a)return;const w=!!a._isNativeClosing;a._isNativeClosing=!1;const b=d.getAttribute(e)==="open";if(b===a.isOpen){b&&d.isConnected&&!d.open&&typeof d.showModal=="function"&&d.showModal();return}if(b){if(M(d,"ln-modal:before-open",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"close");return}a.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof d.showModal=="function"&&d.showModal();const g=d.querySelector("[autofocus]");if(g&&x(g))g.focus();else{const T=d.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),C=Array.prototype.find.call(T,x);if(C)C.focus();else{const y=d.querySelectorAll("a[href], button:not([disabled])"),h=Array.prototype.find.call(y,x);h&&h.focus()}}v(d,"ln-modal:open",{modalId:d.id,target:d})}else{if(!w&&M(d,"ln-modal:before-close",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"open");return}a.isOpen=!1,d.hasAttribute("data-ln-modal-mode")&&d.setAttribute("data-ln-modal-mode","new"),typeof d.close=="function"&&d.open&&d.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),v(d,"ln-modal:close",{modalId:d.id,target:d})}}X(e,t,u,"ln-modal",{attributes:l})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!y(r))return}e.apply(console,t)}}function I(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 X(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 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 Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},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")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&i[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);i[o.name]=o.value===""||isNaN(c)?null:c}else i[o.name]=o.value}return i}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const 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(i[l.name]>1){const c=String(o).split(",").map(function(u){return u.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ee(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<l.options.length;c++)l.options[c].selected=o.indexOf(l.options[c].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const T={};function ne(e,t){T[e]=t}function re(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function ie(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const v={};function se(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[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 u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(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]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[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,r))}}return e}function ce(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(l[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=l[u];if(d)i(d,c,o);else{const f=se(n,s);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=F,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function A(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function x(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const r=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return k.set(n,i),i}function B(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function W(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function H(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(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 U(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function V(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=j(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=B;break;case"boolean":i=x;break;case"list":i=q;break;case"json":i=W;break;case"string":default:i=A;break}i||(i=A),t[r.prop]=[i,n,r.fallback]}return t}function ue(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 de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=U,window.lnCore.attrSpec=V,window.lnCore.attrStr=A,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=q,window.lnCore.attrEnum=j,window.lnCore.attrFloat=B,window.lnCore.attrJson=W);function _(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 he(e){const t=P(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=P(),i=r.byAttr.get(n);if($()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&y(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)H(s[a].spec,l,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&z(s,t,n,e.oldValue),r.reactiveWildcard.length&&z(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(_(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function be(){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{pe(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 J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];_(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function K(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?ue(d):u,w=d?new Set(Object.keys(d)):null,b=i.persist||null;function p(O){const h=O||document.body;if(_(h,e,t,n),d&&$())for(const C in d){const Ee=d[C],L=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&L.push(h);for(let E=0;E<L.length;E++){const N=L[E];y(N)&&H(Ee,N.getAttribute(C),C,r,N)}}o&&o(h)}const g=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let h;for(;(h=O.exec(e))!==null;)g.push(h[1])}else g.push(e);he({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:l,onAttrChange:c,effects:f,declared:w,persist:b}),be();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";J().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le}),Ce(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K);function G(){fe()>0?we(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),p}function Q(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=Q(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const 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 me(e){if(!e)return null;const t=S();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Q(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Se);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const n={"data-ln-nav":{effect:l,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:x,effect:l,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},r=V(n);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const a=history.pushState;history.pushState=function(){a.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const o=history.replaceState;history.replaceState=function(){o.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function i(a){return this.dom=a,U(this,a,r),this.activeClass=a.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=new MutationObserver(()=>this.update()),this.observer.observe(a,{childList:!0,subtree:!0}),this.update(),this}i.prototype.update=function(){if(!this.activeClass||X(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const o=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,u=s(c),d=[];for(const f of o){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const b=s(w),p=b===u,g=!this.exact&&b!=="/"&&u.startsWith(b+"/");p||g?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),d.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}I(this.dom,"ln-nav:update",{target:this.dom,activeLinks:d})},i.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const a=history._lnNavCallbacks.indexOf(this.updateHandler);a!==-1&&history._lnNavCallbacks.splice(a,1),delete this.dom[t]};function s(a){try{return new URL(a,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return a.replace(/\/$/,"")||"/"}}function l(a,o){const c=a[t];if(c){if(o===e){if(!a.hasAttribute(e)){c.destroy();return}const u=c.activeClass,d=a.getAttribute(e)||"active";if(u!==d){const f=a.querySelectorAll("a");for(const w of f)u&&w.classList.remove(u);c.activeClass=d}}c.update()}}K(e,t,i,"ln-nav",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!y(r))return}e.apply(console,t)}}function I(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 X(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 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 Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},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")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let c=0;c<o.options.length;c++)o.options[c].selected&&i[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);i[o.name]=o.value===""||isNaN(c)?null:c}else i[o.name]=o.value}return i}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const 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(i[l.name]>1){const c=String(o).split(",").map(function(u){return u.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ee(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<l.options.length;c++)l.options[c].selected=o.indexOf(l.options[c].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const T={};function ne(e,t){T[e]=t}function re(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function ie(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const v={};function se(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[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 u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(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]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[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,r))}}return e}function ce(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(l[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=l[u];if(d)i(d,c,o);else{const f=se(n,s);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=F,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function A(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function x(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const r=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return k.set(n,i),i}function B(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function W(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function H(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(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 U(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function V(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=j(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=B;break;case"boolean":i=x;break;case"list":i=q;break;case"json":i=W;break;case"string":default:i=A;break}i||(i=A),t[r.prop]=[i,n,r.fallback]}return t}function ue(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 de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=U,window.lnCore.attrSpec=V,window.lnCore.attrStr=A,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=q,window.lnCore.attrEnum=j,window.lnCore.attrFloat=B,window.lnCore.attrJson=W);function _(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 he(e){const t=P(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=de(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 Q(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=P(),i=r.byAttr.get(n);if($()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&y(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)H(s[a].spec,l,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Q(s,t,n,e.oldValue),r.reactiveWildcard.length&&Q(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(_(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function pe(){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{be(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 z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];_(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function J(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?ue(d):u,w=d?new Set(Object.keys(d)):null,p=i.persist||null;function b(O){const h=O||document.body;if(_(h,e,t,n),d&&$())for(const C in d){const Ne=d[C],L=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&L.push(h);for(let E=0;E<L.length;E++){const N=L[E];y(N)&&H(Ne,N.getAttribute(C),C,r,N)}}o&&o(h)}const g=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let h;for(;(h=O.exec(e))!==null;)g.push(h[1])}else g.push(e);he({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:l,onAttrChange:c,effects:f,declared:w,persist:p}),pe();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ee=i.subtreeQuery||(Le?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Ee}),Ce(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=J);function G(){fe()>0?we(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function K(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=K(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const 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 me(e){if(!e)return null;const t=S();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");K(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Se);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const n={"data-ln-nav":{effect:l,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:x,effect:l,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},r=V(n);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const a=history.pushState;history.pushState=function(){a.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const o=history.replaceState;history.replaceState=function(){o.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function i(a){return this.dom=a,U(this,a,r),this.activeClass=a.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=new MutationObserver(()=>this.update()),this.observer.observe(a,{childList:!0,subtree:!0}),this.update(),this}i.prototype.update=function(){if(!this.activeClass||X(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const o=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,u=s(c),d=[];for(const f of o){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const p=s(w),b=p===u,g=!this.exact&&p!=="/"&&u.startsWith(p+"/");b||g?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),d.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}I(this.dom,"ln-nav:update",{target:this.dom,activeLinks:d})},i.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const a=history._lnNavCallbacks.indexOf(this.updateHandler);a!==-1&&history._lnNavCallbacks.splice(a,1),delete this.dom[t]};function s(a){try{return new URL(a,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return a.replace(/\/$/,"")||"/"}}function l(a,o){const c=a[t];if(c){if(o===e){if(!a.hasAttribute(e)){c.destroy();return}const u=c.activeClass,d=a.getAttribute(e)||"active";if(u!==d){const f=a.querySelectorAll("a");for(const w of f)u&&w.classList.remove(u);c.activeClass=d}}c.update()}}J(e,t,i,"ln-nav",{attributes:n})})()})();
|
|
@@ -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 R(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!R(r))return}e.apply(console,t)}}function x(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,n={};if(i)for(let s=0;s<a.length;s++){const l=a[s];l.name&&l.type==="checkbox"&&!l.disabled&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<a.length;s++){const l=a[s];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")i&&n[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(i&&l.type==="hidden")o[l.name]=l.value;else if(i&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const i=e.elements,r=[],o={};for(let a=0;a<i.length;a++){const n=i[a];n.name&&n.type==="checkbox"&&(o[n.name]=(o[n.name]||0)+1)}for(let a=0;a<i.length;a++){const n=i[a];if(n.type==="file"||n.type==="submit"||n.type==="button")continue;const s=n.getAttribute("data-ln-fill-as")||n.name;if(!s||!(s in t))continue;const l=t[s];if(n.type==="checkbox"){if(Array.isArray(l))n.checked=l.indexOf(n.value)!==-1;else if(o[n.name]>1){const u=String(l).split(",").map(function(c){return c.trim()});n.checked=u.indexOf(n.value)!==-1}else n.checked=le(l);r.push(n)}else if(n.type==="radio")n.checked=n.value===String(l),r.push(n);else if(n.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<n.options.length;u++)n.options[u].selected=l.indexOf(n.options[u].value)!==-1;r.push(n)}else n.value=l,n.tagName==="SELECT"&&l!=null&&n.setAttribute("data-ln-value",l),r.push(n)}return r}function ae(e,t,{get:i,set:r}){Object.defineProperty(e,"value",{get:function(){return i?i.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const V={};function ue(e,t){V[e]=t}function ce(e){return V[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=ce);function y(e){const t=e?e.closest("[lang]"):null,i=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return i?i.trim():"en-US"}function B(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function de(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];q[i]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=B);const F={};function we(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=F[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const s=i[n],l=s.getAttribute("data-ln-field");t[l]!=null&&(s.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<r.length;n++){const s=r[n],l=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let n=0;n<o.length;n++){const s=o[n],l=s.getAttribute("data-ln-show");l in t&&s.classList.toggle("hidden",!t[l])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],l=s.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function P(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,n){return t[n]!==void 0?t[n]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const n=o[a],s=n.attributes;for(let l=0;l<s.length;l++){const u=s[l];u.value.indexOf("{{")!==-1&&n.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function he(e,t,i,r,o,a){const n={};for(let l=0;l<e.children.length;l++){const u=e.children[l],c=u.getAttribute("data-ln-render-key");c&&(n[c]=u)}const s=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],c=String(r(u));let d=n[c];if(d)o(d,u,l);else{const f=we(i,a);if(!f||(P(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),o(d,u,l)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=W,window.lnCore.lnFill=pe,window.lnCore.renderList=he);function O(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function U(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function K(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const L=new Map;function J(e,t){const i=(e?e.join("|"):"")+"::"+t;if(L.has(i))return L.get(i);const r=new Set(e||[]),o=function(a,n){const s=a.getAttribute(n);return s!==null&&r.has(s)?s:t};return L.set(i,o),o}function Q(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function z(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function X(e,t,i,r,o){if(!e||t===null)return!0;const a=r||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=l=>{o?console.warn(l,o):console.warn(l)};if(n==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const l=e.values||[];return l.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(s(`[${a}] Value ${l} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(s(`[${a}] Value ${l} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(l){return s(`[${a}] Invalid JSON for attribute "${i}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,i){for(const r in i){const[o,a,n]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,a,n)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=J(r.values,r.fallback);break;case"integer":o=U;break;case"float":o=Q;break;case"boolean":o=K;break;case"list":o=G;break;case"json":o=z;break;case"string":default:o=O;break}o||(o=O),t[r.prop]=[o,i,r.fallback]}return t}function ge(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=be,window.lnCore.attrStr=O,window.lnCore.attrInt=U,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=J,window.lnCore.attrFloat=Q,window.lnCore.attrJson=z);function T(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&n.push(e);for(const s of n)if(!s[i]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[i]=new r(s)}catch(l){console.error("["+i+"] init failed",s,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function xe(e){const t=Y(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ye(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 Z(e,t,i,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const n=a.effects&&a.effects[i];n?n(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function ve(e){const t=e.target,i=e.attributeName;if(e.oldValue===t.getAttribute(i))return;const r=Y(),o=r.byAttr.get(i);if(M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(i)&&R(t)){const a=r.byDeclaredAttr.get(i),n=t.getAttribute(i);for(let s=0;s<a.length;s++)X(a[s].spec,n,i,a[s].componentTag,t)}if(window.lnCore._debugSink&&(i.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",i,t,{oldValue:e.oldValue,newValue:t.getAttribute(i)}),i.indexOf("data-ln-")===0){const a=r.byReactive.get(i);a&&Z(a,t,i,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,t,i,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const n=o[a];if(n.handler){n.handler(t,i,e.oldValue);continue}n.onAttributeChange&&t[n.attribute]?n.onAttributeChange(t,i):(T(t,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{ve(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ee(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ne(e){const t=ee();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange){const o=r.query,a=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;a&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o];T(r,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(r)}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o],n=a.query,s=Array.from(r.querySelectorAll(n));r.matches&&r.matches(n)&&s.push(r);for(let l=0;l<s.length;l++){const u=s[l];if(!document.contains(u)){const c=u[a.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",u,d)}delete u[a.attribute]}}}}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{Ne(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function te(e,t,i,r,o={}){const a=o.extraAttributes||[],n=o.onAttributeChange||null,s=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,c=o.effects||null,d=o.attributes||null,f=d?ge(d):c,h=d?new Set(Object.keys(d)):null,p=o.persist||null;function m(D){const w=D||document.body;if(T(w,e,t,i),d&&M())for(const g in d){const k=d[g],$=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&$.push(w);for(let H=0;H<$.length;H++){const j=$[H];R(j)&&X(k,j.getAttribute(g),g,r,j)}}l&&l(w)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let w;for(;(w=D.exec(e))!==null;)b.push(w[1])}else b.push(e);xe({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:i,onInit:l,observed:b.concat(a),onAttributeChange:n,onAttrChange:u,effects:f,declared:h,persist:p}),Ae();const N=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";ee().push({selector:e,attribute:t,ComponentFn:i,onInit:l,onSubtreeChange:s,query:N}),De(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te);function v(){Ce()>0?_e(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),m}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,i={},r=ne(t);if(!r)return i;const o=r.split("&");for(let a=0;a<o.length;a++){const n=o[a];if(!n)continue;const s=n.indexOf(":"),l=s>-1?n.slice(0,s):n,u=s>-1?n.slice(s+1):"";if(l)try{i[l]=decodeURIComponent(u)}catch{i[l]=u}}return i}function Ee(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Se(e,t){if(!e)return;const i=I();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const n=i[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");ne(location.hash)!==o&&(location.hash=o)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Te);function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ie);const _={};function S(e){const t=e||"default";if(!_[t]){const i=new Intl.NumberFormat(e,{useGrouping:!0}),r=i.formatToParts(1234.5);let o="",a=".";for(let n=0;n<r.length;n++)r[n].type==="group"&&(o=r[n].value),r[n].type==="decimal"&&(a=r[n].value);_[t]={groupSep:o,decimalSep:a,fmt:i}}return _[t]}function ie(e,t,i){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),i&&i!=="."&&(r=r.replace(i,".")),r=r.replace(/[^\d.-]/g,""),r)}function $e(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const i=e.trim();if(i===""||i==="-")return NaN;const r=S(t),o=ie(i,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function C(e,t,i={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=i.maxDecimals!=null?parseInt(i.maxDecimals,10):null,a=i.userDecimals!=null?i.userDecimals:null;if(o!==null){const n=r+"|max:"+o;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),_[n].format(e)}if(a!==null&&a>0){const n=r+"|exact:"+a;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),_[n].format(e)}return S(t).fmt.format(e)}function He(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let i=t,r=0;for(let o=0;o<e.length&&i>0;o++)r=o+1,/[0-9]/.test(e[o])&&i--;return i>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function i(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const r={"data-ln-number":{type:"marker",effect:i,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:i,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:i,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:i,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:i,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function a(n){if(n[t])return n[t];n[t]=this,this.dom=n;const s=this;if(this._onLocaleChange=function(){s.isTextElement?s._formatTextContent():isNaN(s.value)||s._displayFormatted(s.value)},B(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const l=document.createElement("input");l.type="hidden",l.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&l.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",l),this._hidden=l,Object.defineProperty(l,"value",{get:function(){return o.get.call(l)},set:function(c){if(o.set.call(l,c),c!==""&&!isNaN(parseFloat(c))){const d=s.dom.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(parseFloat(c),y(s.dom),{maxDecimals:d}))}else s._setDisplayRaw("");s.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),ae(n,o,{get:function(){return o.get.call(n)},set:function(c){if(c===""){s._setDisplayRaw(""),s._setHiddenRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}));return}const d=typeof c=="number"?c:parseFloat(String(c));if(isNaN(d))s._setDisplayRaw(String(c)),s._setHiddenRaw("");else{s._setHiddenRaw(d);const f=n.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(d,y(n),{maxDecimals:f}))}n.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){s._handleInput()},n.addEventListener("input",this._onInput),this._onKeyDown=function(c){if(c.key!=="Backspace")return;const d=n.selectionStart,f=n.selectionEnd;if(d!==f||d===0)return;const h=S(y(n)),p=o.get.call(n),m=p[d-1];if(m===h.groupSep||/\s/.test(m)){c.preventDefault();const b=d-2>=0?d-2:0,A=p.slice(0,b)+p.slice(d);o.set.call(n,A),n.setSelectionRange(b,b),n.dispatchEvent(new Event("input",{bubbles:!0}))}},n.addEventListener("keydown",this._onKeyDown),this._onPaste=function(c){c.preventDefault();const d=(c.clipboardData||window.clipboardData).getData("text"),f=$e(d,y(n));s.value=isNaN(f)?NaN:f},n.addEventListener("paste",this._onPaste);const u=n.value;if(u!==""){const c=parseFloat(u);if(!isNaN(c)){const d=n.getAttribute("data-ln-number-decimals");this._setHiddenRaw(c),this._setDisplayRaw(C(c,y(n),{maxDecimals:d})),n.dispatchEvent(new Event("input",{bubbles:!0}))}}return n.form&&(this._onFormReset=function(){setTimeout(function(){const c=n.defaultValue;if(c!==""){const d=parseFloat(c);if(!isNaN(d)){const f=n.getAttribute("data-ln-number-decimals");s._setHiddenRaw(d),s._setDisplayRaw(C(d,y(n),{maxDecimals:f})),n.dispatchEvent(new Event("input",{bubbles:!0}));return}}s._setHiddenRaw(""),s._setDisplayRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}))},0)},n.form.addEventListener("reset",this._onFormReset)),this}a.prototype._initTextElement=function(){const n=this.dom;let s=n.getAttribute("data-ln-value"),l=n.getAttribute("data-ln-number"),u=null;s!==null&&s!==""?u=s:l!==null&&l!==""&&l!=="true"?u=l:u=n.textContent.trim();const c=parseFloat(u);isNaN(c)?this._rawValue=null:(this._rawValue=c,n.hasAttribute("data-ln-value")||n.setAttribute("data-ln-value",String(c)),this._formatTextContent())},a.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const n=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=C(this._rawValue,y(this.dom),{maxDecimals:n})}},a.prototype._handleInput=function(){const n=this.dom,s=o.get.call(n);if(s===""){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:""});return}if(s==="-"){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:"-"});return}const l=n.selectionStart;let u=0;for(let w=0;w<l;w++)/[0-9]/.test(s[w])&&u++;const c=y(n),d=S(c);let f=s,h=ie(s,d.groupSep,d.decimalSep),p=parseFloat(h);if(isNaN(p)){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=h.indexOf(".");if(m!==null&&b!==-1){const w=parseInt(m,10),g=h.slice(b+1);if(w===0)h=h.slice(0,b),f=f.split(d.decimalSep)[0],p=parseFloat(h),this._setDisplayRaw(f);else if(g.length>w){h=h.slice(0,b+1+w);const k=f.split(d.decimalSep);f=k[0]+d.decimalSep+k[1].slice(0,w),p=parseFloat(h),this._setDisplayRaw(f)}}const A=n.getAttribute("data-ln-number-max");if(A!==null&&p>parseFloat(A)){const w=parseFloat(A),g=C(w,c,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(w),n.setSelectionRange(g.length,g.length),x(n,"ln-number:input",{value:w,formatted:g});return}if(f.endsWith(d.decimalSep)||d.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:f});return}const N=h.indexOf(".");if(N!==-1&&h.slice(N+1).endsWith("0")){this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:f});return}let v;if(m!==null)v=C(p,c,{maxDecimals:m});else{const w=N!==-1?h.slice(N+1).length:0;v=C(p,c,{userDecimals:w})}this._setDisplayRaw(v);const D=He(v,u);n.setSelectionRange(D,D),this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:v})},a.prototype._setHiddenRaw=function(n){this._hidden&&o.set.call(this._hidden,String(n))},a.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):o.set.call(this.dom,String(n))},a.prototype._displayFormatted=function(n){if(this.isTextElement)this._formatTextContent();else{const s=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(n,y(this.dom),{maxDecimals:s}))}},Object.defineProperty(a.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const n=o.get.call(this._hidden);return n===""?NaN:parseFloat(n)},set:function(n){const s=typeof n=="number"?n:parseFloat(n);if(this.isTextElement){isNaN(s)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=s,this.dom.setAttribute("data-ln-value",String(s)),this._formatTextContent());return}if(isNaN(s)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(s);const l=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(s,y(this.dom),{maxDecimals:l})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(a.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),a.prototype.destroy=function(){this.dom[t]&&(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},te(e,t,a,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:i})})()})();
|
|
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 R(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!R(r))return}e.apply(console,t)}}function v(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,n={};if(i)for(let s=0;s<a.length;s++){const l=a[s];l.name&&l.type==="checkbox"&&!l.disabled&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<a.length;s++){const l=a[s];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")i&&n[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(i&&l.type==="hidden")o[l.name]=l.value;else if(i&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const i=e.elements,r=[],o={};for(let a=0;a<i.length;a++){const n=i[a];n.name&&n.type==="checkbox"&&(o[n.name]=(o[n.name]||0)+1)}for(let a=0;a<i.length;a++){const n=i[a];if(n.type==="file"||n.type==="submit"||n.type==="button")continue;const s=n.getAttribute("data-ln-fill-as")||n.name;if(!s||!(s in t))continue;const l=t[s];if(n.type==="checkbox"){if(Array.isArray(l))n.checked=l.indexOf(n.value)!==-1;else if(o[n.name]>1){const u=String(l).split(",").map(function(c){return c.trim()});n.checked=u.indexOf(n.value)!==-1}else n.checked=le(l);r.push(n)}else if(n.type==="radio")n.checked=n.value===String(l),r.push(n);else if(n.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<n.options.length;u++)n.options[u].selected=l.indexOf(n.options[u].value)!==-1;r.push(n)}else n.value=l,n.tagName==="SELECT"&&l!=null&&n.setAttribute("data-ln-value",l),r.push(n)}return r}function ae(e,t,{get:i,set:r}){Object.defineProperty(e,"value",{get:function(){return i?i.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const V={};function ue(e,t){V[e]=t}function ce(e){return V[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=ce);function y(e){const t=e?e.closest("[lang]"):null,i=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return i?i.trim():"en-US"}function B(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function de(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];q[i]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=B);const F={};function we(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=F[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const s=i[n],l=s.getAttribute("data-ln-field");t[l]!=null&&(s.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<r.length;n++){const s=r[n],l=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let n=0;n<o.length;n++){const s=o[n],l=s.getAttribute("data-ln-show");l in t&&s.classList.toggle("hidden",!t[l])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],l=s.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function P(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,n){return t[n]!==void 0?t[n]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const n=o[a],s=n.attributes;for(let l=0;l<s.length;l++){const u=s[l];u.value.indexOf("{{")!==-1&&n.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function he(e,t,i,r,o,a){const n={};for(let l=0;l<e.children.length;l++){const u=e.children[l],c=u.getAttribute("data-ln-render-key");c&&(n[c]=u)}const s=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],c=String(r(u));let d=n[c];if(d)o(d,u,l);else{const f=we(i,a);if(!f||(P(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),o(d,u,l)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=W,window.lnCore.lnFill=pe,window.lnCore.renderList=he);function O(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function U(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function K(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function Q(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const L=new Map;function G(e,t){const i=(e?e.join("|"):"")+"::"+t;if(L.has(i))return L.get(i);const r=new Set(e||[]),o=function(a,n){const s=a.getAttribute(n);return s!==null&&r.has(s)?s:t};return L.set(i,o),o}function J(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function z(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function X(e,t,i,r,o){if(!e||t===null)return!0;const a=r||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=l=>{o?console.warn(l,o):console.warn(l)};if(n==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const l=e.values||[];return l.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(s(`[${a}] Value ${l} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(s(`[${a}] Value ${l} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(l){return s(`[${a}] Invalid JSON for attribute "${i}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,i){for(const r in i){const[o,a,n]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,a,n)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=G(r.values,r.fallback);break;case"integer":o=U;break;case"float":o=J;break;case"boolean":o=K;break;case"list":o=Q;break;case"json":o=z;break;case"string":default:o=O;break}o||(o=O),t[r.prop]=[o,i,r.fallback]}return t}function ge(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=be,window.lnCore.attrStr=O,window.lnCore.attrInt=U,window.lnCore.attrBool=K,window.lnCore.attrList=Q,window.lnCore.attrEnum=G,window.lnCore.attrFloat=J,window.lnCore.attrJson=z);function T(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&n.push(e);for(const s of n)if(!s[i]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[i]=new r(s)}catch(l){console.error("["+i+"] init failed",s,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ve(e){const t=Y(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ye(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 Z(e,t,i,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const n=a.effects&&a.effects[i];n?n(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function xe(e){const t=e.target,i=e.attributeName;if(e.oldValue===t.getAttribute(i))return;const r=Y(),o=r.byAttr.get(i);if(M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(i)&&R(t)){const a=r.byDeclaredAttr.get(i),n=t.getAttribute(i);for(let s=0;s<a.length;s++)X(a[s].spec,n,i,a[s].componentTag,t)}if(window.lnCore._debugSink&&(i.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",i,t,{oldValue:e.oldValue,newValue:t.getAttribute(i)}),i.indexOf("data-ln-")===0){const a=r.byReactive.get(i);a&&Z(a,t,i,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,t,i,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const n=o[a];if(n.handler){n.handler(t,i,e.oldValue);continue}n.onAttributeChange&&t[n.attribute]?n.onAttributeChange(t,i):(T(t,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{xe(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ee(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ne(e){const t=ee();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange){const o=r.query,a=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;a&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o];T(r,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(r)}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o],n=a.query,s=Array.from(r.querySelectorAll(n));r.matches&&r.matches(n)&&s.push(r);for(let l=0;l<s.length;l++){const u=s[l];if(!document.contains(u)){const c=u[a.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",u,d)}delete u[a.attribute]}}}}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{Ne(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function te(e,t,i,r,o={}){const a=o.extraAttributes||[],n=o.onAttributeChange||null,s=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,c=o.effects||null,d=o.attributes||null,f=d?ge(d):c,h=d?new Set(Object.keys(d)):null,p=o.persist||null;function m(D){const w=D||document.body;if(T(w,e,t,i),d&&M())for(const g in d){const k=d[g],$=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&$.push(w);for(let H=0;H<$.length;H++){const j=$[H];R(j)&&X(k,j.getAttribute(g),g,r,j)}}l&&l(w)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let w;for(;(w=D.exec(e))!==null;)b.push(w[1])}else b.push(e);ve({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:i,onInit:l,observed:b.concat(a),onAttributeChange:n,onAttrChange:u,effects:f,declared:h,persist:p}),Ae();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,N=o.subtreeQuery||(A?e:"["+e+"]");ee().push({selector:e,attribute:t,ComponentFn:i,onInit:l,onSubtreeChange:s,query:N}),De(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te);function x(){Ce()>0?_e(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),m}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,i={},r=ne(t);if(!r)return i;const o=r.split("&");for(let a=0;a<o.length;a++){const n=o[a];if(!n)continue;const s=n.indexOf(":"),l=s>-1?n.slice(0,s):n,u=s>-1?n.slice(s+1):"";if(l)try{i[l]=decodeURIComponent(u)}catch{i[l]=u}}return i}function Ee(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Se(e,t){if(!e)return;const i=I();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const n=i[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");ne(location.hash)!==o&&(location.hash=o)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Te);function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ie);const _={};function S(e){const t=e||"default";if(!_[t]){const i=new Intl.NumberFormat(e,{useGrouping:!0}),r=i.formatToParts(1234.5);let o="",a=".";for(let n=0;n<r.length;n++)r[n].type==="group"&&(o=r[n].value),r[n].type==="decimal"&&(a=r[n].value);_[t]={groupSep:o,decimalSep:a,fmt:i}}return _[t]}function ie(e,t,i){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),i&&i!=="."&&(r=r.replace(i,".")),r=r.replace(/[^\d.-]/g,""),r)}function $e(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const i=e.trim();if(i===""||i==="-")return NaN;const r=S(t),o=ie(i,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function C(e,t,i={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=i.maxDecimals!=null?parseInt(i.maxDecimals,10):null,a=i.userDecimals!=null?i.userDecimals:null;if(o!==null){const n=r+"|max:"+o;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),_[n].format(e)}if(a!==null&&a>0){const n=r+"|exact:"+a;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),_[n].format(e)}return S(t).fmt.format(e)}function He(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let i=t,r=0;for(let o=0;o<e.length&&i>0;o++)r=o+1,/[0-9]/.test(e[o])&&i--;return i>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function i(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const r={"data-ln-number":{type:"marker",effect:i,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:i,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:i,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:i,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:i,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function a(n){if(n[t])return n[t];n[t]=this,this.dom=n;const s=this;if(this._onLocaleChange=function(){s.isTextElement?s._formatTextContent():isNaN(s.value)||s._displayFormatted(s.value)},B(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const l=document.createElement("input");l.type="hidden",l.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&l.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",l),this._hidden=l,Object.defineProperty(l,"value",{get:function(){return o.get.call(l)},set:function(c){if(o.set.call(l,c),c!==""&&!isNaN(parseFloat(c))){const d=s.dom.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(parseFloat(c),y(s.dom),{maxDecimals:d}))}else s._setDisplayRaw("");s.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),ae(n,o,{get:function(){return o.get.call(n)},set:function(c){if(c===""){s._setDisplayRaw(""),s._setHiddenRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}));return}const d=typeof c=="number"?c:parseFloat(String(c));if(isNaN(d))s._setDisplayRaw(String(c)),s._setHiddenRaw("");else{s._setHiddenRaw(d);const f=n.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(d,y(n),{maxDecimals:f}))}n.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){s._handleInput()},n.addEventListener("input",this._onInput),this._onKeyDown=function(c){if(c.key!=="Backspace")return;const d=n.selectionStart,f=n.selectionEnd;if(d!==f||d===0)return;const h=S(y(n)),p=o.get.call(n),m=p[d-1];if(m===h.groupSep||/\s/.test(m)){c.preventDefault();const b=d-2>=0?d-2:0,A=p.slice(0,b)+p.slice(d);o.set.call(n,A),n.setSelectionRange(b,b),n.dispatchEvent(new Event("input",{bubbles:!0}))}},n.addEventListener("keydown",this._onKeyDown),this._onPaste=function(c){c.preventDefault();const d=(c.clipboardData||window.clipboardData).getData("text"),f=$e(d,y(n));s.value=isNaN(f)?NaN:f},n.addEventListener("paste",this._onPaste);const u=n.value;if(u!==""){const c=parseFloat(u);if(!isNaN(c)){const d=n.getAttribute("data-ln-number-decimals");this._setHiddenRaw(c),this._setDisplayRaw(C(c,y(n),{maxDecimals:d})),n.dispatchEvent(new Event("input",{bubbles:!0}))}}return n.form&&(this._onFormReset=function(){setTimeout(function(){const c=n.defaultValue;if(c!==""){const d=parseFloat(c);if(!isNaN(d)){const f=n.getAttribute("data-ln-number-decimals");s._setHiddenRaw(d),s._setDisplayRaw(C(d,y(n),{maxDecimals:f})),n.dispatchEvent(new Event("input",{bubbles:!0}));return}}s._setHiddenRaw(""),s._setDisplayRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}))},0)},n.form.addEventListener("reset",this._onFormReset)),this}a.prototype._initTextElement=function(){const n=this.dom;let s=n.getAttribute("data-ln-value"),l=n.getAttribute("data-ln-number"),u=null;s!==null&&s!==""?u=s:l!==null&&l!==""&&l!=="true"?u=l:u=n.textContent.trim();const c=parseFloat(u);isNaN(c)?this._rawValue=null:(this._rawValue=c,n.hasAttribute("data-ln-value")||n.setAttribute("data-ln-value",String(c)),this._formatTextContent())},a.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const n=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=C(this._rawValue,y(this.dom),{maxDecimals:n})}},a.prototype._handleInput=function(){const n=this.dom,s=o.get.call(n);if(s===""){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:""});return}if(s==="-"){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:"-"});return}const l=n.selectionStart;let u=0;for(let w=0;w<l;w++)/[0-9]/.test(s[w])&&u++;const c=y(n),d=S(c);let f=s,h=ie(s,d.groupSep,d.decimalSep),p=parseFloat(h);if(isNaN(p)){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=h.indexOf(".");if(m!==null&&b!==-1){const w=parseInt(m,10),g=h.slice(b+1);if(w===0)h=h.slice(0,b),f=f.split(d.decimalSep)[0],p=parseFloat(h),this._setDisplayRaw(f);else if(g.length>w){h=h.slice(0,b+1+w);const k=f.split(d.decimalSep);f=k[0]+d.decimalSep+k[1].slice(0,w),p=parseFloat(h),this._setDisplayRaw(f)}}const A=n.getAttribute("data-ln-number-max");if(A!==null&&p>parseFloat(A)){const w=parseFloat(A),g=C(w,c,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(w),n.setSelectionRange(g.length,g.length),v(n,"ln-number:input",{value:w,formatted:g});return}if(f.endsWith(d.decimalSep)||d.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(p),v(n,"ln-number:input",{value:p,formatted:f});return}const N=h.indexOf(".");if(N!==-1&&h.slice(N+1).endsWith("0")){this._setHiddenRaw(p),v(n,"ln-number:input",{value:p,formatted:f});return}let x;if(m!==null)x=C(p,c,{maxDecimals:m});else{const w=N!==-1?h.slice(N+1).length:0;x=C(p,c,{userDecimals:w})}this._setDisplayRaw(x);const D=He(x,u);n.setSelectionRange(D,D),this._setHiddenRaw(p),v(n,"ln-number:input",{value:p,formatted:x})},a.prototype._setHiddenRaw=function(n){this._hidden&&o.set.call(this._hidden,String(n))},a.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):o.set.call(this.dom,String(n))},a.prototype._displayFormatted=function(n){if(this.isTextElement)this._formatTextContent();else{const s=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(n,y(this.dom),{maxDecimals:s}))}},Object.defineProperty(a.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const n=o.get.call(this._hidden);return n===""?NaN:parseFloat(n)},set:function(n){const s=typeof n=="number"?n:parseFloat(n);if(this.isTextElement){isNaN(s)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=s,this.dom.setAttribute("data-ln-value",String(s)),this._formatTextContent());return}if(isNaN(s)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(s);const l=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(s,y(this.dom),{maxDecimals:l})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(a.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),a.prototype.destroy=function(){this.dom[t]&&(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},te(e,t,a,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:i})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!x(r))return}e.apply(console,t)}}function F(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,o={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&o[l.name]===1?i[l.name]=l.checked:(i[l.name]||(i[l.name]=[]),l.checked&&i[l.name].push(l.value));else if(l.type==="radio")l.checked&&(i[l.name]=l.value);else if(l.type==="select-multiple"){i[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&i[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")i[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);i[l.name]=l.value===""||isNaN(u)?null:u}else i[l.name]=l.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const l=t[c];if(o.type==="checkbox"){if(Array.isArray(l))o.checked=l.indexOf(o.value)!==-1;else if(i[o.name]>1){const u=String(l).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=se(l);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(l),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<o.options.length;u++)o.options[u].selected=l.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=l,o.tagName==="SELECT"&&l!=null&&o.setAttribute("data-ln-value",l),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const I={};function ue(e,t){I[e]=t}function fe(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=fe);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function de(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const k={};function he(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const c=n[o],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const c=r[o],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();t[w]!=null&&c.setAttribute(f,t[w])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();w in t&&c.classList.toggle(f,!!t[w])}}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)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const o=i[s],c=o.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function pe(e,t,n,r,i,s){const o={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(r(u));let f=o[a];if(f)i(f,u,l);else{const w=he(n,s);if(!w||(q(w,u),f=w.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),i(f,u,l)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=R,window.lnCore.lnFill=be,window.lnCore.renderList=pe);function _(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function j(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 H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),i=function(s,o){const c=s.getAttribute(o);return c!==null&&r.has(c)?c:t};return v.set(n,i),i}function U(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function V(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function J(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=l=>{i?console.warn(l,i):console.warn(l)};if(o==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const r in n){const[i,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,o)},enumerable:!0,configurable:!0})}return e}function me(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=W(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=U;break;case"boolean":i=j;break;case"list":i=H;break;case"json":i=V;break;case"string":default:i=_;break}i||(i=_),t[r.prop]=[i,n,r.fallback]}return t}function ye(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 Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ge,window.lnCore.attrSpec=me,window.lnCore.attrStr=_,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function S(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const c of o)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function xe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=K(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ce(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 Q(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function _e(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),i=r.byAttr.get(n);if(D()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&x(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let c=0;c<s.length;c++)J(s[c].spec,o,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Q(s,t,n,e.oldValue),r.reactiveWildcard.length&&Q(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const o=i[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(S(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{_e(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 z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];S(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],o=s.query,c=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&c.push(r);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const a=u[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",u,f)}delete u[s.attribute]}}}}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Se(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,r,i={}){const s=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,l=i.onInit||null,u=i.onAttrChange||null,a=i.effects||null,f=i.attributes||null,w=f?ye(f):a,g=f?new Set(Object.keys(f)):null,A=i.persist||null;function m(E){const p=E||document.body;if(S(p,e,t,n),f&&D())for(const y in f){const qe=f[y],N=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&N.push(p);for(let L=0;L<N.length;L++){const B=N[L];x(B)&&J(qe,B.getAttribute(y),y,r,B)}}l&&l(p)}const d=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let p;for(;(p=E.exec(e))!==null;)d.push(p[1])}else d.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:d.concat(s),onAttributeChange:o,onAttrChange:u,effects:w,declared:g,persist:A}),ve();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:b}),Te(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function oe(){Ae()>0?xe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),m}function X(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=X(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const o=i[s];if(!o)continue;const c=o.indexOf(":"),l=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function Oe(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(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 Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(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 Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Oe,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Ie);function $e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=$e);function G(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function Z(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const i=n.length;for(let s=0;s<i;s++)r+=String.fromCharCode(n[s]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function Y(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function ee(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const i=r.length||1,s=new Uint8Array(e.length);for(let o=0;o<e.length;o++)s[o]=e[o]^r[o%i];return s}function te(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const i=ee(r,t);let s="";for(let o=0;o<i.length;o++)s+=String.fromCharCode(i[o]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(i).toString("base64"):""}function ne(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);const s=ee(i,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf-8")}catch{return e}return e}function re(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,i=e.key||"ln-ashlar";return{codec:n,shift:r,key:i}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function Re(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Z(e):n.codec==="xor"?te(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,n.shift))}function O(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Y(e):n.codec==="xor"?ne(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(o){const c=o[t];c&&c.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function i(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}i.prototype.deobfuscate=function(){const o=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&o&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(d=>!this.dom.contains(d.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const d=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(h){return h.parentElement&&h.parentElement.classList&&h.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;d.nextNode();)this._originalTextNodes.push({node:d.currentNode,raw:d.currentNode.nodeValue})}const l=this.dom.getAttribute(e),u=parseInt(l,10),a=isNaN(u)?13:u,f=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),w=this.dom.getAttribute("data-ln-obfuscator-key");let g="rot";f==="xor"||f==="base64"?g=f:w&&(g="xor");const A=w||"ln-ashlar",m={codec:g,shift:a,key:A};if(o&&this.dom.getAttribute("data-ln-external-link")==="processed"){const d=this.dom.querySelectorAll(".sr-only");for(let b=0;b<d.length;b++)d[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const h=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});h.length>0?this.dom.rel=h.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const h=this._originalTextNodes[d];h.node&&h.raw&&h.raw.length>0&&(h.node.nodeValue=O(h.raw,m))}if(o&&this._originalHref){const d=O(this._originalHref,m);this.dom.setAttribute("href",d)}F(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:g,shift:a,key:g==="xor"?A:null})},i.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let o=0;o<this._originalTextNodes.length;o++){const c=this._originalTextNodes[o];c.node&&c.raw&&(c.node.nodeValue=c.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const s=P(e,t,i,"ln-obfuscator",{attributes:r});s.obfuscate=Re,s.deobfuscate=O,s.utf8ToBase64=Z,s.base64ToUtf8=Y,s.xorObfuscate=te,s.xorDeobfuscate=ne})()})();
|
|
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 x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!x(r))return}e.apply(console,t)}}function F(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,o={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&o[l.name]===1?i[l.name]=l.checked:(i[l.name]||(i[l.name]=[]),l.checked&&i[l.name].push(l.value));else if(l.type==="radio")l.checked&&(i[l.name]=l.value);else if(l.type==="select-multiple"){i[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&i[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")i[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);i[l.name]=l.value===""||isNaN(u)?null:u}else i[l.name]=l.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const l=t[c];if(o.type==="checkbox"){if(Array.isArray(l))o.checked=l.indexOf(o.value)!==-1;else if(i[o.name]>1){const u=String(l).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=se(l);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(l),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<o.options.length;u++)o.options[u].selected=l.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=l,o.tagName==="SELECT"&&l!=null&&o.setAttribute("data-ln-value",l),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const I={};function ue(e,t){I[e]=t}function fe(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=fe);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function de(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const k={};function he(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const c=n[o],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const c=r[o],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();t[w]!=null&&c.setAttribute(f,t[w])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();w in t&&c.classList.toggle(f,!!t[w])}}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)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const o=i[s],c=o.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function pe(e,t,n,r,i,s){const o={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(r(u));let f=o[a];if(f)i(f,u,l);else{const w=he(n,s);if(!w||(q(w,u),f=w.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),i(f,u,l)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=R,window.lnCore.lnFill=be,window.lnCore.renderList=pe);function _(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function j(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 H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),i=function(s,o){const c=s.getAttribute(o);return c!==null&&r.has(c)?c:t};return v.set(n,i),i}function U(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function V(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function J(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=l=>{i?console.warn(l,i):console.warn(l)};if(o==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const r in n){const[i,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,o)},enumerable:!0,configurable:!0})}return e}function me(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=W(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=U;break;case"boolean":i=j;break;case"list":i=H;break;case"json":i=V;break;case"string":default:i=_;break}i||(i=_),t[r.prop]=[i,n,r.fallback]}return t}function ye(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 Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ge,window.lnCore.attrSpec=me,window.lnCore.attrStr=_,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function S(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const c of o)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function xe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=K(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ce(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 Q(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function _e(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),i=r.byAttr.get(n);if(D()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&x(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let c=0;c<s.length;c++)J(s[c].spec,o,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Q(s,t,n,e.oldValue),r.reactiveWildcard.length&&Q(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const o=i[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(S(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{_e(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 z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];S(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],o=s.query,c=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&c.push(r);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const a=u[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",u,f)}delete u[s.attribute]}}}}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Se(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,r,i={}){const s=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,l=i.onInit||null,u=i.onAttrChange||null,a=i.effects||null,f=i.attributes||null,w=f?ye(f):a,g=f?new Set(Object.keys(f)):null,A=i.persist||null;function m(E){const p=E||document.body;if(S(p,e,t,n),f&&D())for(const y in f){const qe=f[y],N=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&N.push(p);for(let L=0;L<N.length;L++){const B=N[L];x(B)&&J(qe,B.getAttribute(y),y,r,B)}}l&&l(p)}const d=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let p;for(;(p=E.exec(e))!==null;)d.push(p[1])}else d.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:d.concat(s),onAttributeChange:o,onAttrChange:u,effects:w,declared:g,persist:A}),ve();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=i.subtreeQuery||(h?e:"["+e+"]");z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:b}),Te(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function oe(){Ae()>0?xe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),m}function X(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=X(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const o=i[s];if(!o)continue;const c=o.indexOf(":"),l=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function Oe(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(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 Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(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 Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Oe,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Ie);function $e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=$e);function G(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function Z(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const i=n.length;for(let s=0;s<i;s++)r+=String.fromCharCode(n[s]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function Y(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function ee(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const i=r.length||1,s=new Uint8Array(e.length);for(let o=0;o<e.length;o++)s[o]=e[o]^r[o%i];return s}function te(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const i=ee(r,t);let s="";for(let o=0;o<i.length;o++)s+=String.fromCharCode(i[o]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(i).toString("base64"):""}function ne(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);const s=ee(i,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf-8")}catch{return e}return e}function re(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,i=e.key||"ln-ashlar";return{codec:n,shift:r,key:i}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function Re(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Z(e):n.codec==="xor"?te(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,n.shift))}function O(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Y(e):n.codec==="xor"?ne(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(o){const c=o[t];c&&c.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function i(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}i.prototype.deobfuscate=function(){const o=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&o&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(d=>!this.dom.contains(d.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const d=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(h){return h.parentElement&&h.parentElement.classList&&h.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;d.nextNode();)this._originalTextNodes.push({node:d.currentNode,raw:d.currentNode.nodeValue})}const l=this.dom.getAttribute(e),u=parseInt(l,10),a=isNaN(u)?13:u,f=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),w=this.dom.getAttribute("data-ln-obfuscator-key");let g="rot";f==="xor"||f==="base64"?g=f:w&&(g="xor");const A=w||"ln-ashlar",m={codec:g,shift:a,key:A};if(o&&this.dom.getAttribute("data-ln-external-link")==="processed"){const d=this.dom.querySelectorAll(".sr-only");for(let b=0;b<d.length;b++)d[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const h=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});h.length>0?this.dom.rel=h.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const h=this._originalTextNodes[d];h.node&&h.raw&&h.raw.length>0&&(h.node.nodeValue=O(h.raw,m))}if(o&&this._originalHref){const d=O(this._originalHref,m);this.dom.setAttribute("href",d)}F(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:g,shift:a,key:g==="xor"?A:null})},i.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let o=0;o<this._originalTextNodes.length;o++){const c=this._originalTextNodes[o];c.node&&c.raw&&(c.node.nodeValue=c.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const s=P(e,t,i,"ln-obfuscator",{attributes:r});s.obfuscate=Re,s.deobfuscate=O,s.utf8ToBase64=Z,s.base64ToUtf8=Y,s.xorObfuscate=te,s.xorDeobfuscate=ne})()})();
|