@livenetworks/ashlar 2.0.10 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +106 -40
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/src/ln-editor.js +45 -12
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -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 E(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){l=t[s];break}if(!E(l))return}e.apply(console,t)}}function k(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}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 Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,s={},u=e.elements,i={};if(o)for(let r=0;r<u.length;r++){const n=u[r];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let r=0;r<u.length;r++){const n=u[r];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")o&&i[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&s[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);s[n.name]=n.value===""||isNaN(c)?null:c}else s[n.name]=n.value}return s}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const o=e.elements,l=[],s={};for(let u=0;u<o.length;u++){const i=o[u];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let u=0;u<o.length;u++){const i=o[u];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const r=i.getAttribute("data-ln-fill-as")||i.name;if(!r||!(r in t))continue;const n=t[r];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(s[i.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=te(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const B={};function oe(e,t){B[e]=t}function ie(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){k(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function le(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];F[o]=t}function se(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=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=re);const x={};function ue(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const r=o[i],n=r.getAttribute("data-ln-field");t[n]!=null&&(r.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const r=l[i],n=r.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&r.setAttribute(a,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const r=s[i],n=r.getAttribute("data-ln-show");n in t&&r.classList.toggle("hidden",!t[n])}const u=e.querySelectorAll("[data-ln-class]");for(let i=0;i<u.length;i++){const r=u[i],n=r.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&r.classList.toggle(a,!!t[f])}}return e}function ce(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function $(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const u=o.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,r){return t[r]!==void 0?t[r]:""}))}const l=function(u,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let u=0;u<s.length;u++){const i=s[u],r=i.attributes;for(let n=0;n<r.length;n++){const c=r[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function de(e,t,o,l,s,u){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const r=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(l(c));let a=i[d];if(a)s(a,c,n);else{const f=ue(o,u);if(!f||($(f,c),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),s(a,c,n)}r.appendChild(a)}e.textContent="",e.appendChild(r)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function S(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function N(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function j(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const s=l.trim().toLowerCase();return!(s==="false"||s==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const L=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(L.has(o))return L.get(o);const l=new Set(e||[]),s=function(u,i){const r=u.getAttribute(i);return r!==null&&l.has(r)?r:t};return L.set(o,s),s}function P(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function U(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function H(e,t,o,l,s){if(!e||t===null)return!0;const u=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const r=n=>{s?console.warn(n,s):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(r(`[${u}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(r(`[${u}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return r(`[${u}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(r(`[${u}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(r(`[${u}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(r(`[${u}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return r(`[${u}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function V(e,t,o){for(const l in o){const[s,u,i]=o[l];Object.defineProperty(e,l,{get:function(){return s(t,u,i)},enumerable:!0,configurable:!0})}return e}function K(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let s=l.read;if(!s&&l.type)switch(l.type){case"enum":s=W(l.values,l.fallback);break;case"integer":s=N;break;case"float":s=P;break;case"boolean":s=j;break;case"list":s=z;break;case"json":s=U;break;case"string":default:s=S;break}s||(s=S),t[l.prop]=[s,o,l.fallback]}return t}function ae(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=V,window.lnCore.attrSpec=K,window.lnCore.attrStr=S,window.lnCore.attrInt=N,window.lnCore.attrBool=j,window.lnCore.attrList=z,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);function O(e,t,o,l){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(u));e.matches&&e.matches(u)&&i.push(e);for(const r of i)if(!r[o]){window.lnCore._persistSink&&r.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(r,t);try{r[o]=new l(r)}catch(n){console.error("["+o+"] init failed",r,n)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function we(e){const t=Q(),o=e.observed||[];for(let l=0;l<o.length;l++){const s=o[l];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const s=t.byDeclaredAttr.get(l);s.some(u=>u.componentTag===e.componentTag)||s.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=fe(e);if(l===null)t.reactiveWildcard.push(e);else for(const s of l)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function J(e,t,o,l){for(let s=0;s<e.length;s++){const u=e[s];if(!t[u.attribute])continue;const i=u.effects&&u.effects[o];i?i(t,o,l):u.onAttrChange&&(!u.declared||u.declared.has(o))&&u.onAttrChange(t,o,l)}}function he(e){const t=e.target,o=e.attributeName;if(e.oldValue===t.getAttribute(o))return;const l=Q(),s=l.byAttr.get(o);if(q()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(o)&&E(t)){const u=l.byDeclaredAttr.get(o),i=t.getAttribute(o);for(let r=0;r<u.length;r++)H(u[r].spec,i,o,u[r].componentTag,t)}if(window.lnCore._debugSink&&(o.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",o,t,{oldValue:e.oldValue,newValue:t.getAttribute(o)}),o.indexOf("data-ln-")===0){const u=l.byReactive.get(o);u&&J(u,t,o,e.oldValue),l.reactiveWildcard.length&&J(l.reactiveWildcard,t,o,e.oldValue)}if(s)for(let u=0;u<s.length;u++){const i=s[u];if(i.handler){i.handler(t,o,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,o):(O(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{he(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].target,l)}}).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 me(e){const t=G();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const l=t[o];if(l.onSubtreeChange){const s=l.query,u=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;u&&l.onSubtreeChange(u,e)}}for(let o=0;o<e.addedNodes.length;o++){const l=e.addedNodes[o];if(l.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s];O(l,u.selector,u.attribute,u.ComponentFn),u.onInit&&u.onInit(l)}}for(let o=0;o<e.removedNodes.length;o++){const l=e.removedNodes[o];if(l.nodeType===1)for(let s=0;s<t.length;s++){const u=t[s],i=u.query,r=Array.from(l.querySelectorAll(i));l.matches&&l.matches(i)&&r.push(l);for(let n=0;n<r.length;n++){const c=r[n];if(!document.contains(c)){const d=c[u.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+u.attribute+"] destroy failed",c,a)}delete c[u.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{me(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,o,l,s={}){const u=s.extraAttributes||[],i=s.onAttributeChange||null,r=s.onSubtreeChange||null,n=s.onInit||null,c=s.onAttrChange||null,d=s.effects||null,a=s.attributes||null,f=a?ae(a):d,_=a?new Set(Object.keys(a)):null,v=s.persist||null;function C(w){const p=w||document.body;if(O(p,e,t,o),a&&q())for(const h in a){const De=a[h],D=Array.from(p.querySelectorAll("["+h+"]"));p.matches&&p.matches("["+h+"]")&&D.push(p);for(let I=0;I<D.length;I++){const R=D[I];E(R)&&H(De,R.getAttribute(h),h,l,R)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let p;for(;(p=w.exec(e))!==null;)b.push(p[1])}else b.push(e);we({selector:e,attribute:t,componentTag:l,attributes:a,ComponentFn:o,onInit:n,observed:b.concat(u),onAttributeChange:i,onAttrChange:c,effects:f,declared:_,persist:v}),be();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=s.subtreeQuery||(m?e:"["+e+"]");G().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:r,query:y}),ye(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function g(){ge()>0?pe(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),C}function Y(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},l=Y(t);if(!l)return o;const s=l.split("&");for(let u=0;u<s.length;u++){const i=s[u];if(!i)continue;const r=i.indexOf(":"),n=r>-1?i.slice(0,r):i,c=r>-1?i.slice(r+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Ce(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ve(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(u){const i=o[u];return i===""?u:u+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==s&&(location.hash=s)}function _e(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ee(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 xe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),l=e.slice(t+1),s=l?l.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=xe,window.lnCore.hashFilterDecode=Se);function Le(e,t,o,l){const s=typeof l=="number"?l:4,u=window.innerWidth,i=window.innerHeight,r=t.width,n=t.height,c=o.split("-"),d=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},_=f[d]||f.bottom;function v(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-r:e.left+(e.width-r)/2:a==="start"?e.top:a==="end"?e.bottom-n:e.top+(e.height-n)/2}function C(g){let w,p,h=!0;return g==="top"?(w=e.top-s-n,p=v(g),w<0&&(h=!1)):g==="bottom"?(w=e.bottom+s,p=v(g),w+n>i&&(h=!1)):g==="left"?(w=v(g),p=e.left-s-r,p<0&&(h=!1)):(w=v(g),p=e.right+s,p+r>u&&(h=!1)),{top:w,left:p,side:g,fits:h}}let b=null;for(let g=0;g<_.length;g++){const w=C(_[g]);if(w.fits){b=w;break}}b||(b=C(_[0]));let m=b.top,y=b.left;return r>=u?y=0:(y<0&&(y=0),y+r>u&&(y=u-r)),n>=i?m=0:(m<0&&(m=0),m+n>i&&(m=i-n)),{top:m,left:y,placement:b.side}}function Oe(e){if(!e)return{width:0,height:0};const t=e.style,o=t.visibility,l=t.display,s=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const u=e.offsetWidth,i=e.offsetHeight;return t.visibility=o,t.display=l,t.position=s,{width:u,height:i}}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-dropdown",t="lnDropdown",o="bottom-end";if(window[t]!==void 0)return;const l={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"position",type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:o,description:"Preferred positioning anchor"},"data-ln-dropdown-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},s=K(l);function u(i){this.dom=i,V(this,i,s),this.toggleEl=i.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=i.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const r=this;return this._onRequestOpen=function(){r.toggleEl&&r.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){r.toggleEl&&r.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(r.toggleEl){const n=r.toggleEl.getAttribute("data-ln-toggle");r.toggleEl.setAttribute("data-ln-toggle",n==="open"?"close":"open")}},this._onKeydown=function(n){const c=r.toggleEl&&r.toggleEl.getAttribute("data-ln-toggle")==="open";if(n.key==="Escape"){c&&(n.preventDefault(),n.stopPropagation(),r.toggleEl.setAttribute("data-ln-toggle","close"),r.triggerBtn&&r.triggerBtn.focus());return}if(n.key==="Tab"){c&&(r.triggerBtn&&r.triggerBtn.focus(),r.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=r._getMenuItems();if(d.length===0)return;if(!c&&(n.key==="ArrowDown"||n.key==="ArrowUp")){n.preventDefault(),r.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=r._getMenuItems();f.length>0&&r._focusItem(f,n.key==="ArrowDown"?0:f.length-1)},0);return}if(!c)return;const a=d.indexOf(document.activeElement);if(n.key==="ArrowDown"){n.preventDefault();const f=a<d.length-1?a+1:0;r._focusItem(d,f)}else if(n.key==="ArrowUp"){n.preventDefault();const f=a>0?a-1:d.length-1;r._focusItem(d,f)}else n.key==="Home"?(n.preventDefault(),r._focusItem(d,0)):n.key==="End"&&(n.preventDefault(),r._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(n){!n.detail||n.detail.target!==r.toggleEl||(r.triggerBtn&&r.triggerBtn.setAttribute("aria-expanded","true"),typeof r.toggleEl.showPopover=="function"&&r.toggleEl.showPopover(),r._initMenuAria(),r._reposition(),r._addOutsideClickListener(),r._addScrollRepositionListener(),r._addResizeCloseListener(),k(i,"ln-dropdown:open",{target:n.detail.target}))},this._onToggleClose=function(n){!n.detail||n.detail.target!==r.toggleEl||(r.triggerBtn&&r.triggerBtn.setAttribute("aria-expanded","false"),r._removeOutsideClickListener(),r._removeScrollRepositionListener(),r._removeResizeCloseListener(),r.toggleEl.style.top="",r.toggleEl.style.left="",r.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof r.toggleEl.hidePopover=="function"&&r.toggleEl.matches(":popover-open")&&r.toggleEl.hidePopover(),k(i,"ln-dropdown:close",{target:n.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}u.prototype._initMenuAria=function(){if(!this.toggleEl)return;const i=this.toggleEl.querySelectorAll("li");for(const n of i)n.setAttribute("role","none");const r=this._getMenuItems();for(let n=0;n<r.length;n++)r[n].setAttribute("role","menuitem"),r[n].setAttribute("tabindex",n===0?"0":"-1")},u.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},u.prototype._focusItem=function(i,r){for(let n=0;n<i.length;n++)i[n].setAttribute("tabindex",n===r?"0":"-1");i[r]&&i[r].focus()},u.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const i=this.triggerBtn.getBoundingClientRect(),r=Oe(this.toggleEl),n=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,c=this.position||o,d=Le(i,r,c,n);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px",this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},u.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const i=this;this._boundDocClick=function(r){i.dom.contains(r.target)||i.toggleEl&&i.toggleEl.contains(r.target)||i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},i._docClickTimeout=setTimeout(function(){i._docClickTimeout=null,document.addEventListener("click",i._boundDocClick)},0)},u.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},u.prototype._addScrollRepositionListener=function(){const i=this;this._boundScrollReposition=function(){i._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},u.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},u.prototype._addResizeCloseListener=function(){const i=this;this._boundResizeClose=function(){i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open"&&i.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},u.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},X(e,t,u,"ln-dropdown",{attributes:l})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function k(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let s=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){s=t[r];break}if(!k(s))return}e.apply(console,t)}}function x(e,t,l){const s=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,s),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const l=!!(t&&t.typed),s=t&&t.exclude,r={},u=e.elements,o={};if(l)for(let i=0;i<u.length;i++){const n=u[i];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let i=0;i<u.length;i++){const n=u[i];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(s&&n.matches&&n.matches(s)))if(n.type==="checkbox")l&&o[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&r[n.name].push(n.options[c].value)}else if(l&&n.type==="hidden")r[n.name]=n.value;else if(l&&(n.type==="number"||n.type==="range")){const c=Number(n.value);r[n.name]=n.value===""||isNaN(c)?null:c}else r[n.name]=n.value}return r}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const l=e.elements,s=[],r={};for(let u=0;u<l.length;u++){const o=l[u];o.name&&o.type==="checkbox"&&(r[o.name]=(r[o.name]||0)+1)}for(let u=0;u<l.length;u++){const o=l[u];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const i=o.getAttribute("data-ln-fill-as")||o.name;if(!i||!(i in t))continue;const n=t[i];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(r[o.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=ie(n);s.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),s.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;s.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),s.push(o)}return s}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ne);const M={};function le(e,t){M[e]=t}function se(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function ce(e,t){if(!e||typeof t!="object")return;const l=e.toLowerCase().split("-")[0];$[l]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ue);const S={};function ae(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const l=S[e];return l?l.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const l=e.querySelectorAll("[data-ln-field]");for(let o=0;o<l.length;o++){const i=l[o],n=i.getAttribute("data-ln-field");t[n]!=null&&(i.textContent=t[n])}const s=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<s.length;o++){const i=s[o],n=i.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&i.setAttribute(a,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let o=0;o<r.length;o++){const i=r[o],n=i.getAttribute("data-ln-show");n in t&&i.classList.toggle("hidden",!t[n])}const u=e.querySelectorAll("[data-ln-class]");for(let o=0;o<u.length;o++){const i=u[o],n=i.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&i.classList.toggle(a,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const l=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<l.length;s++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[s],t??null),l[s].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let l=0;l<t.length;l++)t[l].textContent=""}})));function j(e,t){if(!e||!t)return e;const l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,i){return t[i]!==void 0?t[i]:""}))}const s=function(u,o){return t[o]!==void 0?t[o]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let u=0;u<r.length;u++){const o=r[u],i=o.attributes;for(let n=0;n<i.length;n++){const c=i[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return e}function ge(e,t,l,s,r,u){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const i=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(s(c));let a=o[d];if(a)r(a,c,n);else{const f=ae(l,u);if(!f||(j(f,c),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),r(a,c,n)}i.appendChild(a)}e.textContent="",e.appendChild(i)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=N,window.lnCore.lnFill=fe,window.lnCore.renderList=ge);function L(e,t,l){const s=e.getAttribute(t);return s===null?l:s}function z(e,t,l){const s=parseInt(e.getAttribute(t),10);return isNaN(s)?l:s}function W(e,t,l=!1){const s=e.getAttribute(t);if(s===null)return!!l;const r=s.trim().toLowerCase();return!(r==="false"||r==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(l=>l.trim()).filter(Boolean)}const O=new Map;function U(e,t){const l=(e?e.join("|"):"")+"::"+t;if(O.has(l))return O.get(l);const s=new Set(e||[]),r=function(u,o){const i=u.getAttribute(o);return i!==null&&s.has(i)?i:t};return O.set(l,r),r}function H(e,t,l){const s=parseFloat(e.getAttribute(t));return isNaN(s)?l:s}function V(e,t,l){const s=e.getAttribute(t);if(!s)return l;try{return JSON.parse(s)}catch{return l}}function K(e,t,l,s,r){if(!e||t===null)return!0;const u=s||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const i=n=>{r?console.warn(n,r):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(i(`[${u}] Invalid value "${t}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(i(`[${u}] Invalid value "${t}" for attribute "${l}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return i(`[${u}] Invalid integer "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(i(`[${u}] Value ${n} for attribute "${l}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(i(`[${u}] Value ${n} for attribute "${l}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(i(`[${u}] Invalid float "${t}" for attribute "${l}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return i(`[${u}] Invalid JSON for attribute "${l}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,l){for(const s in l){const[r,u,o]=l[s];Object.defineProperty(e,s,{get:function(){return r(t,u,o)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const l in e){const s=e[l];if(!s||!s.prop)continue;let r=s.read;if(!r&&s.type)switch(s.type){case"enum":r=U(s.values,s.fallback);break;case"integer":r=z;break;case"float":r=H;break;case"boolean":r=W;break;case"list":r=P;break;case"json":r=V;break;case"string":default:r=L;break}r||(r=L),t[s.prop]=[r,l,s.fallback]}return t}function pe(e){const t={};for(const l in e){const s=e[l];s&&s.effect&&(t[l]=s.effect)}return Object.keys(t).length?t:null}function he(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const l in e.effects)t.add(l);if(e.onAttrChange&&e.declared)for(const l of e.declared)t.add(l);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=J,window.lnCore.attrStr=L,window.lnCore.attrInt=z,window.lnCore.attrBool=W,window.lnCore.attrList=P,window.lnCore.attrEnum=U,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function _(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(l){console.error("["+t.attribute+"] init failed",e,l)}}}function G(e,t,l,s){if(e.nodeType!==1)return;const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:l,ComponentFn:s};if(e.matches&&e.matches(u)&&_(e,o),e.querySelectorAll){const i=e.querySelectorAll(u);for(let n=0;n<i.length;n++)_(i[n],o)}}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 X(){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=X(),l=e.observed||[];for(let s=0;s<l.length;s++){const r=l[s];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 s in e.attributes){t.byDeclaredAttr.has(s)||t.byDeclaredAttr.set(s,[]);const r=t.byDeclaredAttr.get(s);r.some(u=>u.componentTag===e.componentTag)||r.push({spec:e.attributes[s],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const s=he(e);if(s===null)t.reactiveWildcard.push(e);else for(const r of s)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,l,s){for(let r=0;r<e.length;r++){const u=e[r];if(!t[u.attribute])continue;const o=u.effects&&u.effects[l];o?o(t,l,s):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(t,l,s)}}function Ce(e){const t=e.attributeName,l=t.indexOf("data-ln-")===0,s=X(),r=s.byAttr.get(t),u=F()&&s.byDeclaredAttr&&s.byDeclaredAttr.has(t);if(!l&&!r&&!u)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(u&&k(o)){const i=s.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<i.length;c++)K(i[c].spec,n,t,i[c].componentTag,o)}if(window.lnCore._debugSink&&(l||r)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),l){const i=s.byReactive.get(t);i&&Y(i,o,t,e.oldValue),s.reactiveWildcard.length&&Y(s.reactiveWildcard,o,t,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const n=r[i];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(G(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++)try{Ce(t[l])}catch(s){console.error("[ln-core] mutation handler failed",t[l].target,s)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function D(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const l=e[t.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(s){console.error("["+t.attribute+"] destroy failed",e,s)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ve(e){const t=D();if(!t.length)return;const l=e.target;if(l){const s=l.nodeType===1?l:l.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let s=0;s<t.length;s++){const r=t[s];if(r.onSubtreeChange&&r.query){const u=r.query,o=e.target.nodeType===1?e.target.matches&&e.target.matches(u)?e.target:e.target.closest?e.target.closest(u):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(u):null;o&&r.onSubtreeChange(o,e)}}for(let s=0;s<e.addedNodes.length;s++){const r=e.addedNodes[s];if(r.nodeType===1){const u=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const i=t[o];if(i.selector&&i.attribute&&i.ComponentFn){if(!u)r.matches&&r.matches(i.query)&&_(r,i);else if(r.matches&&r.matches(i.query)&&_(r,i),r.querySelectorAll){const n=r.querySelectorAll(i.query);for(let c=0;c<n.length;c++)_(n[c],i)}}i.onInit&&i.onInit(r)}}}for(let s=0;s<e.removedNodes.length;s++){const r=e.removedNodes[s];if(r.nodeType===1){const u=!!(r.firstElementChild||r.children&&r.children.length);for(let o=0;o<t.length;o++){const i=t[o],n=i.query;if(n){if(!u)r.matches&&r.matches(n)&&T(r,i);else if(r.matches&&r.matches(n)&&T(r,i),r.querySelectorAll){const c=r.querySelectorAll(n);for(let d=0;d<c.length;d++)T(c[d],i)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let l=0;l<t.length;l++){const s=t[l];if(s.type==="childList")try{ve(s)}catch(r){console.error("[ln-core] lifecycle handler failed",s.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){D().push(e),Z()}function ee(e,t,l,s,r={}){const u=r.extraAttributes||[],o=r.onAttributeChange||null,i=r.onSubtreeChange||null,n=r.onInit||null,c=r.onAttrChange||null,d=r.effects||null,a=r.attributes||null,f=a?pe(a):d,A=a?new Set(Object.keys(a)):null,v=r.persist||null;function y(h){const p=h||document.body;if(G(p,e,t,l),a&&F())for(const w in a){const Re=a[w],I=Array.from(p.querySelectorAll("["+w+"]"));p.matches&&p.matches("["+w+"]")&&I.push(p);for(let R=0;R<I.length;R++){const B=I[R];k(B)&&K(Re,B.getAttribute(w),w,s,B)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let p;for(;(p=h.exec(e))!==null;)b.push(p[1])}else b.push(e);me({selector:e,attribute:t,componentTag:s,attributes:a,ComponentFn:l,onInit:n,observed:b.concat(u),onAttributeChange:o,onAttrChange:c,effects:f,declared:A,persist:v}),ye();const m=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=r.subtreeQuery||(m?e:"["+e+"]");D().push({selector:e,attribute:t,ComponentFn:l,onInit:n,onSubtreeChange:i,query:C}),Z(),window[t]=y,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=_e);function g(){we()>0?be(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),y}function te(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,l={},s=te(t);if(!s)return l;const r=s.split("&");for(let u=0;u<r.length;u++){const o=r[u];if(!o)continue;const i=o.indexOf(":"),n=i>-1?o.slice(0,i):o,c=i>-1?o.slice(i+1):"";if(n)try{l[n]=decodeURIComponent(c)}catch{l[n]=c}}return l}function Ae(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const l=q();t==null?delete l[e]:l[e]=String(t);const r=Object.keys(l).map(function(u){const o=l[u];return o===""?u:u+":"+encodeURIComponent(o)}).join("&");te(location.hash)!==r&&(location.hash=r)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const l=e.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const s=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return s?t?s+"-"+t:s:t||null}function 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 Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const l=e.slice(0,t),s=e.slice(t+1),r=s?s.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Ae,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=De);function Te(e,t,l,s){const r=typeof s=="number"?s:4,u=window.innerWidth,o=window.innerHeight,i=t.width,n=t.height,c=l.split("-"),d=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=f[d]||f.bottom;function v(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-i:e.left+(e.width-i)/2:a==="start"?e.top:a==="end"?e.bottom-n:e.top+(e.height-n)/2}function y(g){let h,p,w=!0;return g==="top"?(h=e.top-r-n,p=v(g),h<0&&(w=!1)):g==="bottom"?(h=e.bottom+r,p=v(g),h+n>o&&(w=!1)):g==="left"?(h=v(g),p=e.left-r-i,p<0&&(w=!1)):(h=v(g),p=e.right+r,p+i>u&&(w=!1)),{top:h,left:p,side:g,fits:w}}let b=null;for(let g=0;g<A.length;g++){const h=y(A[g]);if(h.fits){b=h;break}}b||(b=y(A[0]));let m=b.top,C=b.left;return i>=u?C=0:(C<0&&(C=0),C+i>u&&(C=u-i)),n>=o?m=0:(m<0&&(m=0),m+n>o&&(m=o-n)),{top:m,left:C,placement:b.side}}function qe(e){if(!e)return{width:0,height:0};const t=e.style,l=t.visibility,s=t.display,r=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const u=e.offsetWidth,o=e.offsetHeight;return t.visibility=l,t.display=s,t.position=r,{width:u,height:o}}function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ie),(function(){const e="data-ln-dropdown",t="lnDropdown",l="bottom-end";if(window[t]!==void 0)return;const s={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"position",type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:l,description:"Preferred positioning anchor"},"data-ln-dropdown-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},r=J(s);function u(o){this.dom=o,Q(this,o,r),this.toggleEl=o.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=o.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const i=this;return this._onRequestOpen=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(i.toggleEl){const n=i.toggleEl.getAttribute("data-ln-toggle");i.toggleEl.setAttribute("data-ln-toggle",n==="open"?"close":"open")}},this._onKeydown=function(n){const c=i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open";if(n.key==="Escape"){c&&(n.preventDefault(),n.stopPropagation(),i.toggleEl.setAttribute("data-ln-toggle","close"),i.triggerBtn&&i.triggerBtn.focus());return}if(n.key==="Tab"){c&&(i.triggerBtn&&i.triggerBtn.focus(),i.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=i._getMenuItems();if(d.length===0)return;if(!c&&(n.key==="ArrowDown"||n.key==="ArrowUp")){n.preventDefault(),i.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=i._getMenuItems();f.length>0&&i._focusItem(f,n.key==="ArrowDown"?0:f.length-1)},0);return}if(!c)return;const a=d.indexOf(document.activeElement);if(n.key==="ArrowDown"){n.preventDefault();const f=a<d.length-1?a+1:0;i._focusItem(d,f)}else if(n.key==="ArrowUp"){n.preventDefault();const f=a>0?a-1:d.length-1;i._focusItem(d,f)}else n.key==="Home"?(n.preventDefault(),i._focusItem(d,0)):n.key==="End"&&(n.preventDefault(),i._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","true"),typeof i.toggleEl.showPopover=="function"&&i.toggleEl.showPopover(),i._initMenuAria(),i._reposition(),i._addOutsideClickListener(),i._addScrollRepositionListener(),i._addResizeCloseListener(),x(o,"ln-dropdown:open",{target:n.detail.target}))},this._onToggleClose=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","false"),i._removeOutsideClickListener(),i._removeScrollRepositionListener(),i._removeResizeCloseListener(),i.toggleEl.style.top="",i.toggleEl.style.left="",i.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof i.toggleEl.hidePopover=="function"&&i.toggleEl.matches(":popover-open")&&i.toggleEl.hidePopover(),x(o,"ln-dropdown:close",{target:n.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}u.prototype._initMenuAria=function(){if(!this.toggleEl)return;const o=this.toggleEl.querySelectorAll("li");for(const n of o)n.setAttribute("role","none");const i=this._getMenuItems();for(let n=0;n<i.length;n++)i[n].setAttribute("role","menuitem"),i[n].setAttribute("tabindex",n===0?"0":"-1")},u.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},u.prototype._focusItem=function(o,i){for(let n=0;n<o.length;n++)o[n].setAttribute("tabindex",n===i?"0":"-1");o[i]&&o[i].focus()},u.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl)return;const o=this.triggerBtn.getBoundingClientRect(),i=qe(this.toggleEl),n=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,c=this.position||l,d=Te(o,i,c,n);this.toggleEl.style.top=d.top+"px",this.toggleEl.style.left=d.left+"px",this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},u.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const o=this;this._boundDocClick=function(i){o.dom.contains(i.target)||o.toggleEl&&o.toggleEl.contains(i.target)||o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},o._docClickTimeout=setTimeout(function(){o._docClickTimeout=null,document.addEventListener("click",o._boundDocClick)},0)},u.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},u.prototype._addScrollRepositionListener=function(){const o=this;this._boundScrollReposition=function(){o._reposition()},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},u.prototype._removeScrollRepositionListener=function(){this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},u.prototype._addResizeCloseListener=function(){const o=this;this._boundResizeClose=function(){o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},u.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},u.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},ee(e,t,u,"ln-dropdown",{attributes:s})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(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(!N(r))return}e.apply(console,t)}}function A(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 se(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 T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let d=0;d<l.options.length;d++)l.options[d].selected&&o[l.name].push(l.options[d].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const d=Number(l.value);o[l.name]=l.value===""||isNaN(d)?null:d}else o[l.name]=l.value}return o}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(l).split(",").map(function(m){return m.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=ue(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let d=0;d<i.options.length;d++)i.options[d].selected=l.indexOf(i.options[d].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ae);const H={};function fe(e,t){H[e]=t}function he(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=we);const M={};function j(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 me(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return j(t,n)}function P(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();t[v]!=null&&c.setAttribute(b,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();v in t&&c.classList.toggle(b,!!t[v])}}return e}function ge(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)P(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 U(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 r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let l=0;l<c.length;l++){const d=c[l];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const d=e.children[l],m=d.getAttribute("data-ln-render-key");m&&(i[m]=d)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const d=t[l],m=String(r(d));let b=i[m];if(b)o(b,d,l);else{const v=j(n,s);if(!v||(U(v,d),b=v.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",m),o(b,d,l)}c.appendChild(b)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=P,window.lnCore.lnFill=ge,window.lnCore.renderList=Ce);function D(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function W(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(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 V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,o),o}function z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function G(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function ye(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=Q(r.values,r.fallback);break;case"integer":o=W;break;case"float":o=z;break;case"boolean":o=K;break;case"list":o=V;break;case"json":o=J;break;case"string":default:o=D;break}o||(o=D),t[r.prop]=[o,n,r.fallback]}return t}function ve(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_e,window.lnCore.attrSpec=ye,window.lnCore.attrStr=D,window.lnCore.attrInt=W,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=z,window.lnCore.attrJson=J);function B(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function X(){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 Se(e){const t=X(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Le(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=X(),o=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)G(s[c].spec,i,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&&Y(s,t,n,e.oldValue),r.reactiveWildcard.length&&Y(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(B(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ee(e){const t=Z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const 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];B(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let l=0;l<c.length;l++){const d=c[l];if(!document.contains(d)){const m=d[s.attribute];if(m&&typeof m.destroy=="function")try{m.destroy()}catch(b){console.error("["+s.attribute+"] destroy failed",d,b)}delete d[s.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ee(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ee(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,d=o.onAttrChange||null,m=o.effects||null,b=o.attributes||null,v=b?ve(b):m,F=b?new Set(Object.keys(b)):null,E=o.persist||null;function k(h){const g=h||document.body;if(B(g,e,t,n),b&&R())for(const p in b){const _=b[p],w=Array.from(g.querySelectorAll("["+p+"]"));g.matches&&g.matches("["+p+"]")&&w.push(g);for(let C=0;C<w.length;C++){const x=w[C];N(x)&&G(_,x.getAttribute(p),p,r,x)}}l&&l(g)}const S=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let g;for(;(g=h.exec(e))!==null;)S.push(g[1])}else S.push(e);Se({selector:e,attribute:t,componentTag:r,attributes:b,ComponentFn:n,onInit:l,observed:S.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:F,persist:E}),Te();const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=o.subtreeQuery||(a?e:"["+e+"]");Z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:u}),Oe(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee);function f(){Ae()>0?ke(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),k}function te(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},r=te(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(d)}catch{n[l]=d}}return n}function Ne(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Me(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");te(location.hash)!==o&&(location.hash=o)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const 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=q,window.lnCore.hashGet=Ne,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Re);function He(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=He),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},r={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function l(a){return!!(o[a]||s[a]||i[a]||a==="link")}function d(a){this.dom=a;const u=this;if(this._textarea=a.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",a),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const w=a.querySelector('label[for="'+h+'"]');w&&(w.id||(w.id=h+"-label"),this._surface.setAttribute("aria-labelledby",w.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const g=this._textarea.value.trim();g&&(this._surface.innerHTML=g);const p=a.querySelector('[role="toolbar"]');if(p&&p.nextSibling?a.insertBefore(this._surface,p.nextSibling):a.appendChild(this._surface),p){p.setAttribute("aria-controls",this._surface.id);const w=p.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<w.length;C++){const x=w[C].getAttribute("data-ln-editor-action");l(x)&&w[C].setAttribute("aria-pressed","false")}}this._onInput=function(){u._syncToTextarea(),A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom})},this._onMousedownToolbar=function(w){w.target.closest("[data-ln-editor-action]")&&w.preventDefault()},this._onClickToolbar=function(w){const C=w.target.closest("[data-ln-editor-action]");if(!C)return;const x=C.getAttribute("data-ln-editor-action");u._execAction(x)},this._onPaste=function(w){v(u,w)},this._onKeydown=function(w){k(u,w)},this._onSelectionChange=function(){document.contains(u._surface)&&u._updateActiveStates()},this._onFocus=function(){A(u.dom,"ln-editor:focus",{target:u.dom})},this._onBlur=function(){u._syncToTextarea(),A(u.dom,"ln-editor:blur",{target:u.dom})},this._onTextareaInput=function(){u._surface.innerHTML!==u._textarea.value&&(u._surface.innerHTML=u._textarea.value,A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),p&&(p.addEventListener("mousedown",this._onMousedownToolbar),p.addEventListener("click",this._onClickToolbar)),document.addEventListener("selectionchange",this._onSelectionChange),this._onSetContent=function(w){const C=w.detail&&w.detail.html;C!==void 0&&(u._surface.innerHTML=C,u._syncToTextarea(),A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},a.addEventListener("ln-editor:set-content",this._onSetContent);const _=this._textarea.form;return _&&(this._onFormReset=function(){setTimeout(function(){u._surface.innerHTML=u._textarea.value,A(a,"ln-editor:changed",{html:u._textarea.value,target:a})},0)},_.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(a){if(!(!a||se(this.dom,"ln-editor:before-change",{action:a,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[a])document.execCommand(o[a],!1,null);else if(s[a]){const f=s[a],h=m(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[a]?document.execCommand(i[a],!1,null):a==="link"?S(this):a==="unlink"?document.execCommand("unlink",!1,null):a==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const a=this.dom.querySelector('[role="toolbar"]');if(!a)return;const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=u.anchorNode;if(!f||!this._surface.contains(f))return;const h=a.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<h.length;g++){const p=h[g],_=p.getAttribute("data-ln-editor-action");let w=!1;if(o[_])try{w=document.queryCommandState(o[_])}catch{}else if(s[_]){const C=m(this._surface);w=C&&C.toLowerCase()===s[_]}else if(i[_])try{w=document.queryCommandState(i[_])}catch{}else _==="link"&&(w=!!b(u.anchorNode,"A",this._surface));l(_)&&p.setAttribute("aria-pressed",String(w)),w?p.classList.add("ln-editor-active"):p.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(a){this._surface&&(this._surface.innerHTML=a,this._syncToTextarea(),A(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const a=this.dom.querySelector('[role="toolbar"]');a&&(a.removeEventListener("mousedown",this._onMousedownToolbar),a.removeEventListener("click",this._onClickToolbar)),document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const u=this._textarea?this._textarea.form:null;if(u&&this._onFormReset&&u.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function m(a){const u=window.getSelection();if(!u||u.rangeCount===0)return null;let f=u.anchorNode;if(!f)return null;for(;f&&f!==a;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function b(a,u,f){for(;a&&a!==f;){if(a.nodeType===1&&a.tagName===u)return a;a=a.parentNode}return null}function v(a,u){u.preventDefault();let f="";if(u.clipboardData&&(f=u.clipboardData.getData("text/html"),!f)){const g=u.clipboardData.getData("text/plain");g&&(f=g.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=F(f);h&&document.execCommand("insertHTML",!1,h)}function F(a){const u=document.createElement("div");return u.innerHTML=a,E(u),u.innerHTML}function E(a){const u=Array.from(a.childNodes);for(let f=0;f<u.length;f++){const h=u[f];if(h.nodeType!==3){if(h.nodeType!==1){a.removeChild(h);continue}if(r[h.tagName]){const g=Array.from(h.attributes);for(let p=0;p<g.length;p++){const _=g[p].name;if(h.tagName==="A"&&_==="href"){const w=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(w)||h.removeAttribute("href")}else h.removeAttribute(_)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),E(h)}else{for(;h.firstChild;)a.insertBefore(h.firstChild,h);a.removeChild(h)}}}}function k(a,u){if(!(u.ctrlKey||u.metaKey))return;let f=null;switch(u.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(u.preventDefault(),a._execAction(f))}function S(a){const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=b(u.anchorNode,"A",a._surface),h=u.getRangeAt(0).cloneRange();a._closeLinkPopover&&a._closeLinkPopover();const g=me(a.dom,"ln-editor-link-popover","ln-editor");if(!g)return;const p=g.firstElementChild;if(!p)return;const _=p.querySelector('input[type="url"]'),w=p.querySelector('[data-ln-editor-action="confirm-link"]'),C=p.querySelector('[data-ln-editor-action="cancel-link"]');f&&(_.value=f.getAttribute("href")||"");const x=a.dom.querySelector('[role="toolbar"]');x?x.after(p):a.dom.insertBefore(p,a._surface),_.focus();function ne(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function O(){document.removeEventListener("mousedown",ie),a._closeLinkPopover=null,p.remove()}function re(){const y=_.value.trim();if(O(),ne(),a._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),a._syncToTextarea(),A(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom});else{document.execCommand("createLink",!1,y);const L=window.getSelection();if(L&&L.anchorNode){const le=b(L.anchorNode,"A",a._surface);le&&(le.setAttribute("rel","noopener noreferrer"),a._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function oe(){O(),ne(),a._surface.focus()}function $e(){O()}function ie(y){const L=a.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!p.contains(y.target)&&!L&&$e()}a._closeLinkPopover=O,w.addEventListener("click",re),C.addEventListener("click",oe),_.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),re()):y.key==="Escape"&&(y.preventDefault(),oe())}),document.addEventListener("mousedown",ie)}ee(e,t,d,"ln-editor",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(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 n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){o=t[n];break}if(!q(o))return}e.apply(console,t)}}function x(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function ue(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(n),n}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const i=!!(t&&t.typed),o=t&&t.exclude,n={},c=e.elements,l={};if(i)for(let s=0;s<c.length;s++){const r=c[s];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<c.length;s++){const r=c[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")i&&l[r.name]===1?n[r.name]=r.checked:(n[r.name]||(n[r.name]=[]),r.checked&&n[r.name].push(r.value));else if(r.type==="radio")r.checked&&(n[r.name]=r.value);else if(r.type==="select-multiple"){n[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&n[r.name].push(r.options[d].value)}else if(i&&r.type==="hidden")n[r.name]=r.value;else if(i&&(r.type==="number"||r.type==="range")){const d=Number(r.value);n[r.name]=r.value===""||isNaN(d)?null:d}else n[r.name]=r.value}return n}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const i=e.elements,o=[],n={};for(let c=0;c<i.length;c++){const l=i[c];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let c=0;c<i.length;c++){const l=i[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const r=t[s];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(n[l.name]>1){const d=String(r).split(",").map(function(b){return b.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=he(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 d=0;d<l.options.length;d++)l.options[d].selected=r.indexOf(l.options[d].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=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const j={};function pe(e,t){j[e]=t}function be(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function ge(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];P[i]=t}function _e(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ge,window.lnCore.getLocaleFallback=_e,window.lnCore.ensureLocaleObserver=me);const N={};function U(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=N[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Ce(e,t,i){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return U(t,i)}function W(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const s=i[l],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],r=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const b=r[d].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),v=b[1].trim();t[v]!=null&&s.setAttribute(_,t[v])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const s=n[l],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],r=s.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const b=r[d].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),v=b[1].trim();v in t&&s.classList.toggle(_,!!t[v])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<i.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[o],t??null),i[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)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function K(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const c=i.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let c=0;c<n.length;c++){const l=n[c],s=l.attributes;for(let r=0;r<s.length;r++){const d=s[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ve(e,t,i,o,n,c){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],b=d.getAttribute("data-ln-render-key");b&&(l[b]=d)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],b=String(o(d));let _=l[b];if(_)n(_,d,r);else{const v=U(i,c);if(!v||(K(v,d),_=v.firstElementChild,!_))continue;_.setAttribute("data-ln-render-key",b),n(_,d,r)}s.appendChild(_)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=W,window.lnCore.lnFill=ye,window.lnCore.renderList=ve);function M(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function V(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function Q(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const n=o.trim().toLowerCase();return!(n==="false"||n==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const I=new Map;function J(e,t){const i=(e?e.join("|"):"")+"::"+t;if(I.has(i))return I.get(i);const o=new Set(e||[]),n=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return I.set(i,n),n}function G(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function X(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function Y(e,t,i,o,n){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=r=>{n?console.warn(r,n):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${i}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${c}] Value ${r} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${c}] Value ${r} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${c}] Invalid JSON for attribute "${i}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ae(e,t,i){for(const o in i){const[n,c,l]=i[o];Object.defineProperty(e,o,{get:function(){return n(t,c,l)},enumerable:!0,configurable:!0})}return e}function xe(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let n=o.read;if(!n&&o.type)switch(o.type){case"enum":n=J(o.values,o.fallback);break;case"integer":n=V;break;case"float":n=G;break;case"boolean":n=Q;break;case"list":n=z;break;case"json":n=X;break;case"string":default:n=M;break}n||(n=M),t[o.prop]=[n,i,o.fallback]}return t}function Se(e){const t={};for(const i in e){const o=e[i];o&&o.effect&&(t[i]=o.effect)}return Object.keys(t).length?t:null}function ke(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ae,window.lnCore.attrSpec=xe,window.lnCore.attrStr=M,window.lnCore.attrInt=V,window.lnCore.attrBool=Q,window.lnCore.attrList=z,window.lnCore.attrEnum=J,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function k(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function Z(e,t,i,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(c)&&k(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let r=0;r<s.length;r++)k(s[r],l)}}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 Te(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 Ee(e){const t=ee(),i=e.observed||[];for(let o=0;o<i.length;o++){const n=i[o];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).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 n=t.byDeclaredAttr.get(o);n.some(c=>c.componentTag===e.componentTag)||n.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ke(e);if(o===null)t.reactiveWildcard.push(e);else for(const n of o)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function te(e,t,i,o){for(let n=0;n<e.length;n++){const c=e[n];if(!t[c.attribute])continue;const l=c.effects&&c.effects[i];l?l(t,i,o):c.onAttrChange&&(!c.declared||c.declared.has(i))&&c.onAttrChange(t,i,o)}}function Oe(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=ee(),n=o.byAttr.get(t),c=$()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!n&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&q(l)){const s=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<s.length;d++)Y(s[d].spec,r,t,s[d].componentTag,l)}if(window.lnCore._debugSink&&(i||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const s=o.byReactive.get(t);s&&te(s,l,t,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,l,t,e.oldValue)}if(n)for(let s=0;s<n.length;s++){const r=n[s];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(Z(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{Oe(t[i])}catch(o){console.error("[ln-core] mutation handler failed",t[i].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function qe(e){const t=B();if(!t.length)return;const i=e.target;if(i){const o=i.nodeType===1?i:i.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const c=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&n.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)n.matches&&n.matches(s.query)&&k(n,s);else if(n.matches&&n.matches(s.query)&&k(n,s),n.querySelectorAll){const r=n.querySelectorAll(s.query);for(let d=0;d<r.length;d++)k(r[d],s)}}s.onInit&&s.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const s=t[l],r=s.query;if(r){if(!c)n.matches&&n.matches(r)&&F(n,s);else if(n.matches&&n.matches(r)&&F(n,s),n.querySelectorAll){const d=n.querySelectorAll(r);for(let b=0;b<d.length;b++)F(d[b],s)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{qe(o)}catch(n){console.error("[ln-core] lifecycle handler failed",o.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){B().push(e),ne()}function re(e,t,i,o,n={}){const c=n.extraAttributes||[],l=n.onAttributeChange||null,s=n.onSubtreeChange||null,r=n.onInit||null,d=n.onAttrChange||null,b=n.effects||null,_=n.attributes||null,v=_?Se(_):b,H=_?new Set(Object.keys(_)):null,O=n.persist||null;function S(h){const m=h||document.body;if(Z(m,e,t,i),_&&$())for(const w in _){const C=_[w],p=Array.from(m.querySelectorAll("["+w+"]"));m.matches&&m.matches("["+w+"]")&&p.push(m);for(let g=0;g<p.length;g++){const A=p[g];q(A)&&Y(C,A.getAttribute(w),w,o,A)}}r&&r(m)}const L=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let m;for(;(m=h.exec(e))!==null;)L.push(m[1])}else L.push(e);Ee({selector:e,attribute:t,componentTag:o,attributes:_,ComponentFn:i,onInit:r,observed:L.concat(c),onAttributeChange:l,onAttrChange:d,effects:v,declared:H,persist:O}),De();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=n.subtreeQuery||(u?e:"["+e+"]");B().push({selector:e,attribute:t,ComponentFn:i,onInit:r,onSubtreeChange:s,query:a}),ne(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=Ne);function f(){Le()>0?Te(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),S}function oe(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,i={},o=oe(t);if(!o)return i;const n=o.split("&");for(let c=0;c<n.length;c++){const l=n[c];if(!l)continue;const s=l.indexOf(":"),r=s>-1?l.slice(0,s):l,d=s>-1?l.slice(s+1):"";if(r)try{i[r]=decodeURIComponent(d)}catch{i[r]=d}}return i}function Me(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const i=R();t==null?delete i[e]:i[e]=String(t);const n=Object.keys(i).map(function(c){const l=i[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");oe(location.hash)!==n&&(location.hash=n)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Fe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.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 Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(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 je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),o=e.slice(t+1),n=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:i,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=Me,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=He,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=je);function Pe(){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=Pe),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const i={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},o={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},n={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},c={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let s=0;function r(u){return!!(n[u]||c[u]||l[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const p=u.querySelector('label[for="'+h+'"]');p&&(p.id||(p.id=h+"-label"),this._surface.setAttribute("aria-labelledby",p.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++s;const m=this._textarea.value.trim();m&&(this._surface.innerHTML=m);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const p=w.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<p.length;g++){const A=p[g].getAttribute("data-ln-editor-action");r(A)&&p[g].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const g=p.target.closest("[data-ln-editor-action]");if(!g)return;const A=g.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(p){v(a,p)},this._onKeydown=function(p){S(a,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(p){const g=p.detail&&p.detail.html;g!==void 0&&(a._surface.innerHTML=g,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const C=this._textarea.form;return C&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},C.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||ue(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),n[u])document.execCommand(n[u],!1,null);else if(c[u]){const f=c[u],h=b(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else l[u]?document.execCommand(l[u],!1,null):u==="link"?L(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let m=0;m<h.length;m++){const w=h[m],C=w.getAttribute("data-ln-editor-action");let p=!1;if(n[C])try{p=document.queryCommandState(n[C])}catch{}else if(c[C]){const g=b(this._surface);p=g&&g.toLowerCase()===c[C]}else if(l[C])try{p=document.queryCommandState(l[C])}catch{}else C==="link"&&(p=!!_(a.anchorNode,"A",this._surface));if(r(C)){const g=String(p);w.getAttribute("aria-pressed")!==g&&w.setAttribute("aria-pressed",g)}p?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function b(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function _(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const m=a.clipboardData.getData("text/plain");m&&(f=m.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=H(f);h&&document.execCommand("insertHTML",!1,h)}function H(u){const a=document.createElement("div");return a.innerHTML=u,O(a),a.innerHTML}function O(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(o[h.tagName]){const m=Array.from(h.attributes);for(let w=0;w<m.length;w++){const C=m[w].name;if(h.tagName==="A"&&C==="href"){const p=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(p)||h.removeAttribute("href")}else h.removeAttribute(C)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),O(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function L(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=_(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const m=Ce(u.dom,"ln-editor-link-popover","ln-editor");if(!m)return;const w=m.firstElementChild;if(!w)return;const C=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),g=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(C.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),C.focus();function ie(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function D(){document.removeEventListener("mousedown",ae),u._closeLinkPopover=null,w.remove()}function le(){const y=C.value.trim();if(D(),ie(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ce=_(T.anchorNode,"A",u._surface);ce&&(ce.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function se(){D(),ie(),u._surface.focus()}function Ue(){D()}function ae(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&Ue()}u._closeLinkPopover=D,p.addEventListener("click",le),g.addEventListener("click",se),C.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),le()):y.key==="Escape"&&(y.preventDefault(),se())}),document.addEventListener("mousedown",ae)}re(e,t,d,"ln-editor",{attributes:i})})()})();
|
|
@@ -148,20 +148,44 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
148
148
|
_handleKeydown(self, e);
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
this._listeningSelection = false;
|
|
152
|
+
this._rafSelection = null;
|
|
153
|
+
|
|
151
154
|
this._onSelectionChange = function () {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
if (self._rafSelection) return;
|
|
156
|
+
self._rafSelection = requestAnimationFrame(function () {
|
|
157
|
+
self._rafSelection = null;
|
|
158
|
+
if (!document.contains(self._surface)) return;
|
|
159
|
+
self._updateActiveStates();
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
this._attachSelection = function () {
|
|
164
|
+
if (!self._listeningSelection) {
|
|
165
|
+
self._listeningSelection = true;
|
|
166
|
+
document.addEventListener('selectionchange', self._onSelectionChange);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this._detachSelection = function () {
|
|
171
|
+
if (self._listeningSelection) {
|
|
172
|
+
self._listeningSelection = false;
|
|
173
|
+
document.removeEventListener('selectionchange', self._onSelectionChange);
|
|
174
|
+
}
|
|
175
|
+
if (self._rafSelection) {
|
|
176
|
+
cancelAnimationFrame(self._rafSelection);
|
|
177
|
+
self._rafSelection = null;
|
|
178
|
+
}
|
|
158
179
|
};
|
|
159
180
|
|
|
160
181
|
this._onFocus = function () {
|
|
182
|
+
self._attachSelection();
|
|
183
|
+
self._updateActiveStates();
|
|
161
184
|
dispatch(self.dom, 'ln-editor:focus', { target: self.dom });
|
|
162
185
|
};
|
|
163
186
|
|
|
164
187
|
this._onBlur = function () {
|
|
188
|
+
self._detachSelection();
|
|
165
189
|
// Sync on blur to ensure textarea is up-to-date
|
|
166
190
|
self._syncToTextarea();
|
|
167
191
|
dispatch(self.dom, 'ln-editor:blur', { target: self.dom });
|
|
@@ -190,8 +214,6 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
190
214
|
toolbar.addEventListener('click', this._onClickToolbar);
|
|
191
215
|
}
|
|
192
216
|
|
|
193
|
-
document.addEventListener('selectionchange', this._onSelectionChange);
|
|
194
|
-
|
|
195
217
|
// Request event — set content programmatically
|
|
196
218
|
this._onSetContent = function (e) {
|
|
197
219
|
const html = e.detail && e.detail.html;
|
|
@@ -310,12 +332,19 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
310
332
|
}
|
|
311
333
|
|
|
312
334
|
if (_isToggleAction(action)) {
|
|
313
|
-
|
|
335
|
+
const pressedStr = String(isActive);
|
|
336
|
+
if (btn.getAttribute('aria-pressed') !== pressedStr) {
|
|
337
|
+
btn.setAttribute('aria-pressed', pressedStr);
|
|
338
|
+
}
|
|
314
339
|
}
|
|
315
340
|
if (isActive) {
|
|
316
|
-
btn.classList.
|
|
341
|
+
if (!btn.classList.contains('ln-editor-active')) {
|
|
342
|
+
btn.classList.add('ln-editor-active');
|
|
343
|
+
}
|
|
317
344
|
} else {
|
|
318
|
-
btn.classList.
|
|
345
|
+
if (btn.classList.contains('ln-editor-active')) {
|
|
346
|
+
btn.classList.remove('ln-editor-active');
|
|
347
|
+
}
|
|
319
348
|
}
|
|
320
349
|
}
|
|
321
350
|
};
|
|
@@ -354,7 +383,11 @@ import { dispatch, dispatchCancelable, registerComponent, cloneTemplateScoped }
|
|
|
354
383
|
toolbar.removeEventListener('click', this._onClickToolbar);
|
|
355
384
|
}
|
|
356
385
|
|
|
357
|
-
|
|
386
|
+
if (this._detachSelection) {
|
|
387
|
+
this._detachSelection();
|
|
388
|
+
} else {
|
|
389
|
+
document.removeEventListener('selectionchange', this._onSelectionChange);
|
|
390
|
+
}
|
|
358
391
|
this.dom.removeEventListener('ln-editor:set-content', this._onSetContent);
|
|
359
392
|
|
|
360
393
|
const form = this._textarea ? this._textarea.form : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function I(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!C(i))return}e.apply(console,t)}}function p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function N(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function T(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,o={};if(r)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function M(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function B(e,t){const r=e.elements,i=[],l={};for(let a=0;a<r.length;a++){const o=r[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<r.length;a++){const o=r[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=M(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=B,window.lnCore.serializeForm=T,window.lnCore.resolveFormMethod=N);const y={};function R(e,t){y[e]=t}function j(e){return y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=j);function q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const x={};function W(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];x[r]=t}function V(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return x[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=W,window.lnCore.getLocaleFallback=V,window.lnCore.ensureLocaleObserver=q);const b={};function U(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function A(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[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 o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[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 H(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)A(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function k(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const a=r.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function J(e,t,r,i,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(i(c));let d=o[u];if(d)l(d,c,n);else{const f=U(r,a);if(!f||(k(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=k,window.lnCore.fill=A,window.lnCore.lnFill=H,window.lnCore.renderList=J);function h(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function v(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function _(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function S(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function L(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function O(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function $(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function K(e,t,r,i,l){if(!e||t===null)return!0;const a=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function z(e,t,r){for(const i in r){const[l,a,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=L(i.values,i.fallback);break;case"integer":l=v;break;case"float":l=O;break;case"boolean":l=_;break;case"list":l=S;break;case"json":l=$;break;case"string":default:l=h;break}l||(l=h),t[i.prop]=[l,r,i.fallback]}return t}function P(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=z,window.lnCore.attrSpec=G,window.lnCore.attrStr=h,window.lnCore.attrInt=v,window.lnCore.attrBool=_,window.lnCore.attrList=S,window.lnCore.attrEnum=L,window.lnCore.attrFloat=O,window.lnCore.attrJson=$);function Q(e,t,r,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&o.push(e);for(const s of o)if(!s[r]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[r]=new i(s)}catch(n){console.error("["+r+"] init failed",s,n)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function E(){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 X(e){const t=E(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=P(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function D(e,t,r,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[r];o?o(t,r,i):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,i)}}function Y(e){const t=e.target,r=e.attributeName;if(e.oldValue===t.getAttribute(r))return;const i=E(),l=i.byAttr.get(r);if(I()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(r)&&C(t)){const a=i.byDeclaredAttr.get(r),o=t.getAttribute(r);for(let s=0;s<a.length;s++)K(a[s].spec,o,r,a[s].componentTag,t)}if(window.lnCore._debugSink&&(r.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",r,t,{oldValue:e.oldValue,newValue:t.getAttribute(r)}),r.indexOf("data-ln-")===0){const a=i.byReactive.get(r);a&&D(a,t,r,e.oldValue),i.reactiveWildcard.length&&D(i.reactiveWildcard,t,r,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const o=l[a];if(o.handler){o.handler(t,r,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,r):(Q(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Y(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ee(e,t){X({observed:e,handler:t}),Z()}function F(e){return(e||"").replace(/^#/,"")}function g(e){const t=e===void 0?location.hash:e,r={},i=F(t);if(!i)return r;const l=i.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function te(e){if(!e)return null;const t=g();return e in t?t[e]:null}function ne(e,t){if(!e)return;const r=g();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(a){const o=r[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==l&&(location.hash=l)}function re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ie(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 se(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ae(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=g,window.lnCore.hashGet=te,window.lnCore.hashSet=ne,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=oe,window.lnCore.hashSortEncode=ie,window.lnCore.hashSortDecode=le,window.lnCore.hashFilterEncode=se,window.lnCore.hashFilterDecode=ae);function ce(){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=ce),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const c=document.createElement("span");c.className="sr-only",c.textContent="(opens in new tab)",s.appendChild(c),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function a(){w(function(){new MutationObserver(function(n){for(const c of n)if(c.type==="childList"){for(const u of c.addedNodes)if(u.nodeType===1&&(u.matches&&(u.matches("a")||u.matches("area"))&&r(u),u.querySelectorAll))for(const d of u.querySelectorAll("a, area"))r(d)}}).observe(document.body,{childList:!0,subtree:!0}),ee(["href"],function(n){n.matches&&(n.matches("a")||n.matches("area"))&&r(n)})},"ln-external-links")}function o(){l(),a(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
|
|
1
|
+
(function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let 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 p(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function R(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function j(e,t){const r=e.elements,o=[],i={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=R(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=j,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function W(e,t){x[e]=t}function V(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=W,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function H(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function J(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=J,window.lnCore.ensureLocaleObserver=U);const b={};function K(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 z(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],s=l.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function G(e,t,r,o,i,c){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(o(a));let d=l[u];if(d)i(d,a,n);else{const f=K(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=z,window.lnCore.renderList=G);function g(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function S(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function L(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const o=new Set(e||[]),i=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return m.set(r,i),i}function D(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function F(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function P(e,t,r,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,r){for(const o in r){const[i,c,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=O(o.values,o.fallback);break;case"integer":i=S;break;case"float":i=D;break;case"boolean":i=L;break;case"list":i=E;break;case"json":i=F;break;case"string":default:i=g;break}i||(i=g),t[o.prop]=[i,r,o.fallback]}return t}function Y(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=X,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Z(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&h(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){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=$(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[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(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Y(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 q(e,t,r,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function te(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=$(),i=o.byAttr.get(t),c=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&A(l)){const s=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<s.length;a++)P(s[a].spec,n,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&q(s,l,t,e.oldValue),o.reactiveWildcard.length&&q(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(Z(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{te(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function re(e){const t=I();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const i=t[o];if(i.onSubtreeChange&&i.query){const c=i.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;l&&i.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)i.matches&&i.matches(s.query)&&h(i,s);else if(i.matches&&i.matches(s.query)&&h(i,s),i.querySelectorAll){const n=i.querySelectorAll(s.query);for(let a=0;a<n.length;a++)h(n[a],s)}}s.onInit&&s.onInit(i)}}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!c)i.matches&&i.matches(n)&&C(i,s);else if(i.matches&&i.matches(n)&&C(i,s),i.querySelectorAll){const a=i.querySelectorAll(n);for(let u=0;u<a.length;u++)C(a[u],s)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{re(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t){ee({observed:e,handler:t}),ne()}function le(e){I().push(e),oe()}function N(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},o=N(t);if(!o)return r;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function se(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ce(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");N(location.hash)!==i&&(location.hash=i)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ue(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function we(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function he(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=se,window.lnCore.hashSet=ce,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ue,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=fe,window.lnCore.hashFilterEncode=we,window.lnCore.hashFilterDecode=he);function pe(){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=pe),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function o(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function i(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){le({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),ie(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function l(){i(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){o()}):o()}window[e]={process:o},l()})()})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatch, guardBody, observeAttributes } from '../../ln-core';
|
|
1
|
+
import { dispatch, guardBody, observeAttributes, observeLifecycle } from '../../ln-core';
|
|
2
2
|
|
|
3
3
|
(function() {
|
|
4
4
|
const DOM_ATTRIBUTE = 'lnExternalLinks';
|
|
@@ -64,31 +64,19 @@ import { dispatch, guardBody, observeAttributes } from '../../ln-core';
|
|
|
64
64
|
|
|
65
65
|
function _domObserver() {
|
|
66
66
|
guardBody(function() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (node.querySelectorAll) {
|
|
77
|
-
for (const link of node.querySelectorAll('a, area')) {
|
|
78
|
-
_processLink(link);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
67
|
+
observeLifecycle({
|
|
68
|
+
onInit: function (node) {
|
|
69
|
+
if (node.matches && (node.matches('a') || node.matches('area'))) {
|
|
70
|
+
_processLink(node);
|
|
71
|
+
}
|
|
72
|
+
if (node.querySelectorAll) {
|
|
73
|
+
for (const link of node.querySelectorAll('a, area')) {
|
|
74
|
+
_processLink(link);
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
77
|
}
|
|
85
78
|
});
|
|
86
79
|
|
|
87
|
-
observer.observe(document.body, {
|
|
88
|
-
childList: true,
|
|
89
|
-
subtree: true
|
|
90
|
-
});
|
|
91
|
-
|
|
92
80
|
observeAttributes(['href'], function (el) {
|
|
93
81
|
if (el.matches && (el.matches('a') || el.matches('area'))) {
|
|
94
82
|
_processLink(el);
|