@livenetworks/ashlar 2.0.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +98 -41
- 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-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-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-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-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 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 V(){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 F(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!F(i))return}e.apply(console,t)}}function v(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,n={};if(r)for(let s=0;s<a.length;s++){const o=a[s];o.name&&o.type==="checkbox"&&!o.disabled&&(n[o.name]=(n[o.name]||0)+1)}for(let s=0;s<a.length;s++){const o=a[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")r&&n[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&l[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);l[o.name]=o.value===""||isNaN(u)?null:u}else l[o.name]=o.value}return l}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const r=e.elements,i=[],l={};for(let a=0;a<r.length;a++){const n=r[a];n.name&&n.type==="checkbox"&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<r.length;a++){const n=r[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 o=t[s];if(n.type==="checkbox"){if(Array.isArray(o))n.checked=o.indexOf(n.value)!==-1;else if(l[n.name]>1){const u=String(o).split(",").map(function(c){return c.trim()});n.checked=u.indexOf(n.value)!==-1}else n.checked=ue(o);i.push(n)}else if(n.type==="radio")n.checked=n.value===String(o),i.push(n);else if(n.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<n.options.length;u++)n.options[u].selected=o.indexOf(n.options[u].value)!==-1;i.push(n)}else n.value=o,n.tagName==="SELECT"&&o!=null&&n.setAttribute("data-ln-value",o),i.push(n)}return i}function de(e,t,{get:r,set:i}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(l){i?i.call(this,l,a=>t.set.call(this,a)):t.set.call(this,l)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=se);const B={};function fe(e,t){B[e]=t}function he(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function y(e){const t=e?e.closest("[lang]"):null,r=(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 r?r.trim():"en-US"}function W(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function we(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=W);const L={};function me(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=L[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let n=0;n<r.length;n++){const s=r[n],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<i.length;n++){const s=i[n],o=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const c=o[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 l=e.querySelectorAll("[data-ln-show]");for(let n=0;n<l.length;n++){const s=l[n],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],o=s.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const c=o[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 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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function K(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const a=r.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 i=function(a,n){return t[n]!==void 0?t[n]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const n=l[a],s=n.attributes;for(let o=0;o<s.length;o++){const u=s[o];u.value.indexOf("{{")!==-1&&n.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function ge(e,t,r,i,l,a){const n={};for(let o=0;o<e.children.length;o++){const u=e.children[o],c=u.getAttribute("data-ln-render-key");c&&(n[c]=u)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],c=String(i(u));let d=n[c];if(d)l(d,u,o);else{const f=me(r,a);if(!f||(K(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),l(d,u,o)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=U,window.lnCore.lnFill=be,window.lnCore.renderList=ge);function O(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function Q(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function G(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function J(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const T=new Map;function z(e,t){const r=(e?e.join("|"):"")+"::"+t;if(T.has(r))return T.get(r);const i=new Set(e||[]),l=function(a,n){const s=a.getAttribute(n);return s!==null&&i.has(s)?s:t};return T.set(r,l),l}function X(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function Y(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Z(e,t,r,i,l){if(!e||t===null)return!0;const a=i||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=o=>{l?console.warn(o,l):console.warn(o)};if(n==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${a}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${a}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${a}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,r){for(const i in r){const[l,a,n]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,a,n)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=z(i.values,i.fallback);break;case"integer":l=Q;break;case"float":l=X;break;case"boolean":l=G;break;case"list":l=J;break;case"json":l=Y;break;case"string":default:l=O;break}l||(l=O),t[i.prop]=[l,r,i.fallback]}return t}function _e(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function ve(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=O,window.lnCore.attrInt=Q,window.lnCore.attrBool=G,window.lnCore.attrList=J,window.lnCore.attrEnum=z,window.lnCore.attrFloat=X,window.lnCore.attrJson=Y);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function ee(e,t,r,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(a)&&E(e,n),e.querySelectorAll){const s=e.querySelectorAll(a);for(let o=0;o<s.length;o++)E(s[o],n)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(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 te(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function De(e){const t=te(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ve(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function ne(e,t,r,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const n=a.effects&&a.effects[r];n?n(t,r,i):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,i)}}function Ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=te(),l=i.byAttr.get(t),a=V()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!a)return;const n=e.target;if(e.oldValue!==n.getAttribute(t)){if(a&&F(n)){const s=i.byDeclaredAttr.get(t),o=n.getAttribute(t);for(let u=0;u<s.length;u++)Z(s[u].spec,o,t,s[u].componentTag,n)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,n,{oldValue:e.oldValue,newValue:n.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&ne(s,n,t,e.oldValue),i.reactiveWildcard.length&&ne(i.reactiveWildcard,n,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(n,t,e.oldValue);continue}o.onAttributeChange&&n[o.attribute]?o.onAttributeChange(n,t):(ee(n,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(n))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ne(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function $(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=I();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const i=t[r];if(i.onSubtreeChange&&i.query){const l=i.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&i.onSubtreeChange(a,e)}}for(let r=0;r<e.addedNodes.length;r++){const i=e.addedNodes[r];if(i.nodeType===1){const l=!!(i.firstElementChild||i.children&&i.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)i.matches&&i.matches(n.query)&&E(i,n);else if(i.matches&&i.matches(n.query)&&E(i,n),i.querySelectorAll){const s=i.querySelectorAll(n.query);for(let o=0;o<s.length;o++)E(s[o],n)}}n.onInit&&n.onInit(i)}}}for(let r=0;r<e.removedNodes.length;r++){const i=e.removedNodes[r];if(i.nodeType===1){const l=!!(i.firstElementChild||i.children&&i.children.length);for(let a=0;a<t.length;a++){const n=t[a],s=n.query;if(s){if(!l)i.matches&&i.matches(s)&&$(i,n);else if(i.matches&&i.matches(s)&&$(i,n),i.querySelectorAll){const o=i.querySelectorAll(s);for(let u=0;u<o.length;u++)$(o[u],n)}}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{Se(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){I().push(e),ie()}function re(e,t,r,i,l={}){const a=l.extraAttributes||[],n=l.onAttributeChange||null,s=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,c=l.effects||null,d=l.attributes||null,f=d?_e(d):c,p=d?new Set(Object.keys(d)):null,w=l.persist||null;function m(N){const h=N||document.body;if(ee(h,e,t,r),d&&V())for(const g in d){const R=d[g],H=Array.from(h.querySelectorAll("["+g+"]"));h.matches&&h.matches("["+g+"]")&&H.push(h);for(let j=0;j<H.length;j++){const M=H[j];F(M)&&Z(R,M.getAttribute(g),g,i,M)}}o&&o(h)}const b=[];if(e.indexOf("[")!==-1){const N=/\[([\w-]+)/g;let h;for(;(h=N.exec(e))!==null;)b.push(h[1])}else b.push(e);De({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:r,onInit:o,observed:b.concat(a),onAttributeChange:n,onAttrChange:u,effects:f,declared:p,persist:w}),Ee();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=l.subtreeQuery||(A?e:"["+e+"]");I().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:s,query:D}),ie(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=ke);function x(){xe()>0?Ae(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),m}function oe(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,r={},i=oe(t);if(!i)return r;const l=i.split("&");for(let a=0;a<l.length;a++){const n=l[a];if(!n)continue;const s=n.indexOf(":"),o=s>-1?n.slice(0,s):n,u=s>-1?n.slice(s+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function Re(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const r=q();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(a){const n=r[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");oe(location.hash)!==l&&(location.hash=l)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Re,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=qe);function He(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=He);const _={};function k(e){const t=e||"default";if(!_[t]){const r=new Intl.NumberFormat(e,{useGrouping:!0}),i=r.formatToParts(1234.5);let l="",a=".";for(let n=0;n<i.length;n++)i[n].type==="group"&&(l=i[n].value),i[n].type==="decimal"&&(a=i[n].value);_[t]={groupSep:l,decimalSep:a,fmt:r}}return _[t]}function le(e,t,r){if(e==null||typeof e!="string")return"";let i=e.trim();return i===""?"":(i=i.replace(/[$€£¥]/g,""),t&&(i=i.split(t).join("")),i=i.replace(/\s/g,""),r&&r!=="."&&(i=i.replace(r,".")),i=i.replace(/[^\d.-]/g,""),i)}function je(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const r=e.trim();if(r===""||r==="-")return NaN;const i=k(t),l=le(r,i.groupSep,i.decimalSep);if(l===""||l==="-")return NaN;const a=parseFloat(l);return isNaN(a)?NaN:a}function C(e,t,r={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const i=t||"default",l=r.maxDecimals!=null?parseInt(r.maxDecimals,10):null,a=r.userDecimals!=null?r.userDecimals:null;if(l!==null){const n=i+"|max:"+l;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:l})),_[n].format(e)}if(a!==null&&a>0){const n=i+"|exact:"+a;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),_[n].format(e)}return k(t).fmt.format(e)}function Me(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let r=t,i=0;for(let l=0;l<e.length&&r>0;l++)i=l+1,/[0-9]/.test(e[l])&&r--;return r>0&&(i=e.length),i}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function r(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const i={"data-ln-number":{type:"marker",effect:r,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:r,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:r,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:r,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:r,description:"Maximum allowed numeric value"}},l=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)},W(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const o=document.createElement("input");o.type="hidden",o.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&o.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",o),this._hidden=o,Object.defineProperty(o,"value",{get:function(){return l.get.call(o)},set:function(c){if(l.set.call(o,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}))}}),de(n,l,{get:function(){return l.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 p=k(y(n)),w=l.get.call(n),m=w[d-1];if(m===p.groupSep||/\s/.test(m)){c.preventDefault();const b=d-2>=0?d-2:0,A=w.slice(0,b)+w.slice(d);l.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=je(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"),o=n.getAttribute("data-ln-number"),u=null;s!==null&&s!==""?u=s:o!==null&&o!==""&&o!=="true"?u=o: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=l.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 o=n.selectionStart;let u=0;for(let h=0;h<o;h++)/[0-9]/.test(s[h])&&u++;const c=y(n),d=k(c);let f=s,p=le(s,d.groupSep,d.decimalSep),w=parseFloat(p);if(isNaN(w)){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=p.indexOf(".");if(m!==null&&b!==-1){const h=parseInt(m,10),g=p.slice(b+1);if(h===0)p=p.slice(0,b),f=f.split(d.decimalSep)[0],w=parseFloat(p),this._setDisplayRaw(f);else if(g.length>h){p=p.slice(0,b+1+h);const R=f.split(d.decimalSep);f=R[0]+d.decimalSep+R[1].slice(0,h),w=parseFloat(p),this._setDisplayRaw(f)}}const A=n.getAttribute("data-ln-number-max");if(A!==null&&w>parseFloat(A)){const h=parseFloat(A),g=C(h,c,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(h),n.setSelectionRange(g.length,g.length),v(n,"ln-number:input",{value:h,formatted:g});return}if(f.endsWith(d.decimalSep)||d.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:f});return}const D=p.indexOf(".");if(D!==-1&&p.slice(D+1).endsWith("0")){this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:f});return}let x;if(m!==null)x=C(w,c,{maxDecimals:m});else{const h=D!==-1?p.slice(D+1).length:0;x=C(w,c,{userDecimals:h})}this._setDisplayRaw(x);const N=Me(x,u);n.setSelectionRange(N,N),this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:x})},a.prototype._setHiddenRaw=function(n){this._hidden&&l.set.call(this._hidden,String(n))},a.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):l.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=l.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 o=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(s,y(this.dom),{maxDecimals:o})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(a.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:l.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])},re(e,t,a,"ln-number",{attributes:i,extraAttributes:["lang"],onAttributeChange:r})})()})();
|
|
@@ -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 I(){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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!k(n))return}e.apply(console,t)}}function q(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ce(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ue(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[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")&&!(n&&i.matches&&i.matches(n)))if(i.type==="checkbox")r&&o[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(r&&i.type==="hidden")l[i.name]=i.value;else if(r&&(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 ae(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[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 i=t[c];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=ae(i);n.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),n.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<o.options.length;u++)o.options[u].selected=i.indexOf(o.options[u].value)!==-1;n.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),n.push(o)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=fe,window.lnCore.serializeForm=ue,window.lnCore.resolveFormMethod=ce);const $={};function de(e,t){$[e]=t}function he(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function be(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];R[r]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=be,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=we);const _={};function pe(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=_[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const n=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<n.length;o++){const c=n[o],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 a=f[0].trim(),h=f[1].trim();t[h]!=null&&c.setAttribute(a,t[h])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const c=l[o],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],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 a=f[0].trim(),h=f[1].trim();h in t&&c.classList.toggle(a,!!t[h])}}return e}function me(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],c=o.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ye(e,t,r,n,l,s){const o={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(o[f]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(n(u));let a=o[f];if(a)l(a,u,i);else{const h=pe(r,s);if(!h||(j(h,u),a=h.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",f),l(a,u,i)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=me,window.lnCore.renderList=ye);function S(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function H(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function W(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const v=new Map;function V(e,t){const r=(e?e.join("|"):"")+"::"+t;if(v.has(r))return v.get(r);const n=new Set(e||[]),l=function(s,o){const c=s.getAttribute(o);return c!==null&&n.has(c)?c:t};return v.set(r,l),l}function J(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function K(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function Q(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ce(e,t,r){for(const n in r){const[l,s,o]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function Ae(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=V(n.values,n.fallback);break;case"integer":l=H;break;case"float":l=J;break;case"boolean":l=W;break;case"list":l=U;break;case"json":l=K;break;case"string":default:l=S;break}l||(l=S),t[n.prop]=[l,r,n.fallback]}return t}function xe(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function ke(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ce,window.lnCore.attrSpec=Ae,window.lnCore.attrStr=S,window.lnCore.attrInt=H,window.lnCore.attrBool=W,window.lnCore.attrList=U,window.lnCore.attrEnum=V,window.lnCore.attrFloat=J,window.lnCore.attrJson=K);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function z(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&y(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let i=0;i<c.length;i++)y(c[i],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function _e(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 ve(e){const t=P(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];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 n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=ke(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function X(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function Te(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=P(),l=n.byAttr.get(t),s=I()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&k(o)){const c=n.byDeclaredAttr.get(t),i=o.getAttribute(t);for(let u=0;u<c.length;u++)Q(c[u].spec,i,t,c[u].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&X(c,o,t,e.oldValue),n.reactiveWildcard.length&&X(n.reactiveWildcard,o,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const i=l[c];if(i.handler){i.handler(o,t,e.oldValue);continue}i.onAttributeChange&&o[i.attribute]?i.onAttributeChange(o,t):(z(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Te(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Oe(e){const t=T();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)n.matches&&n.matches(o.query)&&y(n,o);else if(n.matches&&n.matches(o.query)&&y(n,o),n.querySelectorAll){const c=n.querySelectorAll(o.query);for(let i=0;i<c.length;i++)y(c[i],o)}}o.onInit&&o.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s],c=o.query;if(c){if(!l)n.matches&&n.matches(c)&&E(n,o);else if(n.matches&&n.matches(c)&&E(n,o),n.querySelectorAll){const i=n.querySelectorAll(c);for(let u=0;u<i.length;u++)E(i[u],o)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{Oe(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){T().push(e),G()}function Z(e,t,r,n,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,a=l.attributes||null,h=a?xe(a):f,p=a?new Set(Object.keys(a)):null,x=l.persist||null;function m(L){const g=L||document.body;if(z(g,e,t,r),a&&I())for(const C in a){const He=a[C],D=Array.from(g.querySelectorAll("["+C+"]"));g.matches&&g.matches("["+C+"]")&&D.push(g);for(let B=0;B<D.length;B++){const F=D[B];k(F)&&Q(He,F.getAttribute(C),C,n,F)}}i&&i(g)}const d=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let g;for(;(g=L.exec(e))!==null;)d.push(g[1])}else d.push(e);ve({selector:e,attribute:t,componentTag:n,attributes:a,ComponentFn:r,onInit:i,observed:d.concat(s),onAttributeChange:o,onAttrChange:u,effects:h,declared:p,persist:x}),Ee();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=l.subtreeQuery||(w?e:"["+e+"]");T().push({selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:c,query:b}),G(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Ne);function se(){_e()>0?Se(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",se):se(),m}function Y(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,r={},n=Y(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const c=o.indexOf(":"),i=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(i)try{r[i]=decodeURIComponent(u)}catch{r[i]=u}}return r}function Le(e){if(!e)return null;const t=O();return e in t?t[e]:null}function De(e,t){if(!e)return;const r=O();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Fe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(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 Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=Le,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Re);function Me(){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=Me);function ee(e,t){if(e.length!==1)return e;const r=e.charCodeAt(0);if(r>=65&&r<=90){const n=((r-65+t)%26+26)%26;return String.fromCharCode(65+n)}if(r>=97&&r<=122){const n=((r-97+t)%26+26)%26;return String.fromCharCode(97+n)}if(r>=48&&r<=57){const n=((r-48+t)%10+10)%10;return String.fromCharCode(48+n)}return e}function te(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const r=new TextEncoder().encode(t);let n="";const l=r.length;for(let s=0;s<l;s++)n+=String.fromCharCode(r[s]);return btoa(n)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function ne(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const r=atob(t),n=new Uint8Array(r.length);for(let l=0;l<r.length;l++)n[l]=r.charCodeAt(l);return new TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function re(e,t){const r=String(t||"ln-ashlar");let n;typeof TextEncoder<"u"?n=new TextEncoder().encode(r):typeof Buffer<"u"?n=Buffer.from(r,"utf-8"):n=[108,110];const l=n.length||1,s=new Uint8Array(e.length);for(let o=0;o<e.length;o++)s[o]=e[o]^n[o%l];return s}function oe(e,t="ln-ashlar"){if(e==null||e==="")return"";const r=String(e);let n;if(typeof TextEncoder<"u")n=new TextEncoder().encode(r);else if(typeof Buffer<"u")n=Buffer.from(r,"utf-8");else return"";const l=re(n,t);let s="";for(let o=0;o<l.length;o++)s+=String.fromCharCode(l[o]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(l).toString("base64"):""}function ie(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const r=String(e).trim();let n="";if(typeof atob<"u")n=atob(r);else if(typeof Buffer<"u")n=Buffer.from(r,"base64").toString("binary");else return e;const l=new Uint8Array(n.length);for(let o=0;o<n.length;o++)l[o]=n.charCodeAt(o);const s=re(l,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 le(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(),r=t==="xor"||t==="base64"?t:"rot",n=Number(e.shift)||13,l=e.key||"ln-ashlar";return{codec:r,shift:n,key:l}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function je(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const r=le(t);return r.codec==="base64"?te(e):r.codec==="xor"?oe(e,r.key):e.replace(/[a-zA-Z0-9]/g,n=>ee(n,r.shift))}function N(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const r=le(t);return r.codec==="base64"?ne(e):r.codec==="xor"?ie(e,r.key):e.replace(/[a-zA-Z0-9]/g,n=>ee(n,-r.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function r(o){const c=o[t];c&&c.deobfuscate()}const n={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:r,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:r,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:r,description:"Encryption or masking key for XOR codec"}};function l(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}l.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(w){return w.parentElement&&w.parentElement.classList&&w.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 i=this.dom.getAttribute(e),u=parseInt(i,10),f=isNaN(u)?13:u,a=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),h=this.dom.getAttribute("data-ln-obfuscator-key");let p="rot";a==="xor"||a==="base64"?p=a:h&&(p="xor");const x=h||"ln-ashlar",m={codec:p,shift:f,key:x};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 w=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});w.length>0?this.dom.rel=w.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const w=this._originalTextNodes[d];w.node&&w.raw&&w.raw.length>0&&(w.node.nodeValue=N(w.raw,m))}if(o&&this._originalHref){const d=N(this._originalHref,m);this.dom.setAttribute("href",d)}q(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:p,shift:f,key:p==="xor"?x:null})},l.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=Z(e,t,l,"ln-obfuscator",{attributes:n});s.obfuscate=je,s.deobfuscate=N,s.utf8ToBase64=te,s.base64ToUtf8=ne,s.xorObfuscate=oe,s.xorDeobfuscate=ie})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function L(){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 o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!y(o))return}e.apply(console,t)}}function D(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 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 X(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Y(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let a=0;a<s.length;a++){const i=s[a];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[i.name]||0)+1)}for(let a=0;a<s.length;a++){const i=s[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(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 c=0;c<i.options.length;c++)i.options[c].selected&&l[i.name].push(i.options[c].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const c=Number(i.value);l[i.name]=i.value===""||isNaN(c)?null:c}else l[i.name]=i.value}return l}function Z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ee(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 a=r.getAttribute("data-ln-fill-as")||r.name;if(!a||!(a in t))continue;const i=t[a];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const c=String(i).split(",").map(function(u){return u.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=Z(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 c=0;c<r.options.length;c++)r.options[c].selected=i.indexOf(r.options[c].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=ee,window.lnCore.serializeForm=Y,window.lnCore.resolveFormMethod=X);const I={};function te(e,t){I[e]=t}function ne(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=te,window.lnCore.getDataMapper=ne);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function ie(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=ie,window.lnCore.ensureLocaleObserver=oe);const A={};function le(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const a=n[r],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const a=o[r],i=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const u=i[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const a=l[r],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const a=s[r],i=a.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const u=i[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 se(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function N(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,a){return t[a]!==void 0?t[a]:""}))}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],a=r.attributes;for(let i=0;i<a.length;i++){const c=a[i];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ae(e,t,n,o,l,s){const r={};for(let i=0;i<e.children.length;i++){const c=e.children[i],u=c.getAttribute("data-ln-render-key");u&&(r[u]=c)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],u=String(o(c));let d=r[u];if(d)l(d,c,i);else{const f=le(n,s);if(!f||(N(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,i)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=se,window.lnCore.renderList=ae);function p(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function q(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function M(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const o=new Set(e||[]),l=function(s,r){const a=s.getAttribute(r);return a!==null&&o.has(a)?a:t};return v.set(n,l),l}function j(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(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 a=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"?(a(`[${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:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(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 H(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=B(o.values,o.fallback);break;case"integer":l=q;break;case"float":l=j;break;case"boolean":l=M;break;case"list":l=R;break;case"json":l=W;break;case"string":default:l=p;break}l||(l=p),t[o.prop]=[l,n,o.fallback]}return t}function ce(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 ue(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=H,window.lnCore.attrStr=p,window.lnCore.attrInt=q,window.lnCore.attrBool=M,window.lnCore.attrList=R,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function x(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 a of r)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new o(a)}catch(i){console.error("["+n+"] init failed",a,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function de(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function fe(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 we(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=ue(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function K(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 pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=J(),l=o.byAttr.get(n);if(L()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&y(t)){const s=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let a=0;a<s.length;a++)U(s[a].spec,r,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&K(s,t,n,e.oldValue),o.reactiveWildcard.length&&K(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):(x(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function be(){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{pe(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 Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=Q();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];x(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,a=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&a.push(o);for(let i=0;i<a.length;i++){const c=a[i];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 ge(){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 o=t[n];if(o.type==="childList")try{he(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,o,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,a=l.onSubtreeChange||null,i=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?ce(d):u,b=d?new Set(Object.keys(d)):null,h=l.persist||null;function m(S){const w=S||document.body;if(x(w,e,t,n),d&&L())for(const g in d){const Ee=d[g],O=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&O.push(w);for(let E=0;E<O.length;E++){const F=O[E];y(F)&&U(Ee,F.getAttribute(g),g,o,F)}}i&&i(w)}const k=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)k.push(w[1])}else k.push(e);we({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:k.concat(s),onAttributeChange:r,onAttrChange:c,effects:f,declared:b,persist:h}),be();const Oe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Q().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:a,query:Oe}),ge(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function G(){de()>0?fe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),m}function z(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},o=z(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 a=r.indexOf(":"),i=a>-1?r.slice(0,a):r,c=a>-1?r.slice(a+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function Ce(e){if(!e)return null;const t=_();return e in t?t[e]:null}function me(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");z(location.hash)!==l&&(location.hash=l)}function ye(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=Ce,window.lnCore.hashSet=me,window.lnCore.hashLinkClick=ye,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=xe,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=ke);function Se(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Se),(function(){const e="data-ln-options",t="lnOptions";if(window[t]!==void 0)return;const n={"data-ln-options":{prop:"_storeName",type:"string",read:p,fallback:"",description:"Store or coordinator addressing to populate options from"},"data-ln-options-value":{prop:"_valueField",type:"string",read:p,fallback:"id",description:"Field name used for option value attribute"},"data-ln-options-label":{prop:"_labelField",type:"string",read:p,fallback:"name",description:"Field name used for option visible label text"}},o=H(n);function l(s){this.dom=s,V(this,s,o);const r=this;return this._onSetData=function(a){a.detail&&r._rebuild(a.detail.data||[])},s.addEventListener("ln-options:set-data",this._onSetData),D(s,"ln-options:request-data",{options:this._storeName}),this}l.prototype._rebuild=function(s){const r=this.dom,a=this._valueField,i=this._labelField,c=r.getAttribute("data-ln-value")||r.value,u=r.querySelectorAll("option");for(let f=u.length-1;f>=0;f--)u[f].value!==""&&r.removeChild(u[f]);for(let f=0;f<s.length;f++){const b=s[f],h=document.createElement("option");h.value=String(b[a]),h.textContent=b[i]!=null?b[i]:"",r.appendChild(h)}const d=r.options;for(let f=0;f<d.length;f++)if(d[f].value===String(c)){r.value=String(c);break}},l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[t])},P(e,t,l,"ln-options",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!A(n))return}e.apply(console,t)}}function I(e,t,o){const n=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}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 ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const o=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,r={};if(o)for(let a=0;a<s.length;a++){const i=s[a];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[i.name]||0)+1)}for(let a=0;a<s.length;a++){const i=s[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(n&&i.matches&&i.matches(n)))if(i.type==="checkbox")o&&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 c=0;c<i.options.length;c++)i.options[c].selected&&l[i.name].push(i.options[c].value)}else if(o&&i.type==="hidden")l[i.name]=i.value;else if(o&&(i.type==="number"||i.type==="range")){const c=Number(i.value);l[i.name]=i.value===""||isNaN(c)?null:c}else l[i.name]=i.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const o=e.elements,n=[],l={};for(let s=0;s<o.length;s++){const r=o[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<o.length;s++){const r=o[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const a=r.getAttribute("data-ln-fill-as")||r.name;if(!a||!(a in t))continue;const i=t[a];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const c=String(i).split(",").map(function(f){return f.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=ne(i);n.push(r)}else if(r.type==="radio")r.checked=r.value===String(i),n.push(r);else if(r.type==="select-multiple"){if(Array.isArray(i))for(let c=0;c<r.options.length;c++)r.options[c].selected=i.indexOf(r.options[c].value)!==-1;n.push(r)}else r.value=i,r.tagName==="SELECT"&&i!=null&&r.setAttribute("data-ln-value",i),n.push(r)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const T={};function re(e,t){T[e]=t}function ie(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){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 $={};function se(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];$[o]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=se,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=le);const v={};function ce(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=v[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const a=o[r],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const n=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<n.length;r++){const a=n[r],i=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const f=i[c].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),u=f[1].trim();t[u]!=null&&a.setAttribute(d,t[u])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const a=l[r],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const a=s[r],i=a.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const f=i[c].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),u=f[1].trim();u in t&&a.classList.toggle(d,!!t[u])}}return e}function ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<o.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[n],t??null),o[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function M(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,a){return t[a]!==void 0?t[a]:""}))}const n=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],a=r.attributes;for(let i=0;i<a.length;i++){const c=a[i];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function de(e,t,o,n,l,s){const r={};for(let i=0;i<e.children.length;i++){const c=e.children[i],f=c.getAttribute("data-ln-render-key");f&&(r[f]=c)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],f=String(n(c));let d=r[f];if(d)l(d,c,i);else{const u=ce(o,s);if(!u||(M(u,c),d=u.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,c,i)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=N,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function h(e,t,o){const n=e.getAttribute(t);return n===null?o:n}function R(e,t,o){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?o:n}function B(e,t,o=!1){const n=e.getAttribute(t);if(n===null)return!!o;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const x=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(x.has(o))return x.get(o);const n=new Set(e||[]),l=function(s,r){const a=s.getAttribute(r);return a!==null&&n.has(a)?a:t};return x.set(o,l),l}function U(e,t,o){const n=parseFloat(e.getAttribute(t));return isNaN(n)?o:n}function V(e,t,o){const n=e.getAttribute(t);if(!n)return o;try{return JSON.parse(n)}catch{return o}}function H(e,t,o,n,l){if(!e||t===null)return!0;const s=n||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const a=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"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const i=e.values||[];return i.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${s}] Value ${i} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${s}] Value ${i} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${s}] Invalid JSON for attribute "${o}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,o){for(const n in o){const[l,s,r]=o[n];Object.defineProperty(e,n,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const o in e){const n=e[o];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=W(n.values,n.fallback);break;case"integer":l=R;break;case"float":l=U;break;case"boolean":l=B;break;case"list":l=j;break;case"json":l=V;break;case"string":default:l=h;break}l||(l=h),t[n.prop]=[l,o,n.fallback]}return t}function fe(e){const t={};for(const o in e){const n=e[o];n&&n.effect&&(t[o]=n.effect)}return Object.keys(t).length?t:null}function we(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=J,window.lnCore.attrStr=h,window.lnCore.attrInt=R,window.lnCore.attrBool=B,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function p(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function K(e,t,o,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:n};if(e.matches&&e.matches(s)&&p(e,r),e.querySelectorAll){const a=e.querySelectorAll(s);for(let i=0;i<a.length;i++)p(a[i],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 be(e){const t=P(),o=e.observed||[];for(let n=0;n<o.length;n++){const l=o[n];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 n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=we(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,o,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[o];r?r(t,o,n):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,n)}}function ge(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,n=P(),l=n.byAttr.get(t),s=q()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!o&&!l&&!s)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(s&&A(r)){const a=n.byDeclaredAttr.get(t),i=r.getAttribute(t);for(let c=0;c<a.length;c++)H(a[c].spec,i,t,a[c].componentTag,r)}if(window.lnCore._debugSink&&(o||l)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const a=n.byReactive.get(t);a&&z(a,r,t,e.oldValue),n.reactiveWildcard.length&&z(n.reactiveWildcard,r,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const i=l[a];if(i.handler){i.handler(r,t,e.oldValue);continue}i.onAttributeChange&&r[i.attribute]?i.onAttributeChange(r,t):(K(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ge(t[o])}catch(n){console.error("[ln-core] mutation handler failed",t[o].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function me(e){const t=_();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const r=t[s];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)n.matches&&n.matches(r.query)&&p(n,r);else if(n.matches&&n.matches(r.query)&&p(n,r),n.querySelectorAll){const a=n.querySelectorAll(r.query);for(let i=0;i<a.length;i++)p(a[i],r)}}r.onInit&&r.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const r=t[s],a=r.query;if(a){if(!l)n.matches&&n.matches(a)&&S(n,r);else if(n.matches&&n.matches(a)&&S(n,r),n.querySelectorAll){const i=n.querySelectorAll(a);for(let c=0;c<i.length;c++)S(i[c],r)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const n=t[o];if(n.type==="childList")try{me(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ye(e){_().push(e),G()}function X(e,t,o,n,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,a=l.onSubtreeChange||null,i=l.onInit||null,c=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,u=d?fe(d):f,b=d?new Set(Object.keys(d)):null,g=l.persist||null;function y(E){const w=E||document.body;if(K(w,e,t,o),d&&q())for(const C in d){const qe=d[C],L=Array.from(w.querySelectorAll("["+C+"]"));w.matches&&w.matches("["+C+"]")&&L.push(w);for(let D=0;D<L.length;D++){const F=L[D];A(F)&&H(qe,F.getAttribute(C),C,n,F)}}i&&i(w)}const O=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)O.push(w[1])}else O.push(e);be({selector:e,attribute:t,componentTag:n,attributes:d,ComponentFn:o,onInit:i,observed:O.concat(s),onAttributeChange:r,onAttrChange:c,effects:u,declared:b,persist:g}),Ce();const De=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=l.subtreeQuery||(De?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:o,onInit:i,onSubtreeChange:a,query:Fe}),G(),window[t]=y,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=ye);function Z(){he()>0?pe(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),y}function Y(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,o={},n=Y(t);if(!n)return o;const l=n.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const a=r.indexOf(":"),i=a>-1?r.slice(0,a):r,c=a>-1?r.slice(a+1):"";if(i)try{o[i]=decodeURIComponent(c)}catch{o[i]=c}}return o}function Ae(e){if(!e)return null;const t=k();return e in t?t[e]:null}function ve(e,t){if(!e)return;const o=k();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const r=o[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Se(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 Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=Ae,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ee);function Le(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Le),(function(){const e="data-ln-options",t="lnOptions";if(window[t]!==void 0)return;const o={"data-ln-options":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or coordinator addressing to populate options from"},"data-ln-options-value":{prop:"_valueField",type:"string",read:h,fallback:"id",description:"Field name used for option value attribute"},"data-ln-options-label":{prop:"_labelField",type:"string",read:h,fallback:"name",description:"Field name used for option visible label text"}},n=J(o);function l(s){this.dom=s,Q(this,s,n);const r=this;return this._onSetData=function(a){a.detail&&r._rebuild(a.detail.data||[])},s.addEventListener("ln-options:set-data",this._onSetData),I(s,"ln-options:request-data",{options:this._storeName}),this}l.prototype._rebuild=function(s){const r=this.dom,a=this._valueField,i=this._labelField,c=r.getAttribute("data-ln-value")||r.value,f=r.querySelectorAll("option");for(let u=f.length-1;u>=0;u--)f[u].value!==""&&r.removeChild(f[u]);for(let u=0;u<s.length;u++){const b=s[u],g=document.createElement("option");g.value=String(b[a]),g.textContent=b[i]!=null?b[i]:"",r.appendChild(g)}const d=r.options;for(let u=0;u<d.length;u++)if(d[u].value===String(c)){r.value=String(c);break}},l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[t])},X(e,t,l,"ln-options",{attributes:o})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){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 i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!y(i))return}e.apply(console,t)}}function T(e){window.lnCore=window.lnCore||{},window.lnCore._persistSink=e}function W(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function j(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function q(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(r[o.name]=(r[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&r[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&l[o.name].push(o.options[u].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const u=Number(o.value);l[o.name]=o.value===""||isNaN(u)?null:u}else l[o.name]=o.value}return l}function V(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function U(e,t){const n=e.elements,i=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const a=r.getAttribute("data-ln-fill-as")||r.name;if(!a||!(a in t))continue;const o=t[a];if(r.type==="checkbox"){if(Array.isArray(o))r.checked=o.indexOf(r.value)!==-1;else if(l[r.name]>1){const u=String(o).split(",").map(function(c){return c.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=V(o);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(o),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<r.options.length;u++)r.options[u].selected=o.indexOf(r.options[u].value)!==-1;i.push(r)}else r.value=o,r.tagName==="SELECT"&&o!=null&&r.setAttribute("data-ln-value",o),i.push(r)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=U,window.lnCore.serializeForm=q,window.lnCore.resolveFormMethod=j);const A={};function K(e,t){A[e]=t}function H(e){return A[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=K,window.lnCore.getDataMapper=H);function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){W(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function P(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];k[n]=t}function z(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=P,window.lnCore.getLocaleFallback=z,window.lnCore.ensureLocaleObserver=J);const h={};function G(e,t){h[e]||(h[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=h[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function x(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const a=n[r],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const a=i[r],o=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const c=o[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const a=l[r],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const a=s[r],o=a.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const c=o[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function Q(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)x(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function v(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,a){return t[a]!==void 0?t[a]:""}))}const i=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],a=r.attributes;for(let o=0;o<a.length;o++){const u=a[o];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function X(e,t,n,i,l,s){const r={};for(let o=0;o<e.children.length;o++){const u=e.children[o],c=u.getAttribute("data-ln-render-key");c&&(r[c]=u)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],c=String(i(u));let d=r[c];if(d)l(d,u,o);else{const f=G(n,s);if(!f||(v(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),l(d,u,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=v,window.lnCore.fill=x,window.lnCore.lnFill=Q,window.lnCore.renderList=X);function b(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function _(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function S(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function O(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const g=new Map;function $(e,t){const n=(e?e.join("|"):"")+"::"+t;if(g.has(n))return g.get(n);const i=new Set(e||[]),l=function(s,r){const a=s.getAttribute(r);return a!==null&&i.has(a)?a:t};return g.set(n,l),l}function F(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function I(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function Y(e,t,n,i,l){if(!e||t===null)return!0;const s=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const a=o=>{l?console.warn(o,l):console.warn(o)};if(r==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="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(r==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="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 Z(e,t,n){for(const i in n){const[l,s,r]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function ee(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=$(i.values,i.fallback);break;case"integer":l=_;break;case"float":l=F;break;case"boolean":l=S;break;case"list":l=O;break;case"json":l=I;break;case"string":default:l=b;break}l||(l=b),t[i.prop]=[l,n,i.fallback]}return t}function te(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=Z,window.lnCore.attrSpec=ee,window.lnCore.attrStr=b,window.lnCore.attrInt=_,window.lnCore.attrBool=S,window.lnCore.attrList=O,window.lnCore.attrEnum=$,window.lnCore.attrFloat=F,window.lnCore.attrJson=I);function ne(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const a of r)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new i(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 L(){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 re(e){const t=L(),n=e.observed||[];for(let i=0;i<n.length;i++){const l=n[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=te(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function D(e,t,n,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function oe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=L(),l=i.byAttr.get(n);if(R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const s=i.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let a=0;a<s.length;a++)Y(s[a].spec,r,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=i.byReactive.get(n);s&&D(s,t,n,e.oldValue),i.reactiveWildcard.length&&D(i.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(ne(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{oe(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function le(e,t){re({observed:e,handler:t}),ie()}function E(e){return(e||"").replace(/^#/,"")}function m(e){const t=e===void 0?location.hash:e,n={},i=E(t);if(!i)return n;const l=i.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const a=r.indexOf(":"),o=a>-1?r.slice(0,a):r,u=a>-1?r.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(u)}catch{n[o]=u}}return n}function se(e){if(!e)return null;const t=m();return e in t?t[e]:null}function ae(e,t){if(!e)return;const n=m();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("&");E(location.hash)!==l&&(location.hash=l)}function ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function we(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=m,window.lnCore.hashGet=se,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=ue,window.lnCore.resolveHashNamespace=ce,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=fe,window.lnCore.hashFilterEncode=we,window.lnCore.hashFilterDecode=pe);function he(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=he),(function(){if(window.lnCore&&window.lnCore._persistBound)return;window.lnCore=window.lnCore||{},window.lnCore._persistBound=!0;function e(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function t(r,a){const o=r.getAttribute("data-ln-persist"),u=o!==null&&o!==""?o:r.id;return u?r.getAttribute("data-ln-persist-scope")==="page"?"ln:"+u+":"+e()+":"+a:"ln:"+u+":"+a:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',r),null)}let n=null;function i(){if(n!==null)return n;try{if(typeof localStorage>"u")return n=!1;const r="__ln_persist_test__";return localStorage.setItem(r,r),localStorage.removeItem(r),n=!0}catch{return n=!1}}const l=new Set;function s(r,a){const o=window.lnCore&&window.lnCore._attrRegistry,u=o&&o.persist||[];let c=null;for(let w=0;w<u.length;w++)if(u[w].selector===a){c=u[w];break}if(!c)return;const d=c.persist;if(l.has(d.attr)||(l.add(d.attr),le([d.attr],function(w,B){if(!w.hasAttribute("data-ln-persist")||d.hashActive&&d.hashActive(w))return;const C=t(w,B);if(!C||!i())return;const M=w.getAttribute(B);try{M===null?localStorage.removeItem(C):localStorage.setItem(C,M)}catch{}})),d.hashActive&&d.hashActive(r))return;const f=t(r,d.attr);if(!f||!i())return;const N=localStorage.getItem(f);N!==null&&r.setAttribute(d.attr,N)}T(s)})()})();
|
|
1
|
+
(function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!y(i))return}e.apply(console,t)}}function W(e){window.lnCore=window.lnCore||{},window.lnCore._persistSink=e}function j(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function q(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function V(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,r={};if(o)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&r[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&l[n.name].push(n.options[u].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const u=Number(n.value);l[n.name]=n.value===""||isNaN(u)?null:u}else l[n.name]=n.value}return l}function U(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function K(e,t){const o=e.elements,i=[],l={};for(let a=0;a<o.length;a++){const r=o[a];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let a=0;a<o.length;a++){const r=o[a];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const s=r.getAttribute("data-ln-fill-as")||r.name;if(!s||!(s in t))continue;const n=t[s];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(l[r.name]>1){const u=String(n).split(",").map(function(c){return c.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=U(n);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<r.options.length;u++)r.options[u].selected=n.indexOf(r.options[u].value)!==-1;i.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),i.push(r)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=K,window.lnCore.serializeForm=V,window.lnCore.resolveFormMethod=q);const A={};function H(e,t){A[e]=t}function J(e){return A[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=H,window.lnCore.getDataMapper=J);function P(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){j(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function z(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];k[o]=t}function G(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=z,window.lnCore.getLocaleFallback=G,window.lnCore.ensureLocaleObserver=P);const b={};function Q(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=b[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const s=o[r],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const s=i[r],n=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const c=n[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 l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const s=l[r],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let r=0;r<a.length;r++){const s=a[r],n=s.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const c=n[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 X(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function x(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const r=l[a],s=r.attributes;for(let n=0;n<s.length;n++){const u=s[n];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Y(e,t,o,i,l,a){const r={};for(let n=0;n<e.children.length;n++){const u=e.children[n],c=u.getAttribute("data-ln-render-key");c&&(r[c]=u)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],c=String(i(u));let d=r[c];if(d)l(d,u,n);else{const f=Q(o,a);if(!f||(x(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),l(d,u,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=x,window.lnCore.fill=v,window.lnCore.lnFill=X,window.lnCore.renderList=Y);function h(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function _(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function S(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function $(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const g=new Map;function O(e,t){const o=(e?e.join("|"):"")+"::"+t;if(g.has(o))return g.get(o);const i=new Set(e||[]),l=function(a,r){const s=a.getAttribute(r);return s!==null&&i.has(s)?s:t};return g.set(o,l),l}function F(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function D(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function Z(e,t,o,i,l){if(!e||t===null)return!0;const a=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e,t,o){for(const i in o){const[l,a,r]=o[i];Object.defineProperty(e,i,{get:function(){return l(t,a,r)},enumerable:!0,configurable:!0})}return e}function te(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=O(i.values,i.fallback);break;case"integer":l=_;break;case"float":l=F;break;case"boolean":l=S;break;case"list":l=$;break;case"json":l=D;break;case"string":default:l=h;break}l||(l=h),t[i.prop]=[l,o,i.fallback]}return t}function ne(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ee,window.lnCore.attrSpec=te,window.lnCore.attrStr=h,window.lnCore.attrInt=_,window.lnCore.attrBool=S,window.lnCore.attrList=$,window.lnCore.attrEnum=O,window.lnCore.attrFloat=F,window.lnCore.attrJson=D);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function re(e,t,o,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(a)&&L(e,r),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)L(s[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function I(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function oe(e){const t=I(),o=e.observed||[];for(let i=0;i<o.length;i++){const l=o[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ne(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function E(e,t,o,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const r=a.effects&&a.effects[o];r?r(t,o,i):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,i)}}function ie(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=I(),l=i.byAttr.get(t),a=T()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!l&&!a)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(a&&y(r)){const s=i.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let u=0;u<s.length;u++)Z(s[u].spec,n,t,s[u].componentTag,r)}if(window.lnCore._debugSink&&(o||l)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const s=i.byReactive.get(t);s&&E(s,r,t,e.oldValue),i.reactiveWildcard.length&&E(i.reactiveWildcard,r,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(re(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ie(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function se(e,t){oe({observed:e,handler:t}),le()}function N(e){return(e||"").replace(/^#/,"")}function m(e){const t=e===void 0?location.hash:e,o={},i=N(t);if(!i)return o;const l=i.split("&");for(let a=0;a<l.length;a++){const r=l[a];if(!r)continue;const s=r.indexOf(":"),n=s>-1?r.slice(0,s):r,u=s>-1?r.slice(s+1):"";if(n)try{o[n]=decodeURIComponent(u)}catch{o[n]=u}}return o}function ae(e){if(!e)return null;const t=m();return e in t?t[e]:null}function ue(e,t){if(!e)return;const o=m();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(a){const r=o[a];return r===""?a:a+":"+encodeURIComponent(r)}).join("&");N(location.hash)!==l&&(location.hash=l)}function ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(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 pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function be(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=m,window.lnCore.hashGet=ae,window.lnCore.hashSet=ue,window.lnCore.hashLinkClick=ce,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=be);function he(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=he),(function(){if(window.lnCore&&window.lnCore._persistBound)return;window.lnCore=window.lnCore||{},window.lnCore._persistBound=!0;function e(){return location.pathname.replace(/\/+$/,"").toLowerCase()||"/"}function t(r,s){const n=r.getAttribute("data-ln-persist"),u=n!==null&&n!==""?n:r.id;return u?r.getAttribute("data-ln-persist-scope")==="page"?"ln:"+u+":"+e()+":"+s:"ln:"+u+":"+s:(console.warn('[ln-persist] Element requires id or data-ln-persist="key"',r),null)}let o=null;function i(){if(o!==null)return o;try{if(typeof localStorage>"u")return o=!1;const r="__ln_persist_test__";return localStorage.setItem(r,r),localStorage.removeItem(r),o=!0}catch{return o=!1}}const l=new Set;function a(r,s){const n=window.lnCore&&window.lnCore._attrRegistry,u=n&&n.persist||[];let c=null;for(let w=0;w<u.length;w++)if(u[w].selector===s){c=u[w];break}if(!c)return;const d=c.persist;if(l.has(d.attr)||(l.add(d.attr),se([d.attr],function(w,M){if(!w.hasAttribute("data-ln-persist")||d.hashActive&&d.hashActive(w))return;const C=t(w,M);if(!C||!i())return;const R=w.getAttribute(M);try{R===null?localStorage.removeItem(C):localStorage.setItem(C,R)}catch{}})),d.hashActive&&d.hashActive(r))return;const f=t(r,d.attr);if(!f||!i())return;const B=localStorage.getItem(f);B!==null&&r.setAttribute(d.attr,B)}W(a)})()})();
|