@livenetworks/ashlar 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-connector/ln-api-connector.schema.json +105 -96
- package/components/ln-api-connector/src/ln-api-connector.js +1 -0
- 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/attrs.js +13 -0
- package/components/ln-core/form.js +10 -0
- package/components/ln-core/lifecycle.js +6 -1
- package/components/ln-core/ln-core.schema.json +110 -109
- 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-coordinator/src/ln-data-coordinator.js +7 -3
- 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 +3 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-filter/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-form/ln-form.schema.json +51 -45
- package/components/ln-form/src/ln-form.js +21 -0
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +26 -0
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/ln-options.schema.json +47 -41
- package/components/ln-options/src/ln-options.js +4 -4
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/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-slug/src/ln-slug.js +25 -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 +13 -0
- package/package.json +2 -1
- package/web-types.json +22 -1
|
@@ -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 x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!x(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function U(e,t){$[e]=t}function V(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=U,window.lnCore.getDataMapper=V);function H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function K(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function P(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=K,window.lnCore.getLocaleFallback=P,window.lnCore.ensureLocaleObserver=H);const _={};function Q(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const a=n[s],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const a=r[s],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&a.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let s=0;s<l.length;s++){const a=l[s],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const i=e.querySelectorAll("[data-ln-class]");for(let s=0;s<i.length;s++){const a=i[s],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const d=o[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&a.classList.toggle(u,!!t[f])}}return e}function X(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const r=function(i,s){return t[s]!==void 0?t[s]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let i=0;i<l.length;i++){const s=l[i],a=s.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,n,r,l,i){const s={};for(let o=0;o<e.children.length;o++){const c=e.children[o],d=c.getAttribute("data-ln-render-key");d&&(s[d]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],d=String(r(c));let u=s[d];if(u)l(u,c,o);else{const f=Q(n,i);if(!f||(R(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,o)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=N,window.lnCore.lnFill=X,window.lnCore.renderList=G);function B(e,t,n,r,l){if(!e||t===null)return!0;const i=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=o=>{l?console.warn(o,l):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${i}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${i}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${i}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(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 z(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}function k(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&s.push(e);for(const a of s)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Y(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Z(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 M(){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=M(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(i=>i.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=z(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 F(e,t,n,r){for(let l=0;l<e.length;l++){const i=e[l];if(!t[i.attribute])continue;const s=i.effects&&i.effects[n];s?s(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function te(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=M(),l=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&x(t)){const i=r.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let a=0;a<i.length;a++)B(i[a].spec,s,n,i[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&F(i,t,n,e.oldValue),r.reactiveWildcard.length&&F(r.reactiveWildcard,t,n,e.oldValue)}if(l)for(let i=0;i<l.length;i++){const s=l[i];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(k(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{te(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 W(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function re(e){const t=W();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const l=r.query,i=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const i=t[l];k(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let l=0;l<t.length;l++){const i=t[l],s=i.query,a=Array.from(r.querySelectorAll(s));r.matches&&r.matches(s)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const d=c[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+i.attribute+"] destroy failed",c,u)}delete c[i.attribute]}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{re(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t,n,r,l={}){const i=l.extraAttributes||[],s=l.onAttributeChange||null,a=l.onSubtreeChange||null,o=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?J(u):d,y=u?new Set(Object.keys(u)):null,h=l.persist||null;function w(A){const p=A||document.body;if(k(p,e,t,n),u&&L())for(const v in u){const he=u[v],T=Array.from(p.querySelectorAll("["+v+"]"));p.matches&&p.matches("["+v+"]")&&T.push(p);for(let q=0;q<T.length;q++){const O=T[q];x(O)&&B(he,O.getAttribute(v),v,r,O)}}o&&o(p)}const C=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let p;for(;(p=A.exec(e))!==null;)C.push(p[1])}else C.push(e);ee({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:C.concat(i),onAttributeChange:s,onAttrChange:c,effects:f,declared:y,persist:h}),ne();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";W().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:b}),oe(),window[t]=w;function g(){Y()>0?Z(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),w}function j(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,n={},r=j(t);if(!r)return n;const l=r.split("&");for(let i=0;i<l.length;i++){const s=l[i];if(!s)continue;const a=s.indexOf(":"),o=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function le(e){if(!e)return null;const t=E();return e in t?t[e]:null}function se(e,t){if(!e)return;const n=E();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(i){const s=n[i];return s===""?i:i+":"+encodeURIComponent(s)}).join("&");j(location.hash)!==l&&(location.hash=l)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ue(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function we(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=le,window.lnCore.hashSet=se,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ce,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=ue,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=we);function be(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=be),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const n={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(a){if(a.key!=="/"||a.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const o=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!o)return;const c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o:o.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function r(a){return this.dom=a,s(this),this}function l(a,o){const c=o?'[data-ln-search-for="'+o+'"]':"[data-ln-search-for]",d=a.querySelector(c)||document.querySelector(c);return d?d.tagName==="INPUT"||d.tagName==="TEXTAREA"?d:d.querySelector("input, textarea"):null}function i(a,o){if(o){const d=a.querySelectorAll('[data-ln-filter="'+o+'"]');if(d.length>0)return d;const u=document.querySelectorAll('[data-ln-filter="'+o+'"]');if(u.length>0)return u}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function s(a){const o=a.dom;function c(d){const u=d.target;if(u&&u.hasAttribute&&(u.hasAttribute("data-ln-table")||u.tagName==="TABLE"))return u;const f=d.detail&&d.detail.targetId||u&&u.id;if(!f)return null;const y=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return o.querySelector('[data-ln-table-source="'+y+'"]')||o.querySelector('[data-ln-table="'+y+'"]')||(o.id===f?o:null)||document.getElementById(f)}a._handlers={filter:function(d){if(!d.detail)return;const u=c(d);if(!u)return;const f=d.detail.key,y=d.detail.values||[],h=u.querySelectorAll("th");for(let w=0;w<h.length;w++)if((h[w].getAttribute("data-ln-table-filter-col")||h[w].getAttribute("data-ln-filter-col")||h[w].getAttribute("data-ln-filter-key")||h[w].getAttribute("data-ln-field"))===f){const m=h[w].querySelector("[data-ln-table-col-filter], .table-filter");m&&m.classList.toggle("ln-filter-active",y.length>0);break}},clear:function(d){const u=d.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!u)return;const f=u.closest("[data-ln-table], table")||o.querySelector("[data-ln-table], table");if(!f)return;const y=f.lnTable&&f.lnTable.name||f.id,h=f.querySelectorAll("th");for(let b=0;b<h.length;b++){const g=h[b].querySelector("[data-ln-table-col-filter], .table-filter");g&&g.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,C=w?document.getElementById(w):null;if(C&&C.hasAttribute("data-ln-search"))C.setAttribute("data-ln-search","");else{const b=l(o,w);b&&b.value!==""&&(b.value="",b.dispatchEvent(new Event("input",{bubbles:!0})))}const m=i(o,w);for(let b=0;b<m.length;b++){const g=m[b].querySelector("[data-ln-filter-reset]");if(!g)continue;const A=m[b].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!g.checked||A)&&(g.checked=!0,g.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&I(f,"ln-table:request-clear-filters",{table:y})}},o.addEventListener("ln-filter:change",a._handlers.filter),o.addEventListener("click",a._handlers.clear)}r.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},ie(e,t,r,"ln-table-coordinator",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!x(o))return}e.apply(console,t)}}function $(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 S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Y(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},a=e.elements,i={};if(n)for(let s=0;s<a.length;s++){const r=a[s];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[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")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&l[r.name].push(r.options[c].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const c=Number(r.value);l[r.name]=r.value===""||isNaN(c)?null:c}else l[r.name]=r.value}return l}function Z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ee(e,t){const n=e.elements,o=[],l={};for(let a=0;a<n.length;a++){const i=n[a];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<n.length;a++){const i=n[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const r=t[s];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(r).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=Z(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<i.options.length;c++)i.options[c].selected=r.indexOf(i.options[c].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ee,window.lnCore.serializeForm=Y,window.lnCore.resolveFormMethod=G);const D={};function te(e,t){D[e]=t}function ne(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=te,window.lnCore.getDataMapper=ne);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function ie(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=oe,window.lnCore.getLocaleFallback=ie,window.lnCore.ensureLocaleObserver=re);const k={};function le(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const s=n[i],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const s=o[i],r=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const s=l[i],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const s=a[i],r=s.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(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(i,s){return t[s]!==void 0?t[s]:""}))}const o=function(a,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const i=l[a],s=i.attributes;for(let r=0;r<s.length;r++){const c=s[r];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function se(e,t,n,o,l,a){const i={};for(let r=0;r<e.children.length;r++){const c=e.children[r],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],u=String(o(c));let d=i[u];if(d)l(d,c,r);else{const f=le(n,a);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,r)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=se);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function U(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(a,i){const s=a.getAttribute(i);return s!==null&&o.has(s)?s:t};return E.set(n,l),l}function V(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function H(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function K(e,t,n,o,l){if(!e||t===null)return!0;const a=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="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(i==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="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 ce(e,t,n){for(const o in n){const[l,a,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,a,i)},enumerable:!0,configurable:!0})}return e}function ue(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=U(o.values,o.fallback);break;case"integer":l=M;break;case"float":l=V;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=H;break;case"string":default:l=_;break}l||(l=_),t[o.prop]=[l,n,o.fallback]}return t}function de(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 fe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ce,window.lnCore.attrSpec=ue,window.lnCore.attrStr=_,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function O(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&i.push(e);for(const s of i)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new o(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 we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=P(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=fe(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,n,o){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const i=a.effects&&a.effects[n];i?i(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=P(),l=o.byAttr.get(n);if(N()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&x(t)){const a=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let s=0;s<a.length;s++)K(a[s].spec,i,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=o.byReactive.get(n);a&&Q(a,t,n,e.oldValue),o.reactiveWildcard.length&&Q(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const i=l[a];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(O(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(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 l=o.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&&o.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];O(o,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],i=a.query,s=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&s.push(o);for(let r=0;r<s.length;r++){const c=s[r];if(!document.contains(c)){const u=c[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",c,d)}delete c[a.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{me(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const a=l.extraAttributes||[],i=l.onAttributeChange||null,s=l.onSubtreeChange||null,r=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?de(d):u,m=d?new Set(Object.keys(d)):null,h=l.persist||null;function w(A){const g=A||document.body;if(O(g,e,t,n),d&&N())for(const v in d){const Te=d[v],q=Array.from(g.querySelectorAll("["+v+"]"));g.matches&&g.matches("["+v+"]")&&q.push(g);for(let L=0;L<q.length;L++){const I=q[L];x(I)&&K(Te,I.getAttribute(v),v,o,I)}}r&&r(g)}const y=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let g;for(;(g=A.exec(e))!==null;)y.push(g[1])}else y.push(e);he({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:y.concat(a),onAttributeChange:i,onAttrChange:c,effects:f,declared:m,persist:h}),ge();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=l.subtreeQuery||(C?e:"["+e+"]");J().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:s,query:b}),ye(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function p(){we()>0?be(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),w}function z(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const l=o.split("&");for(let a=0;a<l.length;a++){const i=l[a];if(!i)continue;const s=i.indexOf(":"),r=s>-1?i.slice(0,s):i,c=s>-1?i.slice(s+1):"";if(r)try{n[r]=decodeURIComponent(c)}catch{n[r]=c}}return n}function Ce(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const i=n[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");z(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(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=T,window.lnCore.hashGet=Ce,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Ee);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const n={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(s){if(s.key!=="/"||s.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const r=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!r)return;const c=r.tagName==="INPUT"||r.tagName==="TEXTAREA"?r:r.querySelector('input[type="search"], input[type="text"], input');c&&(s.preventDefault(),c.focus())});function o(s){return this.dom=s,i(this),this}function l(s,r){const c=r?'[data-ln-search-for="'+r+'"]':"[data-ln-search-for]",u=s.querySelector(c)||document.querySelector(c);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function a(s,r){if(r){const u=s.querySelectorAll('[data-ln-filter="'+r+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+r+'"]');if(d.length>0)return d}const c=s.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function i(s){const r=s.dom;function c(u){const d=u.target;if(d&&d.hasAttribute&&(d.hasAttribute("data-ln-table")||d.tagName==="TABLE"))return d;const f=u.detail&&u.detail.targetId||d&&d.id;if(!f)return null;const m=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return r.querySelector('[data-ln-table-source="'+m+'"]')||r.querySelector('[data-ln-table="'+m+'"]')||(r.id===f?r:null)||document.getElementById(f)}s._handlers={filter:function(u){if(!u.detail)return;const d=c(u);if(!d)return;const f=u.detail.key,m=u.detail.values||[],h=d.querySelectorAll("th");for(let w=0;w<h.length;w++)if((h[w].getAttribute("data-ln-table-filter-col")||h[w].getAttribute("data-ln-filter-col")||h[w].getAttribute("data-ln-filter-key")||h[w].getAttribute("data-ln-field"))===f){const C=h[w].querySelector("[data-ln-table-col-filter], .table-filter");C&&C.classList.toggle("ln-filter-active",m.length>0);break}},clear:function(u){const d=u.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!d)return;const f=d.closest("[data-ln-table], table")||r.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,h=f.querySelectorAll("th");for(let b=0;b<h.length;b++){const p=h[b].querySelector("[data-ln-table-col-filter], .table-filter");p&&p.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,y=w?document.getElementById(w):null;if(y&&y.hasAttribute("data-ln-search"))y.setAttribute("data-ln-search","");else{const b=l(r,w);b&&b.value!==""&&(b.value="",b.dispatchEvent(new Event("input",{bubbles:!0})))}const C=a(r,w);for(let b=0;b<C.length;b++){const p=C[b].querySelector("[data-ln-filter-reset]");if(!p)continue;const A=C[b].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||A)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&$(f,"ln-table:request-clear-filters",{table:m})}},r.addEventListener("ln-filter:change",s._handlers.filter),r.addEventListener("click",s._handlers.clear)}o.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},X(e,t,o,"ln-table-coordinator",{attributes:n})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function K(){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 o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!A(r))return}e.apply(console,t)}}function D(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 z(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const q={};function G(e,t){q[e]=t}function X(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=G,window.lnCore.getDataMapper=X);function Y(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function Z(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function ee(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Z,window.lnCore.getLocaleFallback=ee,window.lnCore.ensureLocaleObserver=Y);const v={};function te(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 $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let a=0;a<n.length;a++){const c=n[a],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const c=r[a],i=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<i.length;d++){const u=i[d].trim().split(":");if(u.length!==2)continue;const l=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(l,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let a=0;a<o.length;a++){const c=o[a],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let a=0;a<s.length;a++){const c=s[a],i=c.getAttribute("data-ln-class").split(",");for(let d=0;d<i.length;d++){const u=i[d].trim().split(":");if(u.length!==2)continue;const l=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(l,!!t[f])}}return e}function ne(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)$(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 I(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(a,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,a){return t[a]!==void 0?t[a]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const a=o[s],c=a.attributes;for(let i=0;i<c.length;i++){const d=c[i];d.value.indexOf("{{")!==-1&&a.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function re(e,t,n,r,o,s){const a={};for(let i=0;i<e.children.length;i++){const d=e.children[i],u=d.getAttribute("data-ln-render-key");u&&(a[u]=d)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const d=t[i],u=String(r(d));let l=a[u];if(l)o(l,d,i);else{const f=te(n,s);if(!f||(I(f,d),l=f.firstElementChild,!l))continue;l.setAttribute("data-ln-render-key",u),o(l,d,i)}c.appendChild(l)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=$,window.lnCore.lnFill=ne,window.lnCore.renderList=re);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function oe(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function F(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 ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const r=new Set(e||[]),o=function(s,a){const c=s.getAttribute(a);return c!==null&&r.has(c)?c:t};return _.set(n,o),o}function ae(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function le(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function M(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const c=i=>{o?console.warn(i,o):console.warn(i)};if(a==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const r in n){const[o,s,a]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,a)},enumerable:!0,configurable:!0})}return e}function de(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=se(r.values,r.fallback);break;case"integer":o=oe;break;case"float":o=ae;break;case"boolean":o=F;break;case"list":o=ie;break;case"json":o=le;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function fe(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}function k(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&a.push(e);for(const c of a)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(i){console.error("["+n+"] init failed",c,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function j(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=j(),n=e.observed||[];for(let 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=fe(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 B(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const a=s.effects&&s.effects[n];a?a(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),o=r.byAttr.get(n);if(K()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const s=r.byDeclaredAttr.get(n),a=t.getAttribute(n);for(let c=0;c<s.length;c++)M(s[c].spec,a,n,s[c].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&&B(s,t,n,e.oldValue),r.reactiveWildcard.length&&B(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const a=o[s];if(a.handler){a.handler(t,n,e.oldValue);continue}a.onAttributeChange&&t[a.attribute]?a.onAttributeChange(t,n):(k(t,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=H();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];k(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],a=s.query,c=Array.from(r.querySelectorAll(a));r.matches&&r.matches(a)&&c.push(r);for(let i=0;i<c.length;i++){const d=c[i];if(!document.contains(d)){const u=d[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(l){console.error("["+s.attribute+"] destroy failed",d,l)}delete d[s.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{me(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e,t,n,r,o={}){const s=o.extraAttributes||[],a=o.onAttributeChange||null,c=o.onSubtreeChange||null,i=o.onInit||null,d=o.onAttrChange||null,u=o.effects||null,l=o.attributes||null,f=l?ue(l):u,h=l?new Set(Object.keys(l)):null,C=o.persist||null;function b(L){const w=L||document.body;if(k(w,e,t,n),l&&K())for(const g in l){const Ee=l[g],E=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&E.push(w);for(let T=0;T<E.length;T++){const O=E[T];A(O)&&M(Ee,O.getAttribute(g),g,r,O)}}i&&i(w)}const S=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)S.push(w[1])}else S.push(e);we({selector:e,attribute:t,componentTag:r,attributes:l,ComponentFn:n,onInit:i,observed:S.concat(s),onAttributeChange:a,onAttrChange:d,effects:f,declared:h,persist:C}),ge();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";H().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:Le}),ye(),window[t]=b;function J(){he()>0?be(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",J):J(),b}function W(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=W(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const a=o[s];if(!a)continue;const c=a.indexOf(":"),i=c>-1?a.slice(0,c):a,d=c>-1?a.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(d)}catch{n[i]=d}}return n}function p(e){if(!e)return null;const t=x();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const a=n[s];return a===""?s:s+":"+encodeURIComponent(a)}).join("&");W(location.hash)!==o&&(location.hash=o)}function P(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function 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 ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function xe(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=x,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=P,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=xe);function Se(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Se);function U(e,t,n,r){const o=(e||"").toLowerCase().trim();if(o)return o;if((t||"").toUpperCase()!=="A")return"";const s=n||"";if(!s.startsWith("#"))return"";const a=s.slice(1);if(!a)return"";const c=a.split("&"),i=(r||"").toLowerCase().trim();if(i)for(const l of c){const f=l.indexOf(":");if(f>0&&l.slice(0,f).toLowerCase().trim()===i)return l.slice(f+1).toLowerCase().trim()}const d=c[c.length-1]||"",u=d.indexOf(":");return(u>0?d.slice(u+1):d).toLowerCase().trim()}function V(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(s=>(s.tagName||"").toUpperCase()==="A"&&(s.href||"").startsWith("#")),r=n.length>0&&n.length===e.length,o=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:r&&!o?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:r&&!!o,warning:null}}function Q(e,t,n){const r=(e||"").toLowerCase().trim();return r&&Array.isArray(t)&&t.includes(r)?r:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(i){const d=i.getAttribute("data-ln-tabs-active");i[t]&&i[t]._applyActive(d)}function r(i,d){return(i.getAttribute(d)||i.id||"").toLowerCase().trim()}const o={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:F,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:r,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},s=de(o);function a(i){return this.dom=i,ce(this,i,s),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const i=this.tabs.map(l=>({tagName:l.tagName,href:l.getAttribute("href")})),d=V(i,this.nsKey);this.hashEnabled=d.hashEnabled,d.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):d.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const l of this.tabs){const f=U(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=l:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',l)}for(const l of this.panels){const f=(l.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=l)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const u=this;this._clickHandlers=[];for(const l of this.tabs){if(l[t+"Trigger"])continue;const f=function(h){const C=l.tagName==="A";if(!C&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=U(l.getAttribute("data-ln-tab"),l.tagName,l.getAttribute("href"),u.nsKey);b&&(C&&!P(h)||(u.hashEnabled?p(u.nsKey)===b?u.dom.setAttribute("data-ln-tabs-active",b):y(u.nsKey,b):u.dom.setAttribute("data-ln-tabs-active",b)))};l.addEventListener("click",f),l[t+"Trigger"]=f,u._clickHandlers.push({el:l,handler:f})}if(this._onRequestSelect=function(l){const f=l.detail&&(l.detail.key||l.detail.tab);f&&u.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!u.hashEnabled)return;const l=p(u.nsKey);u.dom.setAttribute("data-ln-tabs-active",l!==null?l:u.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const l=Q(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",l)}}a.prototype.select=function(i){const d=(i+"").toLowerCase().trim();d&&(this.hashEnabled?p(this.nsKey)===d?this.dom.setAttribute("data-ln-tabs-active",d):y(this.nsKey,d):this.dom.setAttribute("data-ln-tabs-active",d))},a.prototype._applyActive=function(i){var u;if(i=Q(i,Object.keys(this.mapPanels),this.defaultKey),i===this.activeKey)return;const d=this.activeKey;if(d!==null&&z(this.dom,"ln-tabs:before-change",{key:i,previousKey:d,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom}).defaultPrevented){d in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",d),this.hashEnabled&&p(this.nsKey)!==d&&y(this.nsKey,d));return}this.activeKey=i;for(const l in this.mapTabs){const f=this.mapTabs[l];l===i?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const l in this.mapPanels){const f=this.mapPanels[l],h=l===i;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const l=(u=this.mapPanels[i])==null?void 0:u.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');l&&setTimeout(()=>l.focus({preventScroll:!0}),0)}D(this.dom,"ln-tabs:change",{key:i,previousKey:d,tab:this.mapTabs[i],panel:this.mapPanels[i],target:this.dom})},a.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:i,handler:d}of this._clickHandlers)i.removeEventListener("click",d),delete i[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},Ce(e,t,a,"ln-tabs",{attributes:o,persist:{attr:"data-ln-tabs-active",hashActive:function(i){const d=Array.from(i.querySelectorAll("[data-ln-tab]")).map(function(l){return{tagName:l.tagName,href:l.getAttribute("href")}}),u=(i.getAttribute("data-ln-tabs-key")||i.id||"").toLowerCase().trim();return V(d,u).hashEnabled}}})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!A(o))return}e.apply(console,t)}}function q(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 re(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},a=e.elements,s={};if(n)for(let c=0;c<a.length;c++){const r=a[c];r.name&&r.type==="checkbox"&&!r.disabled&&(s[r.name]=(s[r.name]||0)+1)}for(let c=0;c<a.length;c++){const r=a[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&s[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let l=0;l<r.options.length;l++)r.options[l].selected&&i[r.name].push(r.options[l].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const l=Number(r.value);i[r.name]=r.value===""||isNaN(l)?null:l}else i[r.name]=r.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const n=e.elements,o=[],i={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let a=0;a<n.length;a++){const s=n[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const r=t[c];if(s.type==="checkbox"){if(Array.isArray(r))s.checked=r.indexOf(s.value)!==-1;else if(i[s.name]>1){const l=String(r).split(",").map(function(d){return d.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=se(r);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(r),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(r))for(let l=0;l<s.options.length;l++)s.options[l].selected=r.indexOf(s.options[l].value)!==-1;o.push(s)}else s.value=r,s.tagName==="SELECT"&&r!=null&&s.setAttribute("data-ln-value",r),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const D={};function le(e,t){D[e]=t}function ce(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function de(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ue);const v={};function he(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 $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const c=o[s],r=c.getAttribute("data-ln-attr").split(",");for(let l=0;l<r.length;l++){const d=r[l].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const c=a[s],r=c.getAttribute("data-ln-class").split(",");for(let l=0;l<r.length;l++){const d=r[l].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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 R(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(s,c){return t[c]!==void 0?t[c]:""}))}const o=function(a,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const s=i[a],c=s.attributes;for(let r=0;r<c.length;r++){const l=c[r];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function we(e,t,n,o,i,a){const s={};for(let r=0;r<e.children.length;r++){const l=e.children[r],d=l.getAttribute("data-ln-render-key");d&&(s[d]=l)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const l=t[r],d=String(o(l));let u=s[d];if(u)i(u,l,r);else{const f=he(n,a);if(!f||(R(f,l),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,l,r)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=$,window.lnCore.lnFill=be,window.lnCore.renderList=we);function k(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function x(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const o=new Set(e||[]),i=function(a,s){const c=a.getAttribute(s);return c!==null&&o.has(c)?c:t};return _.set(n,i),i}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(e,t,n,o,i){if(!e||t===null)return!0;const a=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(s==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,n){for(const o in n){const[i,a,s]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,a,s)},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 i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=B(o.values,o.fallback);break;case"integer":i=M;break;case"float":i=H;break;case"boolean":i=x;break;case"list":i=j;break;case"json":i=W;break;case"string":default:i=k;break}i||(i=k),t[o.prop]=[i,n,o.fallback]}return t}function pe(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=P,window.lnCore.attrSpec=V,window.lnCore.attrStr=k,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=j,window.lnCore.attrEnum=B,window.lnCore.attrFloat=H,window.lnCore.attrJson=W);function S(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&s.push(e);for(const c of s)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(r){console.error("["+n+"] init failed",c,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=Q(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ge(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,o){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function Ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),i=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&A(t)){const a=o.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let c=0;c<a.length;c++)U(a[c].spec,s,n,a[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=o.byReactive.get(n);a&&z(a,t,n,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const s=i[a];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(S(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ae(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 ke(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 i=o.query,a=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;a&&o.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i];S(o,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i],s=a.query,c=Array.from(o.querySelectorAll(s));o.matches&&o.matches(s)&&c.push(o);for(let r=0;r<c.length;r++){const l=c[r];if(!document.contains(l)){const d=l[a.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+a.attribute+"] destroy failed",l,u)}delete l[a.attribute]}}}}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ke(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,o,i={}){const a=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,l=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?pe(u):d,h=u?new Set(Object.keys(u)):null,C=i.persist||null;function b(T){const w=T||document.body;if(S(w,e,t,n),u&&F())for(const g in u){const Fe=u[g],O=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&O.push(w);for(let K=0;K<O.length;K++){const N=O[K];A(N)&&U(Fe,N.getAttribute(g),g,o,N)}}r&&r(w)}const E=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let w;for(;(w=T.exec(e))!==null;)E.push(w[1])}else E.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:n,onInit:r,observed:E.concat(a),onAttributeChange:s,onAttrChange:l,effects:f,declared:h,persist:C}),ve();const Ke=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=i.subtreeQuery||(Ke?e:"["+e+"]");J().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:Ne}),xe(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G);function ne(){me()>0?ye(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),b}function X(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=X(t);if(!o)return n;const i=o.split("&");for(let a=0;a<i.length;a++){const s=i[a];if(!s)continue;const c=s.indexOf(":"),r=c>-1?s.slice(0,c):s,l=c>-1?s.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(l)}catch{n[r]=l}}return n}function p(e){if(!e)return null;const t=L();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Y(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=Y,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Te);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 Z(e,t,n,o){const i=(e||"").toLowerCase().trim();if(i)return i;if((t||"").toUpperCase()!=="A")return"";const a=n||"";if(!a.startsWith("#"))return"";const s=a.slice(1);if(!s)return"";const c=s.split("&"),r=(o||"").toLowerCase().trim();if(r)for(const u of c){const f=u.indexOf(":");if(f>0&&u.slice(0,f).toLowerCase().trim()===r)return u.slice(f+1).toLowerCase().trim()}const l=c[c.length-1]||"",d=l.indexOf(":");return(d>0?l.slice(d+1):l).toLowerCase().trim()}function ee(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(a=>(a.tagName||"").toUpperCase()==="A"&&(a.href||"").startsWith("#")),o=n.length>0&&n.length===e.length,i=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:o&&!i?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:o&&!!i,warning:null}}function te(e,t,n){const o=(e||"").toLowerCase().trim();return o&&Array.isArray(t)&&t.includes(o)?o:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(r){const l=r.getAttribute("data-ln-tabs-active");r[t]&&r[t]._applyActive(l)}function o(r,l){return(r.getAttribute(l)||r.id||"").toLowerCase().trim()}const i={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:x,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:o,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},a=V(i);function s(r){return this.dom=r,P(this,r,a),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const r=this.tabs.map(u=>({tagName:u.tagName,href:u.getAttribute("href")})),l=ee(r,this.nsKey);this.hashEnabled=l.hashEnabled,l.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):l.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const u of this.tabs){const f=Z(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=u:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',u)}for(const u of this.panels){const f=(u.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=u)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const u of this.tabs){if(u[t+"Trigger"])continue;const f=function(h){const C=u.tagName==="A";if(!C&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=Z(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),d.nsKey);b&&(C&&!Y(h)||(d.hashEnabled?p(d.nsKey)===b?d.dom.setAttribute("data-ln-tabs-active",b):y(d.nsKey,b):d.dom.setAttribute("data-ln-tabs-active",b)))};u.addEventListener("click",f),u[t+"Trigger"]=f,d._clickHandlers.push({el:u,handler:f})}if(this._onRequestSelect=function(u){const f=u.detail&&(u.detail.key||u.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const u=p(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",u!==null?u:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const u=te(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",u)}}s.prototype.select=function(r){const l=(r+"").toLowerCase().trim();l&&(this.hashEnabled?p(this.nsKey)===l?this.dom.setAttribute("data-ln-tabs-active",l):y(this.nsKey,l):this.dom.setAttribute("data-ln-tabs-active",l))},s.prototype._applyActive=function(r){var d;if(r=te(r,Object.keys(this.mapPanels),this.defaultKey),r===this.activeKey)return;const l=this.activeKey;if(l!==null&&re(this.dom,"ln-tabs:before-change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom}).defaultPrevented){l in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",l),this.hashEnabled&&p(this.nsKey)!==l&&y(this.nsKey,l));return}this.activeKey=r;for(const u in this.mapTabs){const f=this.mapTabs[u];u===r?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const u in this.mapPanels){const f=this.mapPanels[u],h=u===r;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const u=(d=this.mapPanels[r])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');u&&setTimeout(()=>u.focus({preventScroll:!0}),0)}q(this.dom,"ln-tabs:change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom})},s.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:r,handler:l}of this._clickHandlers)r.removeEventListener("click",l),delete r[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},G(e,t,s,"ln-tabs",{attributes:i,persist:{attr:"data-ln-tabs-active",hashActive:function(r){const l=Array.from(r.querySelectorAll("[data-ln-tab]")).map(function(u){return{tagName:u.tagName,href:u.getAttribute("href")}}),d=(r.getAttribute("data-ln-tabs-key")||r.id||"").toLowerCase().trim();return ee(l,d).hashEnabled}}})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(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(!L(o))return}e.apply(console,t)}}function J(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 S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const B={};function G(e,t){B[e]=t}function X(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=G,window.lnCore.getDataMapper=X);function Z(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 W(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){J(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];j[n]=t}function D(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ee,window.lnCore.getLocaleFallback=D,window.lnCore.ensureLocaleObserver=W);const M={};function te(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 U(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],s=a.getAttribute("data-ln-field");t[s]!=null&&(a.textContent=t[s])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],s=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<s.length;c++){const h=s[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();t[b]!=null&&a.setAttribute(w,t[b])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],s=a.getAttribute("data-ln-show");s in t&&a.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const a=i[l],s=a.getAttribute("data-ln-class").split(",");for(let c=0;c<s.length;c++){const h=s[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();b in t&&a.classList.toggle(w,!!t[b])}}return e}function ne(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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function V(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(i,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let i=0;i<r.length;i++){const l=r[i],a=l.attributes;for(let s=0;s<a.length;s++){const c=a[s];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function oe(e,t,n,o,r,i){const l={};for(let s=0;s<e.children.length;s++){const c=e.children[s],h=c.getAttribute("data-ln-render-key");h&&(l[h]=c)}const a=document.createDocumentFragment();for(let s=0;s<t.length;s++){const c=t[s],h=String(o(c));let w=l[h];if(w)r(w,c,s);else{const b=te(n,i);if(!b||(V(b,c),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),r(w,c,s)}a.appendChild(w)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=U,window.lnCore.lnFill=ne,window.lnCore.renderList=oe);function H(e,t,n,o,r){if(!e||t===null)return!0;const i=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=s=>{r?console.warn(s,r):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(a(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(a(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(a(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(a(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return a(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(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 ie(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}function $(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new o(a)}catch(s){console.error("["+n+"] init failed",a,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 ue(e){const t=Q(),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(i=>i.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ie(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 Y(e,t,n,o){for(let r=0;r<e.length;r++){const i=e[r];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),r=o.byAttr.get(n);if(q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&L(t)){const i=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<i.length;a++)H(i[a].spec,l,n,i[a].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 i=o.byReactive.get(n);i&&Y(i,t,n,e.oldValue),o.reactiveWildcard.length&&Y(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const l=r[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):($(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ae(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function K(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function de(e){const t=K();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,i=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;i&&o.onSubtreeChange(i,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 i=t[r];$(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.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 i=t[r],l=i.query,a=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&a.push(o);for(let s=0;s<a.length;s++){const c=a[s];if(!document.contains(c)){const h=c[i.attribute];if(h&&typeof h.destroy=="function")try{h.destroy()}catch(w){console.error("["+i.attribute+"] destroy failed",c,w)}delete c[i.attribute]}}}}}}function fe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{de(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function we(e,t,n,o,r={}){const i=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,s=r.onInit||null,c=r.onAttrChange||null,h=r.effects||null,w=r.attributes||null,b=w?re(w):h,O=w?new Set(Object.keys(w)):null,T=r.persist||null;function A(v){const p=v||document.body;if($(p,e,t,n),w&&q())for(const u in w){const d=w[u],f=Array.from(p.querySelectorAll("["+u+"]"));p.matches&&p.matches("["+u+"]")&&f.push(p);for(let m=0;m<f.length;m++){const g=f[m];L(g)&&H(d,g.getAttribute(u),u,o,g)}}s&&s(p)}const x=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)x.push(p[1])}else x.push(e);ue({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:s,observed:x.concat(i),onAttributeChange:l,onAttrChange:c,effects:b,declared:O,persist:T}),ce();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";K().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:a,query:y}),fe(),window[t]=A;function _(){le()>0?se(function(){A(document.body)}):A(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),A}function P(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},o=P(t);if(!o)return n;const r=o.split("&");for(let i=0;i<r.length;i++){const l=r[i];if(!l)continue;const a=l.indexOf(":"),s=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(s)try{n[s]=decodeURIComponent(c)}catch{n[s]=c}}return n}function he(e){if(!e)return null;const t=I();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");P(location.hash)!==r&&(location.hash=r)}function be(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 pe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ce(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 ye(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(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=he,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=be,window.lnCore.resolveHashNamespace=me,window.lnCore.hashSortEncode=pe,window.lnCore.hashSortDecode=Ce,window.lnCore.hashFilterEncode=ye,window.lnCore.hashFilterDecode=ve);function Ae(){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=Ae);function _e(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,o=new Date(n);return isNaN(o.getTime())?null:o}if(typeof e=="string"){const n=e.trim();if(!n)return null;const o=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(o){const i=+o[1],l=+o[2],a=+o[3],s=new Date(i,l-1,a);return s.getFullYear()!==i||s.getMonth()!==l-1||s.getDate()!==a?null:s}const r=new Date(n);return isNaN(r.getTime())?null:r}return null}function xe(e,t=Date.now()){if(!e)return{value:0,unit:"second",isOlderThanMonth:!1};const n=typeof t=="number"?t:t.getTime(),o=e.getTime(),r=Math.floor((o-n)/1e3),i=Math.abs(r);return i<10?{value:0,unit:"second",isOlderThanMonth:!1}:i<60?{value:r,unit:"second",isOlderThanMonth:!1}:i<3600?{value:Math.round(r/60),unit:"minute",isOlderThanMonth:!1}:i<86400?{value:Math.round(r/3600),unit:"hour",isOlderThanMonth:!1}:i<604800?{value:Math.round(r/86400),unit:"day",isOlderThanMonth:!1}:i<2592e3?{value:Math.round(r/604800),unit:"week",isOlderThanMonth:!1}:{value:Math.round(r/2592e3),unit:"month",isOlderThanMonth:!0}}function k(e,t,n=new Date){switch(e){case"full":return{dateStyle:"long",timeStyle:"short"};case"date":return{dateStyle:"medium"};case"time":return{timeStyle:"short"};case"short":default:{const o={month:"short",day:"numeric"};return t&&t.getFullYear()!==n.getFullYear()&&(o.year="numeric"),o}}}(function(){const e="data-ln-time",t="lnTime";if(window[t]!==void 0)return;const n={"data-ln-time":{type:"enum",values:["relative","short","medium","long","iso"],fallback:"relative",effect:v,description:"Time format style preset or activator"},"data-ln-time-locale":{type:"string",effect:v,description:"BCP 47 language tag override for time formatting"}},o={},r={};function i(u){return u.getAttribute("data-ln-time-locale")||Z(u)}function l(u,d){const f=(u||"")+"|"+JSON.stringify(d);return o[f]||(o[f]=new Intl.DateTimeFormat(u,d)),o[f]}function a(u){const d=u||"";return r[d]||(r[d]=new Intl.RelativeTimeFormat(u,{numeric:"auto",style:"narrow"})),r[d]}const s=new Set;let c=null;function h(){c||(c=setInterval(b,6e4))}function w(){c&&(clearInterval(c),c=null)}function b(){for(const u of s){if(!document.body.contains(u.dom)){s.delete(u);continue}y(u)}s.size===0&&w()}function O(u,d){const f=D(d),m=(d||"").toLowerCase().split("-")[0],g=l(d,k("full",u)),C=g.resolvedOptions().locale.toLowerCase().split("-")[0];if(f&&C!==m&&f.monthsLong){const E=f.monthsLong[u.getMonth()],F=u.getDate(),R=u.getFullYear(),N=String(u.getHours()).padStart(2,"0"),Se=String(u.getMinutes()).padStart(2,"0");return`${F} ${E} ${R}, ${N}:${Se}`}return g.format(u)}function T(u,d){const f=k("short",u),m=D(d),g=(d||"").toLowerCase().split("-")[0],C=l(d,f),E=C.resolvedOptions().locale.toLowerCase().split("-")[0];if(m&&E!==g&&m.monthsShort){const F=m.monthsShort[u.getMonth()],R=u.getDate(),N=f.year?" "+u.getFullYear():"";return`${R} ${F}${N}`}return C.format(u)}function A(u,d){return l(d,k("date",u)).format(u)}function x(u,d){return l(d,k("time",u)).format(u)}function z(u,d){const f=xe(u);return f.isOlderThanMonth?T(u,d):a(d).format(f.value,f.unit)}function y(u){const d=u.dom.getAttribute("datetime");if(!d)return;const f=_e(d);if(!f)return;const m=u.dom.getAttribute(e)||"short",g=i(u.dom);let C;switch(m){case"relative":C=z(f,g);break;case"full":C=O(f,g);break;case"date":C=A(f,g);break;case"time":C=x(f,g);break;default:C=T(f,g);break}u.dom.textContent=C,m!=="full"&&(u.dom.title=O(f,g))}function _(u){this.dom=u;const d=this;return this._onLocaleChange=function(){y(d)},W(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),y(this),u.getAttribute(e)==="relative"&&(s.add(this),h()),this}_.prototype.render=function(){y(this)},_.prototype.destroy=function(){this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),s.delete(this),s.size===0&&w(),delete this.dom[t]};function v(u){const d=u[t];if(!d)return;u.getAttribute(e)==="relative"?(s.add(d),h()):(s.delete(d),s.size===0&&w()),y(d)}function p(u){u.nodeType===1&&u.hasAttribute&&u.hasAttribute(e)&&u[t]&&y(u[t])}we(e,t,_,"ln-time",{attributes:n,extraAttributes:["datetime","lang"],onAttributeChange:v,onInit:p})})()})();
|
|
1
|
+
(function(){"use strict";function W(){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 T(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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!T(o))return}e.apply(console,t)}}function ie(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 k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&i[r.name].push(r.options[c].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const c=Number(r.value);i[r.name]=r.value===""||isNaN(c)?null:c}else i[r.name]=r.value}return i}function ae(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const r=t[a];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(r).split(",").map(function(h){return h.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ae(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<l.options.length;c++)l.options[c].selected=r.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=le);const U={};function ce(e,t){U[e]=t}function fe(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=fe);function de(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 V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){ie(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const H={};function we(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];H[n]=t}function M(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return H[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=M,window.lnCore.ensureLocaleObserver=V);const D={};function he(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 J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],r=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const h=r[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();t[b]!=null&&a.setAttribute(w,t[b])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],r=a.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const h=r[c].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),b=h[1].trim();b in t&&a.classList.toggle(w,!!t[b])}}return e}function me(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)J(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let r=0;r<a.length;r++){const c=a[r];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const c=e.children[r],h=c.getAttribute("data-ln-render-key");h&&(l[h]=c)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],h=String(o(c));let w=l[h];if(w)i(w,c,r);else{const b=he(n,s);if(!b||(Q(b,c),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),i(w,c,r)}a.appendChild(w)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=J,window.lnCore.lnFill=me,window.lnCore.renderList=be);function F(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function z(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function K(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return I.set(n,i),i}function G(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function X(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Z(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=Y(o.values,o.fallback);break;case"integer":i=z;break;case"float":i=G;break;case"boolean":i=K;break;case"list":i=P;break;case"json":i=X;break;case"string":default:i=F;break}i||(i=F),t[o.prop]=[i,n,o.fallback]}return t}function ye(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=ge,window.lnCore.attrSpec=pe,window.lnCore.attrStr=F,window.lnCore.attrInt=z,window.lnCore.attrBool=K,window.lnCore.attrList=P,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function E(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new o(a)}catch(r){console.error("["+n+"] init failed",a,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){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 ee(){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 _e(e){const t=ee(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.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 i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=ee(),i=o.byAttr.get(n);if(W()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&T(t)){const s=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)Z(s[a].spec,l,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&te(s,t,n,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(E(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(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 ne(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=ne();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];E(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 i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&a.push(o);for(let r=0;r<a.length;r++){const c=a[r];if(!document.contains(c)){const h=c[s.attribute];if(h&&typeof h.destroy=="function")try{h.destroy()}catch(w){console.error("["+s.attribute+"] destroy failed",c,w)}delete c[s.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Se(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function oe(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,c=i.onAttrChange||null,h=i.effects||null,w=i.attributes||null,b=w?ye(w):h,O=w?new Set(Object.keys(w)):null,L=i.persist||null;function A(v){const p=v||document.body;if(E(p,e,t,n),w&&W())for(const u in w){const f=w[u],d=Array.from(p.querySelectorAll("["+u+"]"));p.matches&&p.matches("["+u+"]")&&d.push(p);for(let g=0;g<d.length;g++){const m=d[g];T(m)&&Z(f,m.getAttribute(u),u,o,m)}}r&&r(p)}const x=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let p;for(;(p=v.exec(e))!==null;)x.push(p[1])}else x.push(e);_e({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:l,onAttrChange:c,effects:b,declared:O,persist:L}),ke();const N=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=i.subtreeQuery||(N?e:"["+e+"]");ne().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:C}),Oe(),window[t]=A,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe);function _(){ve()>0?Ae(function(){A(document.body)}):A(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),A}function re(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},o=re(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),r=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(c)}catch{n[r]=c}}return n}function Le(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Te(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");re(location.hash)!==i&&(location.hash=i)}function Me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Le,window.lnCore.hashSet=Te,window.lnCore.hashLinkClick=Me,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=$e);function Ne(){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=Ne);function Re(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,o=new Date(n);return isNaN(o.getTime())?null:o}if(typeof e=="string"){const n=e.trim();if(!n)return null;const o=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(o){const s=+o[1],l=+o[2],a=+o[3],r=new Date(s,l-1,a);return r.getFullYear()!==s||r.getMonth()!==l-1||r.getDate()!==a?null:r}const i=new Date(n);return isNaN(i.getTime())?null:i}return null}function qe(e,t=Date.now()){if(!e)return{value:0,unit:"second",isOlderThanMonth:!1};const n=typeof t=="number"?t:t.getTime(),o=e.getTime(),i=Math.floor((o-n)/1e3),s=Math.abs(i);return s<10?{value:0,unit:"second",isOlderThanMonth:!1}:s<60?{value:i,unit:"second",isOlderThanMonth:!1}:s<3600?{value:Math.round(i/60),unit:"minute",isOlderThanMonth:!1}:s<86400?{value:Math.round(i/3600),unit:"hour",isOlderThanMonth:!1}:s<604800?{value:Math.round(i/86400),unit:"day",isOlderThanMonth:!1}:s<2592e3?{value:Math.round(i/604800),unit:"week",isOlderThanMonth:!1}:{value:Math.round(i/2592e3),unit:"month",isOlderThanMonth:!0}}function S(e,t,n=new Date){switch(e){case"full":return{dateStyle:"long",timeStyle:"short"};case"date":return{dateStyle:"medium"};case"time":return{timeStyle:"short"};case"short":default:{const o={month:"short",day:"numeric"};return t&&t.getFullYear()!==n.getFullYear()&&(o.year="numeric"),o}}}(function(){const e="data-ln-time",t="lnTime";if(window[t]!==void 0)return;const n={"data-ln-time":{type:"enum",values:["relative","short","medium","long","iso"],fallback:"relative",effect:v,description:"Time format style preset or activator"},"data-ln-time-locale":{type:"string",effect:v,description:"BCP 47 language tag override for time formatting"}},o={},i={};function s(u){return u.getAttribute("data-ln-time-locale")||de(u)}function l(u,f){const d=(u||"")+"|"+JSON.stringify(f);return o[d]||(o[d]=new Intl.DateTimeFormat(u,f)),o[d]}function a(u){const f=u||"";return i[f]||(i[f]=new Intl.RelativeTimeFormat(u,{numeric:"auto",style:"narrow"})),i[f]}const r=new Set;let c=null;function h(){c||(c=setInterval(b,6e4))}function w(){c&&(clearInterval(c),c=null)}function b(){for(const u of r){if(!document.body.contains(u.dom)){r.delete(u);continue}C(u)}r.size===0&&w()}function O(u,f){const d=M(f),g=(f||"").toLowerCase().split("-")[0],m=l(f,S("full",u)),y=m.resolvedOptions().locale.toLowerCase().split("-")[0];if(d&&y!==g&&d.monthsLong){const R=d.monthsLong[u.getMonth()],q=u.getDate(),B=u.getFullYear(),j=String(u.getHours()).padStart(2,"0"),Be=String(u.getMinutes()).padStart(2,"0");return`${q} ${R} ${B}, ${j}:${Be}`}return m.format(u)}function L(u,f){const d=S("short",u),g=M(f),m=(f||"").toLowerCase().split("-")[0],y=l(f,d),R=y.resolvedOptions().locale.toLowerCase().split("-")[0];if(g&&R!==m&&g.monthsShort){const q=g.monthsShort[u.getMonth()],B=u.getDate(),j=d.year?" "+u.getFullYear():"";return`${B} ${q}${j}`}return y.format(u)}function A(u,f){return l(f,S("date",u)).format(u)}function x(u,f){return l(f,S("time",u)).format(u)}function N(u,f){const d=qe(u);return d.isOlderThanMonth?L(u,f):a(f).format(d.value,d.unit)}function C(u){const f=u.dom.getAttribute("datetime");if(!f)return;const d=Re(f);if(!d)return;const g=u.dom.getAttribute(e)||"short",m=s(u.dom);let y;switch(g){case"relative":y=N(d,m);break;case"full":y=O(d,m);break;case"date":y=A(d,m);break;case"time":y=x(d,m);break;default:y=L(d,m);break}u.dom.textContent=y,g!=="full"&&(u.dom.title=O(d,m))}function _(u){this.dom=u;const f=this;return this._onLocaleChange=function(){C(f)},V(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),C(this),u.getAttribute(e)==="relative"&&(r.add(this),h()),this}_.prototype.render=function(){C(this)},_.prototype.destroy=function(){this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),r.delete(this),r.size===0&&w(),delete this.dom[t]};function v(u){const f=u[t];if(!f)return;u.getAttribute(e)==="relative"?(r.add(f),h()):(r.delete(f),r.size===0&&w()),C(f)}function p(u){u.nodeType===1&&u.hasAttribute&&u.hasAttribute(e)&&u[t]&&C(u[t])}oe(e,t,_,"ln-time",{attributes:n,extraAttributes:["datetime","lang"],onAttributeChange:v,onInit:p})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function _(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(!_(o))return}e.apply(console,t)}}function P(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 A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const N={};function Q(e,t){N[e]=t}function J(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Q,window.lnCore.getDataMapper=J);function K(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){P(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function z(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=G,window.lnCore.getLocaleFallback=z,window.lnCore.ensureLocaleObserver=K);const v={};function B(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 X(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return B(t,n)}function x(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],c=a.getAttribute("data-ln-field");t[c]!=null&&(a.textContent=t[c])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],c=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<c.length;f++){const h=c[f].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),m=h[1].trim();t[m]!=null&&a.setAttribute(w,t[m])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const a=r[l],c=a.getAttribute("data-ln-show");c in t&&a.classList.toggle("hidden",!t[c])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const a=i[l],c=a.getAttribute("data-ln-class").split(",");for(let f=0;f<c.length;f++){const h=c[f].trim().split(":");if(h.length!==2)continue;const w=h[0].trim(),m=h[1].trim();m in t&&a.classList.toggle(w,!!t[m])}}return e}function Y(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)x(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function F(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(i,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let i=0;i<r.length;i++){const l=r[i],a=l.attributes;for(let c=0;c<a.length;c++){const f=a[c];f.value.indexOf("{{")!==-1&&l.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Z(e,t,n,o,r,i){const l={};for(let c=0;c<e.children.length;c++){const f=e.children[c],h=f.getAttribute("data-ln-render-key");h&&(l[h]=f)}const a=document.createDocumentFragment();for(let c=0;c<t.length;c++){const f=t[c],h=String(o(f));let w=l[h];if(w)r(w,f,c);else{const m=B(n,i);if(!m||(F(m,f),w=m.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",h),r(w,f,c)}a.appendChild(w)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=F,window.lnCore.fill=x,window.lnCore.lnFill=Y,window.lnCore.renderList=Z);function R(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function S(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function ee(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 te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const o=new Set(e||[]),r=function(i,l){const a=i.getAttribute(l);return a!==null&&o.has(a)?a:t};return k.set(n,r),r}function oe(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function re(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function j(e,t,n,o,r){if(!e||t===null)return!0;const i=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=c=>{r?console.warn(c,r):console.warn(c)};if(l==="boolean"){const c=t.trim().toLowerCase();return c!==""&&c!=="true"&&c!=="false"&&c!=="1"&&c!=="0"?(a(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const c=e.values||[];return c.includes(t)?!0:(a(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${c.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const c=parseInt(t,10);return e.min!==void 0&&c<e.min?(a(`[${i}] Value ${c} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&c>e.max?(a(`[${i}] Value ${c} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(c){return a(`[${i}] Invalid JSON for attribute "${n}": ${c.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e,t,n){for(const o in n){const[r,i,l]=n[o];Object.defineProperty(e,o,{get:function(){return r(t,i,l)},enumerable:!0,configurable:!0})}return e}function le(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=ne(o.values,o.fallback);break;case"integer":r=S;break;case"float":r=oe;break;case"boolean":r=ee;break;case"list":r=te;break;case"json":r=re;break;case"string":default:r=R;break}r||(r=R),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 ae(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function E(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new o(a)}catch(c){console.error("["+n+"] init failed",a,c)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ue(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function W(){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=W(),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(i=>i.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ae(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 i=e[r];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=W(),r=o.byAttr.get(n);if($()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&_(t)){const i=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<i.length;a++)j(i[a].spec,l,n,i[a].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 i=o.byReactive.get(n);i&&H(i,t,n,e.oldValue),o.reactiveWildcard.length&&H(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const l=r[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(E(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(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 V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=V();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,i=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;i&&o.onSubtreeChange(i,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 i=t[r];E(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.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 i=t[r],l=i.query,a=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&a.push(o);for(let c=0;c<a.length;c++){const f=a[c];if(!document.contains(f)){const h=f[i.attribute];if(h&&typeof h.destroy=="function")try{h.destroy()}catch(w){console.error("["+i.attribute+"] destroy failed",f,w)}delete f[i.attribute]}}}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(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 be(e,t,n,o,r={}){const i=r.extraAttributes||[],l=r.onAttributeChange||null,a=r.onSubtreeChange||null,c=r.onInit||null,f=r.onAttrChange||null,h=r.effects||null,w=r.attributes||null,m=w?se(w):h,T=w?new Set(Object.keys(w)):null,O=r.persist||null;function C(b){const g=b||document.body;if(E(g,e,t,n),w&&$())for(const y in w){const ke=w[y],q=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&q.push(g);for(let I=0;I<q.length;I++){const D=q[I];_(D)&&j(ke,D.getAttribute(y),y,o,D)}}c&&c(g)}const s=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let g;for(;(g=b.exec(e))!==null;)s.push(g[1])}else s.push(e);de({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:c,observed:s.concat(i),onAttributeChange:l,onAttrChange:f,effects:m,declared:T,persist:O}),we();const d=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";V().push({selector:e,attribute:t,ComponentFn:n,onInit:c,onSubtreeChange:a,query:d}),pe(),window[t]=C;function p(){ce()>0?ue(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),C}function U(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=U(t);if(!o)return n;const r=o.split("&");for(let i=0;i<r.length;i++){const l=r[i];if(!l)continue;const a=l.indexOf(":"),c=a>-1?l.slice(0,a):l,f=a>-1?l.slice(a+1):"";if(c)try{n[c]=decodeURIComponent(f)}catch{n[c]=f}}return n}function me(e){if(!e)return null;const t=L();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");U(location.hash)!==r&&(location.hash=r)}function ye(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Ae(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 ve(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function xe(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(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=me,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=ye,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=Ae,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=xe);function Se(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Se),(function(){const e="data-ln-toast",t="lnToast",n="ln-toast-item";if(window[t]!==void 0)return;const o={"data-ln-toast":{type:"marker",description:"Initializes the toast notifications container"},"data-ln-toast-timeout":{prop:"timeoutDefault",type:"integer",read:S,fallback:6e3,min:500,description:"Default auto-dismiss timeout in ms"},"data-ln-toast-max":{prop:"max",type:"integer",read:S,fallback:5,min:1,description:"Maximum visible concurrent toast notifications"},"data-ln-toast-close":{type:"trigger",description:"Click dismiss trigger inside a toast item"},"data-ln-toast-item":{type:"marker",description:"Individual toast notification element"}},r=le(o);function i(s){if(!(!s||!(s instanceof HTMLElement))&&(s.hasAttribute("popover")||s.setAttribute("popover","manual"),typeof s.showPopover=="function")){if(s.matches(":popover-open"))try{s.hidePopover()}catch{}try{s.showPopover()}catch{}}}function l(s){if(!s||!(s instanceof HTMLElement))return;if(s.querySelectorAll("[data-ln-toast-item]").length===0&&typeof s.hidePopover=="function"&&s.matches(":popover-open"))try{s.hidePopover()}catch{}}function a(s){this.dom=s,ie(this,s,r);const u=Array.from(s.querySelectorAll("[data-ln-toast-item]"));for(;u.length>this.max;)s.removeChild(u.shift());for(const d of u)T(d,this);return u.length>0&&i(s),this}a.prototype.enqueue=function(s){if(!s)return;const u=c(s,this.dom);if(!u)return;const d=Number.isFinite(s.timeout)?s.timeout:this.timeoutDefault;h(this,u),d>0&&(u._timer=setTimeout(()=>w(u),d))},a.prototype.clear=function(){for(const s of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(s)},a.prototype.destroy=function(){if(this.dom[t]){for(const s of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(s);l(this.dom),delete this.dom[t]}};function c(s,u){const d=((s.type||"")+"").trim().toLowerCase(),p=X(u,n,"ln-toast");if(!p)return console.warn('[ln-toast] Template "'+n+'" not found'),null;x(p,{type:d,title:s.title,message:typeof s.message=="string"?s.message:void 0});const b=p.firstElementChild;if(!b)return null;b.hasAttribute("data-ln-toast-item")||b.setAttribute("data-ln-toast-item",""),b.classList.add("ln-enter");const g=b.querySelector(".body");g&&f(g,s);const y=b.querySelector("[data-ln-toast-close]");return y&&y.addEventListener("click",function(){w(b)}),b}function f(s,u){if(Array.isArray(u.message)){const d=document.createElement("ul");for(const p of u.message){const b=document.createElement("li");b.textContent=p,d.appendChild(b)}s.appendChild(d)}if(u.data&&u.data.errors){const d=document.createElement("ul");for(const p of Object.values(u.data.errors).flat()){const b=document.createElement("li");b.textContent=p,d.appendChild(b)}s.appendChild(d)}}function h(s,u){const d=Array.from(s.dom.querySelectorAll("[data-ln-toast-item]"));for(;d.length>=s.max&&d.length>0;)s.dom.removeChild(d.shift());s.dom.appendChild(u),i(s.dom),requestAnimationFrame(()=>u.classList.remove("ln-enter"))}function w(s){if(!s||!s.parentNode)return;const u=s.parentNode;clearTimeout(s._timer),s.classList.remove("ln-enter"),s.classList.add("ln-out"),setTimeout(()=>{s.parentNode&&(s.parentNode.removeChild(s),l(u))},200)}function m(s){let u=s&&s.container;return typeof u=="string"&&(u=document.querySelector(u)),u instanceof HTMLElement||(u=document.querySelector("["+e+"]")||document.getElementById("ln-toast-container")),u||null}function T(s,u){if(s._lnToastHydrated)return;s._lnToastHydrated=!0;const d=s.querySelector("[data-ln-toast-close]");d&&d.addEventListener("click",function(){w(s)});const p=+(s.getAttribute("data-ln-toast-timeout")??u.timeoutDefault);p>0&&(s._timer=setTimeout(function(){w(s)},p))}function O(s){const u=s.detail||{},d=m(u);if(!d){console.warn("[ln-toast] No toast container found");return}(d[t]||(d[t]=new a(d))).enqueue(u)}function C(s){const u=s&&s.detail||{};if(u.container){const d=m(u);d&&(d[t]||(d[t]=new a(d))).clear()}else{const d=document.querySelectorAll("["+e+"]");for(const p of Array.from(d))(p[t]||(p[t]=new a(p))).clear()}}A(function(){window.addEventListener("ln-toast:enqueue",O),window.addEventListener("ln-toast:clear",C),window.addEventListener("ln-modal:open",function(){const s=document.querySelectorAll("["+e+"], #ln-toast-container");for(const u of Array.from(s))u.querySelectorAll("[data-ln-toast-item]").length>0&&i(u)})},"ln-toast"),be(e,t,a,"ln-toast",{attributes:o})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!x(o))return}e.apply(console,t)}}function Z(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 A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&l[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);l[r.name]=r.value===""||isNaN(u)?null:u}else l[r.name]=r.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(r).split(",").map(function(p){return p.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ne(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<i.options.length;u++)i.options[u].selected=r.indexOf(i.options[u].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const $={};function re(e,t){$[e]=t}function ie(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){Z(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=se,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=le);const _={};function B(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ce(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return B(t,n)}function S(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),b=p[1].trim();t[b]!=null&&c.setAttribute(w,t[b])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),b=p[1].trim();b in t&&c.classList.toggle(w,!!t[b])}}return e}function ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let 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)S(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function de(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const u=e.children[r],p=u.getAttribute("data-ln-render-key");p&&(i[p]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],p=String(o(u));let w=i[p];if(w)l(w,u,r);else{const b=B(n,s);if(!b||(R(b,u),w=b.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",p),l(w,u,r)}c.appendChild(w)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=S,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function k(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function v(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return E.set(n,l),l}function U(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function V(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function P(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=H(o.values,o.fallback);break;case"integer":l=v;break;case"float":l=U;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=V;break;case"string":default:l=k;break}l||(l=k),t[o.prop]=[l,n,o.fallback]}return t}function fe(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 we(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=Q,window.lnCore.attrSpec=J,window.lnCore.attrStr=k,window.lnCore.attrInt=v,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function L(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(r){console.error("["+n+"] init failed",c,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function he(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function me(e){const t=K(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=we(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function be(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=K(),l=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&x(t)){const s=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)P(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&z(s,t,n,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const i=l[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(L(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{be(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function G(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ye(e){const t=G();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];L(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],i=s.query,c=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&c.push(o);for(let r=0;r<c.length;r++){const u=c[r];if(!document.contains(u)){const p=u[s.attribute];if(p&&typeof p.destroy=="function")try{p.destroy()}catch(w){console.error("["+s.attribute+"] destroy failed",u,w)}delete u[s.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ye(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,r=l.onInit||null,u=l.onAttrChange||null,p=l.effects||null,w=l.attributes||null,b=w?fe(w):p,O=w?new Set(Object.keys(w)):null,q=l.persist||null;function C(m){const g=m||document.body;if(L(g,e,t,n),w&&F())for(const y in w){const Oe=w[y],I=Array.from(g.querySelectorAll("["+y+"]"));g.matches&&g.matches("["+y+"]")&&I.push(g);for(let D=0;D<I.length;D++){const N=I[D];x(N)&&P(Oe,N.getAttribute(y),y,o,N)}}r&&r(g)}const a=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let g;for(;(g=m.exec(e))!==null;)a.push(g[1])}else a.push(e);me({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:a.concat(s),onAttributeChange:i,onAttrChange:u,effects:b,declared:O,persist:q}),ge();const d=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,f=l.subtreeQuery||(d?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:f}),Ce(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function h(){pe()>0?he(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),C}function Y(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Ae(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ve(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Ae,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);function Te(){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=Te),(function(){const e="data-ln-toast",t="lnToast",n="ln-toast-item";if(window[t]!==void 0)return;const o={"data-ln-toast":{type:"marker",description:"Initializes the toast notifications container"},"data-ln-toast-timeout":{prop:"timeoutDefault",type:"integer",read:v,fallback:6e3,min:500,description:"Default auto-dismiss timeout in ms"},"data-ln-toast-max":{prop:"max",type:"integer",read:v,fallback:5,min:1,description:"Maximum visible concurrent toast notifications"},"data-ln-toast-close":{type:"trigger",description:"Click dismiss trigger inside a toast item"},"data-ln-toast-item":{type:"marker",description:"Individual toast notification element"}},l=J(o);function s(a){if(!(!a||!(a instanceof HTMLElement))&&(a.hasAttribute("popover")||a.setAttribute("popover","manual"),typeof a.showPopover=="function")){if(a.matches(":popover-open"))try{a.hidePopover()}catch{}try{a.showPopover()}catch{}}}function i(a){if(!a||!(a instanceof HTMLElement))return;if(a.querySelectorAll("[data-ln-toast-item]").length===0&&typeof a.hidePopover=="function"&&a.matches(":popover-open"))try{a.hidePopover()}catch{}}function c(a){this.dom=a,Q(this,a,l);const d=Array.from(a.querySelectorAll("[data-ln-toast-item]"));for(;d.length>this.max;)a.removeChild(d.shift());for(const f of d)O(f,this);return d.length>0&&s(a),this}c.prototype.enqueue=function(a){if(!a)return;const d=r(a,this.dom);if(!d)return;const f=Number.isFinite(a.timeout)?a.timeout:this.timeoutDefault;p(this,d),f>0&&(d._timer=setTimeout(()=>w(d),f))},c.prototype.clear=function(){for(const a of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(a)},c.prototype.destroy=function(){if(this.dom[t]){for(const a of Array.from(this.dom.querySelectorAll("[data-ln-toast-item]")))w(a);i(this.dom),delete this.dom[t]}};function r(a,d){const f=((a.type||"")+"").trim().toLowerCase(),h=ce(d,n,"ln-toast");if(!h)return console.warn('[ln-toast] Template "'+n+'" not found'),null;S(h,{type:f,title:a.title,message:typeof a.message=="string"?a.message:void 0});const m=h.firstElementChild;if(!m)return null;m.hasAttribute("data-ln-toast-item")||m.setAttribute("data-ln-toast-item",""),m.classList.add("ln-enter");const g=m.querySelector(".body");g&&u(g,a);const y=m.querySelector("[data-ln-toast-close]");return y&&y.addEventListener("click",function(){w(m)}),m}function u(a,d){if(Array.isArray(d.message)){const f=document.createElement("ul");for(const h of d.message){const m=document.createElement("li");m.textContent=h,f.appendChild(m)}a.appendChild(f)}if(d.data&&d.data.errors){const f=document.createElement("ul");for(const h of Object.values(d.data.errors).flat()){const m=document.createElement("li");m.textContent=h,f.appendChild(m)}a.appendChild(f)}}function p(a,d){const f=Array.from(a.dom.querySelectorAll("[data-ln-toast-item]"));for(;f.length>=a.max&&f.length>0;)a.dom.removeChild(f.shift());a.dom.appendChild(d),s(a.dom),requestAnimationFrame(()=>d.classList.remove("ln-enter"))}function w(a){if(!a||!a.parentNode)return;const d=a.parentNode;clearTimeout(a._timer),a.classList.remove("ln-enter"),a.classList.add("ln-out"),setTimeout(()=>{a.parentNode&&(a.parentNode.removeChild(a),i(d))},200)}function b(a){let d=a&&a.container;return typeof d=="string"&&(d=document.querySelector(d)),d instanceof HTMLElement||(d=document.querySelector("["+e+"]")||document.getElementById("ln-toast-container")),d||null}function O(a,d){if(a._lnToastHydrated)return;a._lnToastHydrated=!0;const f=a.querySelector("[data-ln-toast-close]");f&&f.addEventListener("click",function(){w(a)});const h=+(a.getAttribute("data-ln-toast-timeout")??d.timeoutDefault);h>0&&(a._timer=setTimeout(function(){w(a)},h))}function q(a){const d=a.detail||{},f=b(d);if(!f){console.warn("[ln-toast] No toast container found");return}(f[t]||(f[t]=new c(f))).enqueue(d)}function C(a){const d=a&&a.detail||{};if(d.container){const f=b(d);f&&(f[t]||(f[t]=new c(f))).clear()}else{const f=document.querySelectorAll("["+e+"]");for(const h of Array.from(f))(h[t]||(h[t]=new c(h))).clear()}}A(function(){window.addEventListener("ln-toast:enqueue",q),window.addEventListener("ln-toast:clear",C),window.addEventListener("ln-modal:open",function(){const a=document.querySelectorAll("["+e+"], #ln-toast-container");for(const d of Array.from(a))d.querySelectorAll("[data-ln-toast-item]").length>0&&s(d)})},"ln-toast"),X(e,t,c,"ln-toast",{attributes:o})})()})();
|