@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 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 O(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(!O(r))return}e.apply(console,t)}}function ce(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 W(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function 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 L(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const l=s[a];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<s.length;a++){const l=s[a];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let c=0;c<l.options.length;c++)l.options[c].selected&&o[l.name].push(l.options[c].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const c=Number(l.value);o[l.name]=l.value===""||isNaN(c)?null:c}else o[l.name]=l.value}return o}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const l=t[a];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const c=String(l).split(",").map(function(h){return h.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=he(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let c=0;c<i.options.length;c++)i.options[c].selected=l.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const U={};function pe(e,t){U[e]=t}function be(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function ge(e){const t=e?e.closest("[lang]"):null,n=(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 n?n.trim():"en-US"}function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){ce(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function ye(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function Ce(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=ye,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=me);const D={};function Ae(e,t){D[e]||(D[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=D[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],l=a.getAttribute("data-ln-field");t[l]!=null&&(a.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<l.length;c++){const h=l[c].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),C=h[1].trim();t[C]!=null&&a.setAttribute(f,t[C])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-show");l in t&&a.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],l=a.getAttribute("data-ln-class").split(",");for(let c=0;c<l.length;c++){const h=l[c].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),C=h[1].trim();C in t&&a.classList.toggle(f,!!t[C])}}return e}function _e(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function P(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let l=0;l<a.length;l++){const c=a[l];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ve(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const c=e.children[l],h=c.getAttribute("data-ln-render-key");h&&(i[h]=c)}const a=document.createDocumentFragment();for(let l=0;l<t.length;l++){const c=t[l],h=String(r(c));let f=i[h];if(f)o(f,c,l);else{const C=Ae(n,s);if(!C||(P(C,c),f=C.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),o(f,c,l)}a.appendChild(f)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=z,window.lnCore.lnFill=_e,window.lnCore.renderList=ve);function I(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function J(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const N=new Map;function X(e,t){const n=(e?e.join("|"):"")+"::"+t;if(N.has(n))return N.get(n);const r=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return N.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ee(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(a(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(a(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return a(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function te(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function ne(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=X(r.values,r.fallback);break;case"integer":o=J;break;case"float":o=Y;break;case"boolean":o=Q;break;case"list":o=G;break;case"json":o=Z;break;case"string":default:o=I;break}o||(o=I),t[r.prop]=[o,n,r.fallback]}return t}function Se(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(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=te,window.lnCore.attrSpec=ne,window.lnCore.attrStr=I,window.lnCore.attrInt=J,window.lnCore.attrBool=Q,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);function F(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(l){console.error("["+n+"] init failed",a,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function q(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function re(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ee(e){const t=re(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Ie(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=re(),o=r.byAttr.get(n);if(V()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)ee(s[a].spec,i,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&oe(s,t,n,e.oldValue),r.reactiveWildcard.length&&oe(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(F(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ie(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Oe(e){const t=ie();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];F(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let l=0;l<a.length;l++){const c=a[l];if(!document.contains(c)){const h=c[s.attribute];if(h&&typeof h.destroy=="function")try{h.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",c,f)}delete c[s.attribute]}}}}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Oe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,l=o.onInit||null,c=o.onAttrChange||null,h=o.effects||null,f=o.attributes||null,C=f?Se(f):h,d=f?new Set(Object.keys(f)):null,m=o.persist||null;function u(v){const p=v||document.body;if(F(p,e,t,n),f&&V())for(const A in f){const j=f[A],S=Array.from(p.querySelectorAll("["+A+"]"));p.matches&&p.matches("["+A+"]")&&S.push(p);for(let x=0;x<S.length;x++){const k=S[x];O(k)&&ee(j,k.getAttribute(A),A,r,k)}}l&&l(p)}const g=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)g.push(p[1])}else g.push(e);Ee({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:g.concat(s),onAttributeChange:i,onAttrChange:c,effects:C,declared:d,persist:m}),Te();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";ie().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:a,query:b}),Le(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le);function y(){ke()>0?q(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),u}function De(e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];if(!(r===""||r==null)&&(t=!0,!Number.isFinite(Number(r))))return"string"}return t?"number":"string"}function Ne(e,t,n,r){if(n==="number"){const i=parseFloat(e),a=parseFloat(t);return(isNaN(i)?0:i)-(isNaN(a)?0:a)}const o=e!=null?String(e):"",s=t!=null?String(t):"";return r?r.compare(o,s):o<s?-1:o>s?1:0}function se(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),l=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(l)try{n[l]=decodeURIComponent(c)}catch{n[l]=c}}return n}function R(e){if(!e)return null;const t=$();return e in t?t[e]:null}function ae(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function T(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 ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function B(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=R,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=T,window.lnCore.hashSortEncode=ue,window.lnCore.hashSortDecode=B,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=$e);function Re(){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=Re);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function Be(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function Me(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function je(e,t,n,r){const o=_(e);if(o==="none")return()=>0;const s=o==="desc"?-1:1,i=typeof r=="function"?r:a=>a;return function(a,l){const c=i(a),h=i(l);return Ne(c,h,t,n)*s}}function M(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function He(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const n=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(n&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(n));if(e.tagName==="TABLE"){const r=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(r)return Array.from(r.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",n="data-ln-sort-field",r="data-ln-sort-state",o="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function i(d,m){return d.getAttribute(m)||null}const a={"data-ln-sort":{prop:"targetId",type:"string",read:I,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:i,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:i,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},l=ne(a),c=new WeakMap;function h(d,m,u){if(m){const g=d.querySelector('[data-ln-field="'+m+'"]');return g?L(g):""}return u!=null&&d.cells&&d.cells[u]?L(d.cells[u]):L(d)}function f(d){this.dom=d,te(this,d,l);const m=d.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(d.getAttribute(r)),d.hasAttribute(r)||d.setAttribute(r,this._state),this._destroyed=!1,this.nsKey=T(d,"sort"),this.hashEnabled=!!this.nsKey;const u=this;this._onClick=function(w){const b=w.target.closest("["+o+"]");if(!b)return;const y=_(b.getAttribute(o));u._apply(y)},d.addEventListener("click",this._onClick),this._onSortChange=function(w){if(u._destroyed||!w.detail)return;const b=u._resolveTarget();if(!(b&&(w.target===b||b.contains(w.target))||w.detail.targetId&&w.detail.targetId===u.targetId))return;if(Me({field:u.field,column:u.column},{field:w.detail.field,column:w.detail.column})){const p=_(w.detail.direction);p&&d.getAttribute(r)!==p&&(u._state=p,d.setAttribute(r,p),u._updateAriaSort(p));return}d.getAttribute(r)!=="none"&&(u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const w=R(u.nsKey),b=B(w);if(b)u.field!==null&&b.fieldOrColumn===u.field||u.column!==null&&String(u.column)===b.fieldOrColumn?u._state!==b.direction&&u._apply(b.direction,!0):u._state!=="none"&&(u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none"));else if(u._state!=="none"){u._state="none",d.setAttribute(r,"none"),u._updateAriaSort("none");const y=u._resolveTarget();y&&(W(y,"ln-sort:change",{field:u.field,column:u.column,direction:"none",targetId:u.targetId}).defaultPrevented||u._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const w=R(this.nsKey),b=B(w);b&&((u.field!==null&&b.fieldOrColumn===u.field||u.column!==null&&String(u.column)===b.fieldOrColumn)&&q(function(){u._destroyed||u._apply(b.direction,!0)}),g=!0)}if(!g){const w=_(d.getAttribute(r));w&&w!=="none"&&q(function(){u._destroyed||u._apply(w,!0)})}return this}f.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},f.prototype._updateAriaSort=function(d){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",Be(d))},f.prototype._apply=function(d,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const u=_(d);this._state=u,this.dom.getAttribute(r)!==u&&this.dom.setAttribute(r,u),this._updateAriaSort(u);const g=this._resolveTarget();if(!g)return;const w={field:this.field,column:this.column,direction:u,targetId:this.targetId};if(!m&&this.hashEnabled){const y=ue(this.field!==null?this.field:this.column,u);ae(this.nsKey,y)}W(g,"ln-sort:change",w).defaultPrevented||this._defaultSort(g,u)},f.prototype._defaultSort=function(d,m){const u=He(d,this.itemsSelector);if(!u.length)return;const g=u[0].parentNode,w=u.filter(function(p){return!M(p)});if(!w.length)return;c.has(d)||c.set(d,w.slice());let b;if(m==="none"){const p=c.get(d)||w;c.delete(d),b=p.filter(function(A){return A.parentNode===g&&!M(A)})}else{const p=this.field,A=this.column,j=w.map(function(H){return h(H,p,A)}),S=De(j),x=typeof Intl<"u"?new Intl.Collator(ge(this.dom),{sensitivity:"base",numeric:!0}):null,k=je(m,S,x,function(H){return h(H,p,A)});b=w.slice().sort(k)}const y=document.createDocumentFragment();let v=0;for(let p=0;p<u.length;p++){const A=u[p];M(A)?y.appendChild(A):v<b.length&&y.appendChild(b[v++])}g.appendChild(y)},f.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(d,m){const u=d[t];if(!(!u||u._destroyed))if(m===n){const g=d.closest("th");u.column=!u.field&&g?g.cellIndex:null}else if(m===r){const g=_(d.getAttribute(r));g!==u._state&&u._apply(g)}else m===s&&(u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=T(d,"sort"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange))}le(e,t,f,"ln-sort",{attributes:a,persist:{attr:r,hashActive:function(d){return!!T(d,"sort")}}})})()})();
|
|
1
|
+
(function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function O(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(!O(n))return}e.apply(console,t)}}function he(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 K(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(l),l}function I(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){I(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function D(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let 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 be(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ge(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(o).split(",").map(function(b){return b.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=be(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<i.options.length;u++)i.options[u].selected=o.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const z={};function me(e,t){z[e]=t}function ye(e){return z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ye);function Ce(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 Ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,I(function(){new MutationObserver(function(){he(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function ve(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=_e,window.lnCore.getLocaleFallback=ve,window.lnCore.ensureLocaleObserver=Ae);const q={};function Se(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const b=o[u].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),C=b[1].trim();t[C]!=null&&c.setAttribute(h,t[C])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const b=o[u].trim().split(":");if(b.length!==2)continue;const h=b[0].trim(),C=b[1].trim();C in t&&c.classList.toggle(h,!!t[C])}}return e}function xe(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)Q(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(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ke(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const u=e.children[o],b=u.getAttribute("data-ln-render-key");b&&(i[b]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],b=String(n(u));let h=i[b];if(h)l(h,u,o);else{const C=Se(r,s);if(!C||(J(C,u),h=C.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",b),l(h,u,o)}c.appendChild(h)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=Q,window.lnCore.lnFill=xe,window.lnCore.renderList=ke);function T(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function G(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function X(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 Y(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const F=new Map;function Z(e,t){const r=(e?e.join("|"):"")+"::"+t;if(F.has(r))return F.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return F.set(r,l),l}function ee(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function te(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function ne(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function oe(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=Z(n.values,n.fallback);break;case"integer":l=G;break;case"float":l=ee;break;case"boolean":l=X;break;case"list":l=Y;break;case"json":l=te;break;case"string":default:l=T;break}l||(l=T),t[n.prop]=[l,r,n.fallback]}return t}function Ee(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 Ie(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=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=T,window.lnCore.attrInt=G,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function S(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 ie(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&S(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)S(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function N(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function le(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Le(e){const t=le(),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=Ie(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 se(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=le(),l=n.byAttr.get(t),s=U()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&O(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let u=0;u<c.length;u++)ne(c[u].spec,o,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&se(c,i,t,e.oldValue),n.reactiveWildcard.length&&se(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(ie(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(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 qe(e){const 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 i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&S(n,i);else if(n.matches&&n.matches(i.query)&&S(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)S(c[o],i)}}i.onInit&&i.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 i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&R(n,i);else if(n.matches&&n.matches(c)&&R(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let u=0;u<o.length;u++)R(o[u],i)}}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,I(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{qe(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){$().push(e),ce()}function ae(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,b=l.effects||null,h=l.attributes||null,C=h?Ee(h):b,d=h?new Set(Object.keys(h)):null,m=l.persist||null;function a(v){const w=v||document.body;if(ie(w,e,t,r),h&&U())for(const A in h){const V=h[A],x=Array.from(w.querySelectorAll("["+A+"]"));w.matches&&w.matches("["+A+"]")&&x.push(w);for(let k=0;k<x.length;k++){const E=x[k];O(E)&&ne(V,E.getAttribute(A),A,n,E)}}o&&o(w)}const g=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let w;for(;(w=v.exec(e))!==null;)g.push(w[1])}else g.push(e);Le({selector:e,attribute:t,componentTag:n,attributes:h,ComponentFn:r,onInit:o,observed:g.concat(s),onAttributeChange:i,onAttrChange:u,effects:C,declared:d,persist:m}),De();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,p=l.subtreeQuery||(f?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:p}),ce(),window[t]=a,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ae,window.lnCore.observeLifecycle=Fe);function y(){Te()>0?N(function(){a(document.body)}):a(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",y):y(),a}function Ne(e){let t=!1;for(let r=0;r<e.length;r++){const n=e[r];if(!(n===""||n==null)&&(t=!0,!Number.isFinite(Number(n))))return"string"}return t?"number":"string"}function $e(e,t,r,n){if(r==="number"){const i=parseFloat(e),c=parseFloat(t);return(isNaN(i)?0:i)-(isNaN(c)?0:c)}const l=e!=null?String(e):"",s=t!=null?String(t):"";return n?n.compare(l,s):l<s?-1:l>s?1:0}function ue(e){return(e||"").replace(/^#/,"")}function B(e){const t=e===void 0?location.hash:e,r={},n=ue(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function M(e){if(!e)return null;const t=B();return e in t?t[e]:null}function de(e,t){if(!e)return;const r=B();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ue(location.hash)!==l&&(location.hash=l)}function Re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function L(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 fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function j(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 Be(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Me(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=B,window.lnCore.hashGet=M,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=Re,window.lnCore.resolveHashNamespace=L,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=j,window.lnCore.hashFilterEncode=Be,window.lnCore.hashFilterDecode=Me);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je);function _(e){const t=String(e||"").trim().toLowerCase();return t==="asc"||t==="ascending"?"asc":t==="desc"||t==="descending"?"desc":"none"}function He(e){const t=_(e);return t==="asc"?"ascending":t==="desc"?"descending":"none"}function Ve(e,t){return!e||!t?!1:e.field!==null&&e.field!==void 0&&t.field!==null&&t.field!==void 0?e.field===t.field:e.column!==null&&e.column!==void 0&&t.column!==null&&t.column!==void 0?String(e.column)===String(t.column):!1}function We(e,t,r,n){const l=_(e);if(l==="none")return()=>0;const s=l==="desc"?-1:1,i=typeof n=="function"?n:c=>c;return function(c,o){const u=i(c),b=i(o);return $e(u,b,t,r)*s}}function H(e){return!!(!e||typeof e!="object"||e.nodeType!==1||e.tagName==="TEMPLATE"||typeof e.hasAttribute=="function"&&(e.hasAttribute("data-ln-sort-exclude")||e.hasAttribute("hidden"))||e.classList&&e.classList.contains("hidden")||e.style&&e.style.display==="none"||typeof e.matches=="function"&&e.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]"))}function Ue(e,t){if(!e||typeof e!="object"||e.nodeType!==1)return[];const r=t||(typeof e.getAttribute=="function"?e.getAttribute("data-ln-sort-items"):null)||null;if(r&&typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll(r));if(e.tagName==="TABLE"){const n=e.tBodies&&e.tBodies.length?e.tBodies[0]:typeof e.querySelector=="function"?e.querySelector("tbody"):null;if(n)return Array.from(n.children||[]);if(typeof e.querySelectorAll=="function")return Array.from(e.querySelectorAll("tbody tr, tr"))}return Array.from(e.children||[])}(function(){const e="data-ln-sort",t="lnSort",r="data-ln-sort-field",n="data-ln-sort-state",l="data-ln-sort-dir",s="data-ln-hash";if(window[t]!==void 0)return;function i(d,m){return d.getAttribute(m)||null}const c={"data-ln-sort":{prop:"targetId",type:"string",read:T,fallback:null,description:"Target table or list element ID to sort"},"data-ln-sort-field":{prop:"field",type:"string",read:i,effect:C,description:"Field name or column key to sort by"},"data-ln-sort-dir":{type:"enum",values:["asc","desc"],fallback:"asc",description:"Default or requested sort direction"},"data-ln-sort-items":{prop:"itemsSelector",type:"string",read:i,description:"CSS selector matching sortable child items"},"data-ln-sort-state":{type:"enum",values:["asc","desc","none"],fallback:"none",effect:C,description:"Active sort state applied to column or control"},"data-ln-hash":{type:"string",effect:C,description:"URL hash routing key for sort state persistence"}},o=oe(c),u=new WeakMap;function b(d,m,a){if(m){const g=d.querySelector('[data-ln-field="'+m+'"]');return g?D(g):""}return a!=null&&d.cells&&d.cells[a]?D(d.cells[a]):D(d)}function h(d){this.dom=d,re(this,d,o);const m=d.closest("th");this.column=!this.field&&m?m.cellIndex:null,this._state=_(d.getAttribute(n)),d.hasAttribute(n)||d.setAttribute(n,this._state),this._destroyed=!1,this.nsKey=L(d,"sort"),this.hashEnabled=!!this.nsKey;const a=this;this._onClick=function(f){const p=f.target.closest("["+l+"]");if(!p)return;const y=_(p.getAttribute(l));a._apply(y)},d.addEventListener("click",this._onClick),this._onSortChange=function(f){if(a._destroyed||!f.detail)return;const p=a._resolveTarget();if(!(p&&(f.target===p||p.contains(f.target))||f.detail.targetId&&f.detail.targetId===a.targetId))return;if(Ve({field:a.field,column:a.column},{field:f.detail.field,column:f.detail.column})){const w=_(f.detail.direction);w&&d.getAttribute(n)!==w&&(a._state=w,d.setAttribute(n,w),a._updateAriaSort(w));return}d.getAttribute(n)!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"))},document.addEventListener("ln-sort:change",this._onSortChange),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const f=M(a.nsKey),p=j(f);if(p)a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn?a._state!==p.direction&&a._apply(p.direction,!0):a._state!=="none"&&(a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none"));else if(a._state!=="none"){a._state="none",d.setAttribute(n,"none"),a._updateAriaSort("none");const y=a._resolveTarget();y&&(K(y,"ln-sort:change",{field:a.field,column:a.column,direction:"none",targetId:a.targetId}).defaultPrevented||a._defaultSort(y,"none"))}},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let g=!1;if(this.hashEnabled){const f=M(this.nsKey),p=j(f);p&&((a.field!==null&&p.fieldOrColumn===a.field||a.column!==null&&String(a.column)===p.fieldOrColumn)&&N(function(){a._destroyed||a._apply(p.direction,!0)}),g=!0)}if(!g){const f=_(d.getAttribute(n));f&&f!=="none"&&N(function(){a._destroyed||a._apply(f,!0)})}return this}h.prototype._resolveTarget=function(){return document.getElementById(this.targetId)},h.prototype._updateAriaSort=function(d){const m=this.dom.closest("th");m&&m.setAttribute("aria-sort",He(d))},h.prototype._apply=function(d,m){if(this._destroyed)return;if(!this.field&&this.column===null){const y=this.dom.closest("th");y&&y.cellIndex!==void 0&&(this.column=y.cellIndex)}const a=_(d);this._state=a,this.dom.getAttribute(n)!==a&&this.dom.setAttribute(n,a),this._updateAriaSort(a);const g=this._resolveTarget();if(!g)return;const f={field:this.field,column:this.column,direction:a,targetId:this.targetId};if(!m&&this.hashEnabled){const y=fe(this.field!==null?this.field:this.column,a);de(this.nsKey,y)}K(g,"ln-sort:change",f).defaultPrevented||this._defaultSort(g,a)},h.prototype._defaultSort=function(d,m){const a=Ue(d,this.itemsSelector);if(!a.length)return;const g=a[0].parentNode,f=a.filter(function(w){return!H(w)});if(!f.length)return;u.has(d)||u.set(d,f.slice());let p;if(m==="none"){const w=u.get(d)||f;u.delete(d),p=w.filter(function(A){return A.parentNode===g&&!H(A)})}else{const w=this.field,A=this.column,V=f.map(function(W){return b(W,w,A)}),x=Ne(V),k=typeof Intl<"u"?new Intl.Collator(Ce(this.dom),{sensitivity:"base",numeric:!0}):null,E=We(m,x,k,function(W){return b(W,w,A)});p=f.slice().sort(E)}const y=document.createDocumentFragment();let v=0;for(let w=0;w<a.length;w++){const A=a[w];H(A)?y.appendChild(A):v<p.length&&y.appendChild(p[v++])}g.appendChild(y)},h.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.dom.removeEventListener("click",this._onClick),document.removeEventListener("ln-sort:change",this._onSortChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t])};function C(d,m){const a=d[t];if(!(!a||a._destroyed))if(m===r){const g=d.closest("th");a.column=!a.field&&g?g.cellIndex:null}else if(m===n){const g=_(d.getAttribute(n));g!==a._state&&a._apply(g)}else m===s&&(a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=L(d,"sort"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange))}ae(e,t,h,"ln-sort",{attributes:c,persist:{attr:n,hashActive:function(d){return!!L(d,"sort")}}})})()})();
|
|
@@ -1 +1 @@
|
|
|
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 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 m(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 Y(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function G(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,o={};if(n)for(let s=0;s<a.length;s++){const r=a[s];r.name&&r.type==="checkbox"&&!r.disabled&&(o[r.name]=(o[r.name]||0)+1)}for(let s=0;s<a.length;s++){const r=a[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&o[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&l[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);l[r.name]=r.value===""||isNaN(d)?null:d}else l[r.name]=r.value}return l}function X(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(e,t){const n=e.elements,i=[],l={};for(let a=0;a<n.length;a++){const o=n[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<n.length;a++){const o=n[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const r=t[s];if(o.type==="checkbox"){if(Array.isArray(r))o.checked=r.indexOf(o.value)!==-1;else if(l[o.name]>1){const d=String(r).split(",").map(function(c){return c.trim()});o.checked=d.indexOf(o.value)!==-1}else o.checked=X(r);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(r),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<o.options.length;d++)o.options[d].selected=r.indexOf(o.options[d].value)!==-1;i.push(o)}else o.value=r,o.tagName==="SELECT"&&r!=null&&o.setAttribute("data-ln-value",r),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=G,window.lnCore.resolveFormMethod=z);const T={};function ee(e,t){T[e]=t}function te(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function re(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const v={};function ie(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const s=n[o],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],r=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const c=r[d].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],r=s.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const c=r[d].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function M(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let r=0;r<s.length;r++){const d=s[r];d.value.indexOf("{{")!==-1&&o.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function se(e,t,n,i,l,a){const o={};for(let r=0;r<e.children.length;r++){const d=e.children[r],c=d.getAttribute("data-ln-render-key");c&&(o[c]=d)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],c=String(i(d));let u=o[c];if(u)l(u,d,r);else{const f=ie(n,a);if(!f||(M(f,d),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),l(u,d,r)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=F,window.lnCore.lnFill=le,window.lnCore.renderList=se);function A(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function B(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function N(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 R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const x=new Map;function q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(x.has(n))return x.get(n);const i=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&i.has(s)?s:t};return x.set(n,l),l}function j(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function W(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function P(e,t,n,i,l){if(!e||t===null)return!0;const a=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=r=>{l?console.warn(r,l):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const i in n){const[l,a,o]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function de(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=q(i.values,i.fallback);break;case"integer":l=B;break;case"float":l=j;break;case"boolean":l=N;break;case"list":l=R;break;case"json":l=W;break;case"string":default:l=A;break}l||(l=A),t[i.prop]=[l,n,i.fallback]}return t}function ce(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function 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=ae,window.lnCore.attrSpec=de,window.lnCore.attrStr=A,window.lnCore.attrInt=B,window.lnCore.attrBool=N,window.lnCore.attrList=R,window.lnCore.attrEnum=q,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function _(e,t,n,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&o.push(e);for(const s of o)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new i(s)}catch(r){console.error("["+n+"] init failed",s,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function U(){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=U(),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(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=ue(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 V(e,t,n,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[n];o?o(t,n,i):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,i)}}function he(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=U(),l=i.byAttr.get(n);if(I()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const a=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let s=0;s<a.length;s++)P(a[s].spec,o,n,a[s].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 a=i.byReactive.get(n);a&&V(a,t,n,e.oldValue),i.reactiveWildcard.length&&V(i.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const o=l[a];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(_(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function pe(){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{he(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 H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=H();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const l=i.query,a=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;a&&i.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];_(i,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],o=a.query,s=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&s.push(i);for(let r=0;r<s.length;r++){const d=s[r];if(!document.contains(d)){const c=d[a.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(u){console.error("["+a.attribute+"] destroy failed",d,u)}delete d[a.attribute]}}}}}}function me(){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 i=t[n];if(i.type==="childList")try{ge(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function J(e,t,n,i,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,r=l.onInit||null,d=l.onAttrChange||null,c=l.effects||null,u=l.attributes||null,f=u?ce(u):c,h=u?new Set(Object.keys(u)):null,p=l.persist||null;function b(E){const w=E||document.body;if(_(w,e,t,n),u&&I())for(const g in u){const Oe=u[g],L=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&L.push(w);for(let O=0;O<L.length;O++){const D=L[O];y(D)&&P(Oe,D.getAttribute(g),g,i,D)}}r&&r(w)}const S=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)S.push(w[1])}else S.push(e);be({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:S.concat(a),onAttributeChange:o,onAttrChange:d,effects:f,declared:h,persist:p}),pe();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";H().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:s,query:Le}),me(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=J);function Q(){fe()>0?we(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Q):Q(),b}function K(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},i=K(t);if(!i)return n;const l=i.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),r=s>-1?o.slice(0,s):o,d=s>-1?o.slice(s+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function Ce(e){if(!e)return null;const t=k();return e in t?t[e]:null}function ye(e,t){if(!e)return;const n=k();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const o=n[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");K(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(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(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function Ee(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ee),(function(){const e="data-ln-sortable",t="lnSortable",n="data-ln-sortable-handle";if(window[t]!==void 0)return;const i={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function l(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(r){s.isEnabled&&s._handlePointerDown(r)},o.addEventListener("pointerdown",this._onPointerDown),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},l.prototype._handlePointerDown=function(o){let s=o.target.closest("["+n+"]"),r;if(s){for(r=s;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+n+"]"))return;for(r=o.target;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return;s=r}const c=Array.from(this.dom.children).indexOf(r);if(Y(this.dom,"ln-sortable:before-drag",{item:r,index:c}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=r,r.classList.add("ln-sortable--dragging"),r.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),m(this.dom,"ln-sortable:drag-start",{item:r,index:c});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),r=this._dragging;for(const d of s)d.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const d of s){if(d===r)continue;const c=d.getBoundingClientRect(),u=c.top+c.height/2;if(o.clientY>=c.top&&o.clientY<u){d.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=c.bottom){d.classList.add("ln-sortable--drop-after");break}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,r=Array.from(this.dom.children),d=r.indexOf(s);let c=null,u=null;for(const f of r){if(f.classList.contains("ln-sortable--drop-before")){c=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){c=f,u="after";break}}for(const f of r)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),c&&c!==s){u==="before"?this.dom.insertBefore(s,c):this.dom.insertBefore(s,c.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);m(this.dom,"ln-sortable:reordered",{item:s,oldIndex:d,newIndex:h})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const r=o.getAttribute(e)!=="disabled";r!==s.isEnabled&&(s.isEnabled=r,m(o,r?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}J(e,t,l,"ln-sortable",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!A(r))return}e.apply(console,t)}}function C(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 X(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(l),l}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,o={};if(i)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")i&&o[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 c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")l[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const i=e.elements,r=[],l={};for(let a=0;a<i.length;a++){const o=i[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<i.length;a++){const o=i[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=te(n);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;r.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const F={};function re(e,t){F[e]=t}function oe(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];$[i]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ae(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=v[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function ce(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)M(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 B(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(o,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function de(e,t,i,r,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=o[d];if(u)l(u,c,n);else{const f=ae(i,a);if(!f||(B(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function x(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function N(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function R(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const _=new Map;function W(e,t){const i=(e?e.join("|"):"")+"::"+t;if(_.has(i))return _.get(i);const r=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&r.has(s)?s:t};return _.set(i,l),l}function P(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function U(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function V(e,t,i,r,l){if(!e||t===null)return!0;const a=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,i){for(const r in i){const[l,a,o]=i[r];Object.defineProperty(e,r,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=W(r.values,r.fallback);break;case"integer":l=N;break;case"float":l=P;break;case"boolean":l=R;break;case"list":l=j;break;case"json":l=U;break;case"string":default:l=x;break}l||(l=x),t[r.prop]=[l,i,r.fallback]}return t}function we(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 be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ue,window.lnCore.attrSpec=fe,window.lnCore.attrStr=x,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);function g(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function H(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(a)&&g(e,o),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)g(s[n],o)}}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 Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=Q(),i=e.observed||[];for(let r=0;r<i.length;r++){const l=i[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[i];o?o(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=Q(),l=r.byAttr.get(t),a=T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!l&&!a)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(a&&A(o)){const s=r.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<s.length;c++)V(s[c].spec,n,t,s[c].componentTag,o)}if(window.lnCore._debugSink&&(i||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&J(s,o,t,e.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(H(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(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 k(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=k();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const l=r.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&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)r.matches&&r.matches(o.query)&&g(r,o);else if(r.matches&&r.matches(o.query)&&g(r,o),r.querySelectorAll){const s=r.querySelectorAll(o.query);for(let n=0;n<s.length;n++)g(s[n],o)}}o.onInit&&o.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a],s=o.query;if(s){if(!l)r.matches&&r.matches(s)&&S(r,o);else if(r.matches&&r.matches(s)&&S(r,o),r.querySelectorAll){const n=r.querySelectorAll(s);for(let c=0;c<n.length;c++)S(n[c],o)}}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{ye(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){k().push(e),K()}function Y(e,t,i,r,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?we(u):d,h=u?new Set(Object.keys(u)):null,p=l.persist||null;function b(O){const w=O||document.body;if(H(w,e,t,i),u&&T())for(const m in u){const Te=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let I=0;I<D.length;I++){const q=D[I];A(q)&&V(Te,q.getAttribute(m),m,r,q)}}n&&n(w)}const L=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)L.push(w[1])}else L.push(e);ge({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:i,onInit:n,observed:L.concat(a),onAttributeChange:o,onAttrChange:c,effects:f,declared:h,persist:p}),Ce();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=l.subtreeQuery||(Ie?e:"["+e+"]");k().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:qe}),K(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=Ae);function G(){he()>0?pe(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function z(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,i={},r=z(t);if(!r)return i;const l=r.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function ve(e){if(!e)return null;const t=E();return e in t?t[e]:null}function xe(e,t){if(!e)return;const i=E();t==null?delete i[e]:i[e]=String(t);const l=Object.keys(i).map(function(a){const o=i[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function De(){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=De),(function(){const e="data-ln-sortable",t="lnSortable",i="data-ln-sortable-handle";if(window[t]!==void 0)return;const r={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function l(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},o.addEventListener("pointerdown",this._onPointerDown),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},l.prototype._handlePointerDown=function(o){let s=o.target.closest("["+i+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+i+"]"))return;for(n=o.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(X(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;for(const c of s)c.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const c of s){if(c===n)continue;const d=c.getBoundingClientRect(),u=d.top+d.height/2;if(o.clientY>=d.top&&o.clientY<u){c.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=d.bottom){c.classList.add("ln-sortable--drop-after");break}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}for(const f of n)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);C(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:h})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const n=o.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,C(o,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}Y(e,t,l,"ln-sortable",{attributes:r})})()})();
|
|
@@ -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 C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!C(o))return}e.apply(console,t)}}function E(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function G(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,r={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(o&&l.matches&&l.matches(o)))if(l.type==="checkbox")n&&i[l.name]===1?r[l.name]=l.checked:(r[l.name]||(r[l.name]=[]),l.checked&&r[l.name].push(l.value));else if(l.type==="radio")l.checked&&(r[l.name]=l.value);else if(l.type==="select-multiple"){r[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&r[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")r[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);r[l.name]=l.value===""||isNaN(u)?null:u}else r[l.name]=l.value}return r}function X(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Y(e,t){const n=e.elements,o=[],r={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(r[i.name]=(r[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(r[i.name]>1){const u=String(l).split(",").map(function(a){return a.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=X(l);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<i.options.length;u++)i.options[u].selected=l.indexOf(i.options[u].value)!==-1;o.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Y,window.lnCore.serializeForm=G,window.lnCore.resolveFormMethod=z);const I={};function Z(e,t){I[e]=t}function ee(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Z,window.lnCore.getDataMapper=ee);function te(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function oe(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=ne,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=te);const m={};function re(e,t){m[e]||(m[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=m[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function ie(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 D(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let s=0;s<r.length;s++){const i=r[s],c=i.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function le(e,t,n,o,r,s){const i={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(i[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(o(u));let d=i[a];if(d)r(d,u,l);else{const f=re(n,s);if(!f||(D(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),r(d,u,l)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=D,window.lnCore.fill=$,window.lnCore.lnFill=ie,window.lnCore.renderList=le);function h(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function F(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function N(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const r=o.trim().toLowerCase();return!(r==="false"||r==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const o=new Set(e||[]),r=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return y.set(n,r),r}function M(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function B(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function j(e,t,n,o,r){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{r?console.warn(l,r):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function W(e,t,n){for(const o in n){const[r,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,s,i)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let r=o.read;if(!r&&o.type)switch(o.type){case"enum":r=q(o.values,o.fallback);break;case"integer":r=F;break;case"float":r=M;break;case"boolean":r=N;break;case"list":r=R;break;case"json":r=B;break;case"string":default:r=h;break}r||(r=h),t[o.prop]=[r,n,o.fallback]}return t}function se(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 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=W,window.lnCore.attrSpec=V,window.lnCore.attrStr=h,window.lnCore.attrInt=F,window.lnCore.attrBool=N,window.lnCore.attrList=R,window.lnCore.attrEnum=q,window.lnCore.attrFloat=M,window.lnCore.attrJson=B);function A(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ue(){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 U(){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=U(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(s=>s.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function H(e,t,n,o){for(let r=0;r<e.length;r++){const s=e[r];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=U(),r=o.byAttr.get(n);if(L()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&C(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)j(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&H(s,t,n,e.oldValue),o.reactiveWildcard.length&&H(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const i=r[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(A(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,s=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r];A(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const s=t[r],i=s.query,c=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&c.push(o);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const a=u[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",u,d)}delete u[s.attribute]}}}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(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(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function K(e,t,n,o,r={}){const s=r.extraAttributes||[],i=r.onAttributeChange||null,c=r.onSubtreeChange||null,l=r.onInit||null,u=r.onAttrChange||null,a=r.effects||null,d=r.attributes||null,f=d?se(d):a,Oe=d?new Set(Object.keys(d)):null,Le=r.persist||null;function g(_){const w=_||document.body;if(A(w,e,t,n),d&&L())for(const p in d){const Ie=d[p],k=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&k.push(w);for(let S=0;S<k.length;S++){const O=k[S];C(O)&&j(Ie,O.getAttribute(p),p,o,O)}}l&&l(w)}const v=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let w;for(;(w=_.exec(e))!==null;)v.push(w[1])}else v.push(e);de({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:l,observed:v.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:Oe,persist:Le}),we();const Ee=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";J().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:Ee}),pe(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K);function P(){ue()>0?ae(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",P):P(),g}function Q(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},o=Q(t);if(!o)return n;const r=o.split("&");for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function be(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Q(location.hash)!==r&&(location.hash=r)}function Ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function me(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 ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=be,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=Ce,window.lnCore.resolveHashNamespace=me,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=ve);function _e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=_e);function ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t).trim(),o=e.slice(t+1).trim();if(!n)return null;const r={};return r[n]=[o],r}function Se(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const n={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},o=V(n);function r(s){return this.dom=s,W(this,s,o),this._onSetCount=function(i){s.textContent=Se(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),E(s,"ln-stat:request-count",{stat:this._storeName,filters:ke(this._filterRaw)}),this}r.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},K(e,t,r,"ln-stat",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function m(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!m(n))return}e.apply(console,t)}}function I(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 g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let 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 ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ee(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<i.options.length;u++)i.options[u].selected=o.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const q={};function ne(e,t){q[e]=t}function re(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ie(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function ce(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)T(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 $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ue(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const u=e.children[o],d=u.getAttribute("data-ln-render-key");d&&(i[d]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(n(u));let a=i[d];if(a)l(a,u,o);else{const f=se(r,s);if(!f||($(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),l(a,u,o)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=ce,window.lnCore.renderList=ue);function h(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function N(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function R(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 M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function B(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return A.set(r,l),l}function j(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function W(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function V(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function H(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=B(n.values,n.fallback);break;case"integer":l=N;break;case"float":l=j;break;case"boolean":l=R;break;case"list":l=M;break;case"json":l=W;break;case"string":default:l=h;break}l||(l=h),t[n.prop]=[l,r,n.fallback]}return t}function ae(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 de(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=U,window.lnCore.attrSpec=H,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=M,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function b(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 J(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)b(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=Q(),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=de(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 K(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=Q(),l=n.byAttr.get(t),s=D()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,o,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&K(c,i,t,e.oldValue),n.reactiveWildcard.length&&K(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(J(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(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 x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(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 ge(e){const t=x();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 i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&b(n,i);else if(n.matches&&n.matches(i.query)&&b(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)b(c[o],i)}}i.onInit&&i.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 i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&v(n,i);else if(n.matches&&n.matches(c)&&v(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let u=0;u<o.length;u++)v(o[u],i)}}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ge(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){x().push(e),P()}function z(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,d=l.effects||null,a=l.attributes||null,f=a?ae(a):d,De=a?new Set(Object.keys(a)):null,Ie=l.persist||null;function C(k){const w=k||document.body;if(J(w,e,t,r),a&&D())for(const p in a){const Te=a[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let L=0;L<O.length;L++){const E=O[L];m(E)&&V(Te,E.getAttribute(p),p,n,E)}}o&&o(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);he({selector:e,attribute:t,componentTag:n,attributes:a,ComponentFn:r,onInit:o,observed:S.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:De,persist:Ie}),pe();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=l.subtreeQuery||(qe?e:"["+e+"]");x().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:Fe}),P(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ce);function X(){fe()>0?we(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),C}function G(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},n=G(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function me(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Se(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 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=_,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=ke);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe);function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),n=e.slice(t+1).trim();if(!r)return null;const l={};return l[r]=[n],l}function Ee(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},n=H(r);function l(s){return this.dom=s,U(this,s,n),this._onSetCount=function(i){s.textContent=Ee(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),I(s,"ln-stat:request-count",{stat:this._storeName,filters:Le(this._filterRaw)}),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},z(e,t,l,"ln-stat",{attributes:r})})()})();
|