@livenetworks/ashlar 2.1.10 → 2.1.12
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/COMPONENTS.md +1 -1
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.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/events.js +5 -2
- package/components/ln-core/lifecycle.js +25 -44
- 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/README.md +19 -0
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/ln-data-store.schema.json +92 -84
- package/components/ln-data-store/src/data-store-model.js +17 -0
- package/components/ln-data-store/src/ln-data-store.js +77 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/debug-verifier.js +24 -30
- package/components/ln-debug/src/generated-attributes.js +1 -3
- package/components/ln-debug/src/ln-debug.js +3 -11
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-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-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-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-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/README.md +69 -38
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +11 -35
- package/components/ln-table/src/ln-table.js +306 -414
- package/components/ln-table/src/table-model.js +31 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +7 -17
- package/package.json +1 -1
- package/theme/config/mixins/_ln-table.scss +18 -10
- package/theme/config/mixins/_table.scss +15 -2
- package/web-types.json +14 -28
package/components/COMPONENTS.md
CHANGED
|
@@ -1000,7 +1000,7 @@ The component calls `_ensureDefaultItemTemplate()` at the top of `_initUpload()`
|
|
|
1000
1000
|
| ln-search | Instance | `data-ln-search` | Generic search (textContent filter) |
|
|
1001
1001
|
| ln-filter | Instance | `data-ln-filter` | Generic filter (data attribute filter) |
|
|
1002
1002
|
| ln-sort | Instance | `data-ln-sort` | Sort control primitive — 3-trigger cycle (none→asc→desc→none), search-precedent cancelable event; targets ln-table, ln-list, or plain lists |
|
|
1003
|
-
| ln-table | Instance | `data-ln-table` | Data table (search, filter, sort,
|
|
1003
|
+
| ln-table | Instance | `data-ln-table` | Data table (search, filter, sort, and viewport row virtualization) |
|
|
1004
1004
|
| ln-chart | Instance | `data-ln-chart` | SVG line/area dataset renderer with `ln-data-coordinator` binding |
|
|
1005
1005
|
| ln-sortable | Instance | `data-ln-sortable` | Drag & drop reorder |
|
|
1006
1006
|
| ln-picklist | Instance | `data-ln-picklist` | Two-list checkbox selection |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!y(o))return}e.apply(console,t)}}function I(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&i[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);i[r.name]=r.value===""||isNaN(u)?null:u}else i[r.name]=r.value}return i}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(r).split(",").map(function(a){return a.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ne(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 u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].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=re,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const F={};function oe(e,t){F[e]=t}function ie(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=se,window.lnCore.getLocaleFallback=ce,window.lnCore.ensureLocaleObserver=le);const C={};function ue(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const a=r[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const a=r[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function de(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],a=String(o(u));let d=l[a];if(d)i(d,u,r);else{const f=ue(n,s);if(!f||($(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),i(d,u,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=R,window.lnCore.lnFill=ae,window.lnCore.renderList=de);function m(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function N(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function M(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return A.set(n,i),i}function U(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function V(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function fe(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function we(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=j(o.values,o.fallback);break;case"integer":i=N;break;case"float":i=U;break;case"boolean":i=M;break;case"list":i=B;break;case"json":i=W;break;case"string":default:i=m;break}i||(i=m),t[o.prop]=[i,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=fe,window.lnCore.attrSpec=we,window.lnCore.attrStr=m,window.lnCore.attrInt=N,window.lnCore.attrBool=M,window.lnCore.attrList=B,window.lnCore.attrEnum=j,window.lnCore.attrFloat=U,window.lnCore.attrJson=W);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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function H(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&h(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)h(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=Q(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=be(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 J(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ce(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=Q(),i=o.byAttr.get(t),s=D()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&J(c,l,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(H(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ce(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function x(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function K(e){const t=_();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=x();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&h(s,r);else if(s.matches&&s.matches(r.query)&&h(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let a=0;a<u.length;a++)h(u[a],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&S(s,r);else if(s.matches&&s.matches(u)&&S(s,r),s.querySelectorAll){const a=s.querySelectorAll(u);for(let d=0;d<a.length;d++)S(a[d],r)}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{K(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{K(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&x().push(e),P()}function G(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,u=i.onAttrChange||null,a=i.effects||null,d=i.attributes||null,f=d?he(d):a,Ue=d?new Set(Object.keys(d)):null,We=i.persist||null;function g(O){const w=O||document.body;if(H(w,e,t,n),d&&D())for(const b in d){const He=d[b],E=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&E.push(w);for(let L=0;L<E.length;L++){const q=E[L];y(q)&&V(He,q.getAttribute(b),b,o,q)}}r&&r(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);ye({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:k.concat(s),onAttributeChange:l,onAttrChange:u,effects:f,declared:Ue,persist:We}),me();const Ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,X=i.subtreeQuery||(Ve?e:"["+e+"]"),Y={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:X};_().push(Y),c&&X&&x().push(Y),P(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=_e,window.lnCore.withoutLifecycle=Ae);function Z(){pe()>0?ge(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),g}function z(e){return(e||"").replace(/^#/,"")}function v(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function xe(e){if(!e)return null;const t=v();return e in t?t[e]:null}function Se(e,t){if(!e)return;const n=v();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");z(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=v,window.lnCore.hashGet=xe,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=qe);function De(e){return(e||"").replace(/^\?/,"")}function Ie(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=De(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Fe(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Te(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ne(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Me(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Be(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ie,window.lnCore.queryGet=Fe,window.lnCore.querySet=Te,window.lnCore.resolveQueryParam=Re,window.lnCore.querySortEncode=$e,window.lnCore.querySortDecode=Ne,window.lnCore.queryFilterEncode=Me,window.lnCore.queryFilterDecode=Be);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je),(function(){const e="data-ln-accordion",t="lnAccordion";if(window[t]!==void 0)return;const n={"data-ln-accordion":{type:"marker",description:"Identifies container as an accordion that coordinates single-panel expansion"}};function o(i){return this.dom=i,this._onToggleOpen=function(s){if(!s.detail||!s.detail.target||s.detail.target.closest("[data-ln-accordion]")!==i)return;const l=i.querySelectorAll("[data-ln-toggle]");for(const c of l)c!==s.detail.target&&c.closest("[data-ln-accordion]")===i&&c.getAttribute("data-ln-toggle")==="open"&&c.setAttribute("data-ln-toggle","close");I(i,"ln-accordion:change",{target:s.detail.target})},i.addEventListener("ln-toggle:open",this._onToggleOpen),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:open",this._onToggleOpen),delete this.dom[t])},G(e,t,o,"ln-accordion",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function q(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!C(o))return}e.apply(console,t)}}function D(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&i[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);i[r.name]=r.value===""||isNaN(u)?null:u}else i[r.name]=r.value}return i}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const u=String(r).split(",").map(function(d){return d.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ne(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 u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].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=re,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const I={};function oe(e,t){I[e]=t}function ie(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function ce(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=se,window.lnCore.getLocaleFallback=ce,window.lnCore.ensureLocaleObserver=le);const y={};function ue(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const d=r[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const d=r[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)T(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function de(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],d=String(o(u));let a=l[d];if(a)i(a,u,r);else{const f=ue(n,s);if(!f||(R(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),i(a,u,r)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=T,window.lnCore.lnFill=ae,window.lnCore.renderList=de);function m(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function $(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function N(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return A.set(n,i),i}function j(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function U(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function W(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function fe(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function we(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=B(o.values,o.fallback);break;case"integer":i=$;break;case"float":i=j;break;case"boolean":i=N;break;case"list":i=M;break;case"json":i=U;break;case"string":default:i=m;break}i||(i=m),t[o.prop]=[i,n,o.fallback]}return t}function he(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=fe,window.lnCore.attrSpec=we,window.lnCore.attrStr=m,window.lnCore.attrInt=$,window.lnCore.attrBool=N,window.lnCore.attrList=M,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=U);function p(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function V(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&p(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)p(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function H(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=H(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=be(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,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ye(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=H(),i=o.byAttr.get(t),s=q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&C(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)W(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&Q(c,l,t,e.oldValue),o.reactiveWildcard.length&&Q(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(V(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ye(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function x(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function J(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function K(e){const t=_();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=x();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u&&(s.matches&&s.matches(u)&&(r.ComponentFn&&p(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const d=s.querySelectorAll(u);for(let a=0;a<d.length;a++)r.ComponentFn&&p(d[a],r),r.onInit&&r.onInit(d[a])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u&&(s.matches&&s.matches(u)&&J(s,r),l&&s.querySelectorAll)){const d=s.querySelectorAll(u);for(let a=0;a<d.length;a++)J(d[a],r)}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{K(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{K(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&x().push(e),P()}function G(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,u=i.onAttrChange||null,d=i.effects||null,a=i.attributes||null,f=a?he(a):d,Ue=a?new Set(Object.keys(a)):null,We=i.persist||null;function g(k){const w=k||document.body;if(V(w,e,t,n),a&&q())for(const h in a){const He=a[h],E=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&E.push(w);for(let O=0;O<E.length;O++){const L=E[O];C(L)&&W(He,L.getAttribute(h),h,o,L)}}r&&r(w)}const v=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)v.push(w[1])}else v.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:a,ComponentFn:n,onInit:r,observed:v.concat(s),onAttributeChange:l,onAttrChange:u,effects:f,declared:Ue,persist:We}),me();const Ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,X=i.subtreeQuery||(Ve?e:"["+e+"]"),Y={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:X};_().push(Y),c&&X&&x().push(Y),P(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G,window.lnCore.observeLifecycle=_e,window.lnCore.withoutLifecycle=Ae);function Z(){pe()>0?ge(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),g}function z(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function xe(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Se(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");z(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=xe,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=qe);function De(e){return(e||"").replace(/^\?/,"")}function Ie(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=De(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Fe(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Te(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ne(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Me(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Be(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ie,window.lnCore.queryGet=Fe,window.lnCore.querySet=Te,window.lnCore.resolveQueryParam=Re,window.lnCore.querySortEncode=$e,window.lnCore.querySortDecode=Ne,window.lnCore.queryFilterEncode=Me,window.lnCore.queryFilterDecode=Be);function je(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=je),(function(){const e="data-ln-accordion",t="lnAccordion";if(window[t]!==void 0)return;const n={"data-ln-accordion":{type:"marker",description:"Identifies container as an accordion that coordinates single-panel expansion"}};function o(i){return this.dom=i,this._onToggleOpen=function(s){if(!s.detail||!s.detail.target||s.detail.target.closest("[data-ln-accordion]")!==i)return;const l=i.querySelectorAll("[data-ln-toggle]");for(const c of l)c!==s.detail.target&&c.closest("[data-ln-accordion]")===i&&c.getAttribute("data-ln-toggle")==="open"&&c.setAttribute("data-ln-toggle","close");D(i,"ln-accordion:change",{target:s.detail.target})},i.addEventListener("ln-toggle:open",this._onToggleOpen),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-toggle:open",this._onToggleOpen),delete this.dom[t])},G(e,t,o,"ln-accordion",{attributes:n})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function te(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function M(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!M(o))return}e.apply(console,t)}}function y(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function ne(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}function _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&l[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);l[r.name]=r.value===""||isNaN(u)?null:u}else l[r.name]=r.value}return l}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(r).split(",").map(function(w){return w.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=le(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<i.options.length;u++)i.options[u].selected=r.indexOf(i.options[u].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const R={};function ae(e,t){R[e]=t}function ce(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];W[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ue);const O={};function we(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const w=r[u].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),c=w[1].trim();t[c]!=null&&a.setAttribute(b,t[c])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const w=r[u].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),c=w[1].trim();c in t&&a.classList.toggle(b,!!t[c])}}return e}function he(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function B(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let r=0;r<a.length;r++){const u=a[r];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function pe(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const u=e.children[r],w=u.getAttribute("data-ln-render-key");w&&(i[w]=u)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],w=String(o(u));let b=i[w];if(b)l(b,u,r);else{const c=we(n,s);if(!c||(B(c,u),b=c.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",w),l(b,u,r)}a.appendChild(b)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=U,window.lnCore.lnFill=he,window.lnCore.renderList=pe);function D(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function G(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function V(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const F=new Map;function P(e,t){const n=(e?e.join("|"):"")+"::"+t;if(F.has(n))return F.get(n);const o=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&o.has(a)?a:t};return F.set(n,l),l}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function J(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function be(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function me(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=P(o.values,o.fallback);break;case"integer":l=G;break;case"float":l=H;break;case"boolean":l=V;break;case"list":l=K;break;case"json":l=J;break;case"string":default:l=D;break}l||(l=D),t[o.prop]=[l,n,o.fallback]}return t}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ge,window.lnCore.attrSpec=me,window.lnCore.attrStr=D,window.lnCore.attrInt=G,window.lnCore.attrBool=V,window.lnCore.attrList=K,window.lnCore.attrEnum=P,window.lnCore.attrFloat=H,window.lnCore.attrJson=J);function v(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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Ce(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&v(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)v(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);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 Ae(e){const t=Q(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ye(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function X(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=Q(),l=o.byAttr.get(t),s=te()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&M(i)){const a=o.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let u=0;u<a.length;u++)be(a[u].spec,r,t,a[u].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&X(a,i,t,e.oldValue),o.reactiveWildcard.length&&X(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const r=l[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(Ce(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Y(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function I(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=z();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=Y();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&v(s,r);else if(s.matches&&s.matches(r.query)&&v(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let w=0;w<u.length;w++)v(u[w],r)}}r.onInit&&r.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){if(document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],u=r.query;if(u){if(!i)s.matches&&s.matches(u)&&I(s,r);else if(s.matches&&s.matches(u)&&I(s,r),s.querySelectorAll){const w=s.querySelectorAll(u);for(let b=0;b<w.length;b++)I(w[b],r)}}}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Se(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e,t){Ae({observed:e,handler:t}),ke()}function Ee(e){z().push(e),e.onSubtreeChange&&e.query&&Y().push(e),_e()}function Z(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,n={},o=Z(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,u=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Le(e){if(!e)return null;const t=N();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=N();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Le,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Ie);function Ne(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Ne(t);if(!o)return n;const l=new URLSearchParams(o);for(const[s,i]of l.entries())n[s]=i;return n}function Me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Re(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function We(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Ge(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ve(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Me,window.lnCore.querySet=Re,window.lnCore.resolveQueryParam=We,window.lnCore.querySortEncode=Ue,window.lnCore.querySortDecode=Be,window.lnCore.queryFilterEncode=Ge,window.lnCore.queryFilterDecode=Ve);function Ke(){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=Ke),(function(){const e="data-ln-ajax",t="lnAjax",n="data-ln-data-coordinator-scope";if(window[t]!==void 0)return;let o=null;function l(c){if(!c.hasAttribute(e)||c[t])return;c[t]=!0;const f=u(c);s(f.links),i(f.forms)}function s(c){for(const f of c){if(f[t+"Trigger"]||f.hostname&&f.hostname!==window.location.hostname)continue;const d=f.getAttribute("href");if(d&&d.includes("#"))continue;const h=function(A){if(!re(A,f))return;A.preventDefault();const E=f.getAttribute("href");E&&r("GET",E,null,f)};f.addEventListener("click",h),f[t+"Trigger"]=h}}function i(c){for(const f of c){if(f[t+"Trigger"])continue;if(f.hasAttribute(n)){f[t+"ScopeWarned"]||(f[t+"ScopeWarned"]=!0,console.warn("[ln-ajax] Form has data-ln-data-coordinator-scope — the ln-data-coordinator write pipeline takes precedence; skipping ajax interception for this form."));continue}const d=function(h){if(h.defaultPrevented)return;h.preventDefault();const A=f.method.toUpperCase(),E=f.action,q=new FormData(f);for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!0;r(A,E,q,f,function(){for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!1})};f.addEventListener("submit",d),f[t+"Trigger"]=d}}function a(c){if(!c[t])return;const f=u(c);for(const d of f.links)d[t+"Trigger"]&&(d.removeEventListener("click",d[t+"Trigger"]),delete d[t+"Trigger"]);for(const d of f.forms)d[t+"Trigger"]&&(d.removeEventListener("submit",d[t+"Trigger"]),delete d[t+"Trigger"]);delete c[t]}function r(c,f,d,h,A){if(ne(h,"ln-ajax:before-start",{method:c,url:f}).defaultPrevented)return;c==="GET"&&o&&o(),y(h,"ln-ajax:start",{method:c,url:f}),h.classList.add("ln-ajax--loading");const q=document.createElement("span");q.className="ln-ajax-spinner",h.appendChild(q);function x(){h.classList.remove("ln-ajax--loading");const p=h.querySelector(".ln-ajax-spinner");p&&p.remove(),A&&A()}let m=f;const ee=document.querySelector('meta[name="csrf-token"]'),T=ee?ee.getAttribute("content"):null;d instanceof FormData&&T&&d.append("_token",T);const j={method:c,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}};if(T&&(j.headers["X-CSRF-TOKEN"]=T),c==="GET"&&d){const p=new URLSearchParams(d);m=f+(f.includes("?")?"&":"?")+p.toString()}else c!=="GET"&&d&&(j.body=d);let k=null;if(c==="GET"){const p=new AbortController;j.signal=p.signal,k=function(){o=null,p.abort(),x(),y(h,"ln-ajax:aborted",{method:c,url:m})},o=k}fetch(m,j).then(function(p){const $=p.ok,g=p.status;return p.text().then(function(S){let C=null,L=null;if(S&&S.trim())try{C=JSON.parse(S)}catch(Pe){L=Pe}return{ok:$,status:g,data:C,parseError:L}})}).then(function(p){k&&o===k&&(o=null);const $=p.status,g=p.data,S=p.parseError;if(p.ok&&!S){if(g&&g.title&&(document.title=g.title),g&&g.content)for(const C in g.content){const L=document.getElementById(C);L&&(L.innerHTML=g.content[C])}if(h.tagName==="A"){const C=h.getAttribute("href");C&&window.history.pushState({ajax:!0},"",C)}else h.tagName==="FORM"&&h.method.toUpperCase()==="GET"&&window.history.pushState({ajax:!0},"",m);y(h,"ln-ajax:success",{method:c,url:m,data:g})}else y(h,"ln-ajax:error",{method:c,url:m,status:$,data:g,error:S||null});x(),y(h,"ln-ajax:complete",{method:c,url:m})}).catch(function(p){p&&p.name==="AbortError"||(k&&o===k&&(o=null),y(h,"ln-ajax:error",{method:c,url:m,status:0,data:null,error:p}),x(),y(h,"ln-ajax:complete",{method:c,url:m}))})}function u(c){const f={links:[],forms:[]};return c.tagName==="A"&&c.getAttribute(e)!=="false"?f.links.push(c):c.tagName==="FORM"&&c.getAttribute(e)!=="false"?f.forms.push(c):(f.links=Array.from(c.querySelectorAll('a:not([data-ln-ajax="false"])')),f.forms=Array.from(c.querySelectorAll('form:not([data-ln-ajax="false"])'))),f}function w(){_(function(){Ee({onInit:function(c){if(l(c),!c.hasAttribute(e)){for(const d of c.querySelectorAll("["+e+"]"))l(d);const f=c.closest&&c.closest("["+e+"]");if(f&&f.getAttribute(e)!=="false"){const d=u(c);s(d.links),i(d.forms)}}}}),ve([e],function(c){l(c)})},"ln-ajax")}function b(){for(const c of document.querySelectorAll("["+e+"]"))l(c)}window[t]=l,window[t].destroy=a,w(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",b):b()})()})();
|
|
1
|
+
(function(){"use strict";function te(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function $(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!$(o))return}e.apply(console,t)}}function y(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function ne(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(l),l}function _(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){_(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button!==0||!t)return!1;const n=t.getAttribute("href");return!(!n||t.getAttribute("target")==="_blank"||t.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||t.hostname&&t.hostname!==window.location.hostname)}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&l[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);l[r.name]=r.value===""||isNaN(u)?null:u}else l[r.name]=r.value}return l}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const n=e.elements,o=[],l={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(r).split(",").map(function(w){return w.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=le(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<i.options.length;u++)i.options[u].selected=r.indexOf(i.options[u].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const M={};function ae(e,t){M[e]=t}function ce(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];R[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ue);const O={};function we(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const w=r[u].trim().split(":");if(w.length!==2)continue;const h=w[0].trim(),c=w[1].trim();t[c]!=null&&a.setAttribute(h,t[c])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const w=r[u].trim().split(":");if(w.length!==2)continue;const h=w[0].trim(),c=w[1].trim();c in t&&a.classList.toggle(h,!!t[c])}}return e}function he(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(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,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let r=0;r<a.length;r++){const u=a[r];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function pe(e,t,n,o,l,s){const i={};for(let r=0;r<e.children.length;r++){const u=e.children[r],w=u.getAttribute("data-ln-render-key");w&&(i[w]=u)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],w=String(o(u));let h=i[w];if(h)l(h,u,r);else{const c=we(n,s);if(!c||(U(c,u),h=c.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",w),l(h,u,r)}a.appendChild(h)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=W,window.lnCore.lnFill=he,window.lnCore.renderList=pe);function D(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function B(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function G(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const F=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(F.has(n))return F.get(n);const o=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&o.has(a)?a:t};return F.set(n,l),l}function P(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function H(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function be(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const o in n){const[l,s,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function me(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=K(o.values,o.fallback);break;case"integer":l=B;break;case"float":l=P;break;case"boolean":l=G;break;case"list":l=V;break;case"json":l=H;break;case"string":default:l=D;break}l||(l=D),t[o.prop]=[l,n,o.fallback]}return t}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ge,window.lnCore.attrSpec=me,window.lnCore.attrStr=D,window.lnCore.attrInt=B,window.lnCore.attrBool=G,window.lnCore.attrList=V,window.lnCore.attrEnum=K,window.lnCore.attrFloat=P,window.lnCore.attrJson=H);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Ce(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&L(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)L(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=J(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ye(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=J(),l=o.byAttr.get(t),s=te()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&$(i)){const a=o.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let u=0;u<a.length;u++)be(a[u].spec,r,t,a[u].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&Q(a,i,t,e.oldValue),o.reactiveWildcard.length&&Q(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const r=l[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(Ce(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function Y(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=X();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=z();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType!==1)continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],u=r.query;if(u&&(s.matches&&s.matches(u)&&(r.ComponentFn&&L(s,r),r.onInit&&r.onInit(s)),i&&s.querySelectorAll)){const w=s.querySelectorAll(u);for(let h=0;h<w.length;h++)r.ComponentFn&&L(w[h],r),r.onInit&&r.onInit(w[h])}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType!==1||document.contains(s))continue;const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],u=r.query;if(u&&(s.matches&&s.matches(u)&&Y(s,r),i&&s.querySelectorAll)){const w=s.querySelectorAll(u);for(let h=0;h<w.length;h++)Y(w[h],r)}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Se(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e,t){Ae({observed:e,handler:t}),ke()}function Ee(e){X().push(e),e.onSubtreeChange&&e.query&&z().push(e),_e()}function Z(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},o=Z(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,u=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Le(e){if(!e)return null;const t=I();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Le,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Ie);function Ne(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Ne(t);if(!o)return n;const l=new URLSearchParams(o);for(const[s,i]of l.entries())n[s]=i;return n}function Me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Re(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function We(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Ge(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ve(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Me,window.lnCore.querySet=Re,window.lnCore.resolveQueryParam=We,window.lnCore.querySortEncode=Ue,window.lnCore.querySortDecode=Be,window.lnCore.queryFilterEncode=Ge,window.lnCore.queryFilterDecode=Ve);function Ke(){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=Ke),(function(){const e="data-ln-ajax",t="lnAjax",n="data-ln-data-coordinator-scope";if(window[t]!==void 0)return;let o=null;function l(c){if(!c.hasAttribute(e)||c[t])return;c[t]=!0;const f=u(c);s(f.links),i(f.forms)}function s(c){for(const f of c){if(f[t+"Trigger"]||f.hostname&&f.hostname!==window.location.hostname)continue;const d=f.getAttribute("href");if(d&&d.includes("#"))continue;const p=function(A){if(!re(A,f))return;A.preventDefault();const v=f.getAttribute("href");v&&r("GET",v,null,f)};f.addEventListener("click",p),f[t+"Trigger"]=p}}function i(c){for(const f of c){if(f[t+"Trigger"])continue;if(f.hasAttribute(n)){f[t+"ScopeWarned"]||(f[t+"ScopeWarned"]=!0,console.warn("[ln-ajax] Form has data-ln-data-coordinator-scope — the ln-data-coordinator write pipeline takes precedence; skipping ajax interception for this form."));continue}const d=function(p){if(p.defaultPrevented)return;p.preventDefault();const A=f.method.toUpperCase(),v=f.action,q=new FormData(f);for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!0;r(A,v,q,f,function(){for(const x of f.querySelectorAll('button, input[type="submit"]'))x.disabled=!1})};f.addEventListener("submit",d),f[t+"Trigger"]=d}}function a(c){if(!c[t])return;const f=u(c);for(const d of f.links)d[t+"Trigger"]&&(d.removeEventListener("click",d[t+"Trigger"]),delete d[t+"Trigger"]);for(const d of f.forms)d[t+"Trigger"]&&(d.removeEventListener("submit",d[t+"Trigger"]),delete d[t+"Trigger"]);delete c[t]}function r(c,f,d,p,A){if(ne(p,"ln-ajax:before-start",{method:c,url:f}).defaultPrevented)return;c==="GET"&&o&&o(),y(p,"ln-ajax:start",{method:c,url:f}),p.classList.add("ln-ajax--loading");const q=document.createElement("span");q.className="ln-ajax-spinner",p.appendChild(q);function x(){p.classList.remove("ln-ajax--loading");const b=p.querySelector(".ln-ajax-spinner");b&&b.remove(),A&&A()}let m=f;const ee=document.querySelector('meta[name="csrf-token"]'),T=ee?ee.getAttribute("content"):null;d instanceof FormData&&T&&d.append("_token",T);const j={method:c,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}};if(T&&(j.headers["X-CSRF-TOKEN"]=T),c==="GET"&&d){const b=new URLSearchParams(d);m=f+(f.includes("?")?"&":"?")+b.toString()}else c!=="GET"&&d&&(j.body=d);let k=null;if(c==="GET"){const b=new AbortController;j.signal=b.signal,k=function(){o=null,b.abort(),x(),y(p,"ln-ajax:aborted",{method:c,url:m})},o=k}fetch(m,j).then(function(b){const N=b.ok,g=b.status;return b.text().then(function(S){let C=null,E=null;if(S&&S.trim())try{C=JSON.parse(S)}catch(Pe){E=Pe}return{ok:N,status:g,data:C,parseError:E}})}).then(function(b){k&&o===k&&(o=null);const N=b.status,g=b.data,S=b.parseError;if(b.ok&&!S){if(g&&g.title&&(document.title=g.title),g&&g.content)for(const C in g.content){const E=document.getElementById(C);E&&(E.innerHTML=g.content[C])}if(p.tagName==="A"){const C=p.getAttribute("href");C&&window.history.pushState({ajax:!0},"",C)}else p.tagName==="FORM"&&p.method.toUpperCase()==="GET"&&window.history.pushState({ajax:!0},"",m);y(p,"ln-ajax:success",{method:c,url:m,data:g})}else y(p,"ln-ajax:error",{method:c,url:m,status:N,data:g,error:S||null});x(),y(p,"ln-ajax:complete",{method:c,url:m})}).catch(function(b){b&&b.name==="AbortError"||(k&&o===k&&(o=null),y(p,"ln-ajax:error",{method:c,url:m,status:0,data:null,error:b}),x(),y(p,"ln-ajax:complete",{method:c,url:m}))})}function u(c){const f={links:[],forms:[]};return c.tagName==="A"&&c.getAttribute(e)!=="false"?f.links.push(c):c.tagName==="FORM"&&c.getAttribute(e)!=="false"?f.forms.push(c):(f.links=Array.from(c.querySelectorAll('a:not([data-ln-ajax="false"])')),f.forms=Array.from(c.querySelectorAll('form:not([data-ln-ajax="false"])'))),f}function w(){_(function(){Ee({onInit:function(c){if(l(c),!c.hasAttribute(e)){for(const d of c.querySelectorAll("["+e+"]"))l(d);const f=c.closest&&c.closest("["+e+"]");if(f&&f.getAttribute(e)!=="false"){const d=u(c);s(d.links),i(d.forms)}}}}),ve([e],function(c){l(c)})},"ln-ajax")}function h(){for(const c of document.querySelectorAll("["+e+"]"))l(c)}window[t]=l,window[t].destroy=a,w(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h()})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!L(r))return}e.apply(console,t)}}function g(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(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 se(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,a={};if(n)for(let d=0;d<s.length;d++){const o=s[d];o.name&&o.type==="checkbox"&&!o.disabled&&(a[o.name]=(a[o.name]||0)+1)}for(let d=0;d<s.length;d++){const o=s[d];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&a[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let h=0;h<o.options.length;h++)o.options[h].selected&&i[o.name].push(o.options[h].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const h=Number(o.value);i[o.name]=o.value===""||isNaN(h)?null:h}else i[o.name]=o.value}return i}function ce(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=[],i={};for(let s=0;s<n.length;s++){const a=n[s];a.name&&a.type==="checkbox"&&(i[a.name]=(i[a.name]||0)+1)}for(let s=0;s<n.length;s++){const a=n[s];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const d=a.getAttribute("data-ln-fill-as")||a.name;if(!d||!(d in t))continue;const o=t[d];if(a.type==="checkbox"){if(Array.isArray(o))a.checked=o.indexOf(a.value)!==-1;else if(i[a.name]>1){const h=String(o).split(",").map(function(l){return l.trim()});a.checked=h.indexOf(a.value)!==-1}else a.checked=ce(o);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(o),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(o))for(let h=0;h<a.options.length;h++)a.options[h].selected=o.indexOf(a.options[h].value)!==-1;r.push(a)}else a.value=o,a.tagName==="SELECT"&&o!=null&&a.setAttribute("data-ln-value",o),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ae);function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(n){return console.error(`[${t}] Invalid headers JSON:`,n),{}}}const M={};function fe(e,t){M[e]=t}function he(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){g(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function we(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];B[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=pe);const O={};function be(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let a=0;a<n.length;a++){const d=n[a],o=d.getAttribute("data-ln-field");t[o]!=null&&(d.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const d=r[a],o=d.getAttribute("data-ln-attr").split(",");for(let h=0;h<o.length;h++){const l=o[h].trim().split(":");if(l.length!==2)continue;const u=l[0].trim(),c=l[1].trim();t[c]!=null&&d.setAttribute(u,t[c])}}const i=e.querySelectorAll("[data-ln-show]");for(let a=0;a<i.length;a++){const d=i[a],o=d.getAttribute("data-ln-show");o in t&&d.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let a=0;a<s.length;a++){const d=s[a],o=d.getAttribute("data-ln-class").split(",");for(let h=0;h<o.length;h++){const l=o[h].trim().split(":");if(l.length!==2)continue;const u=l[0].trim(),c=l[1].trim();c in t&&d.classList.toggle(u,!!t[c])}}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)H(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 W(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,d){return t[d]!==void 0?t[d]:""}))}const r=function(s,a){return t[a]!==void 0?t[a]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const a=i[s],d=a.attributes;for(let o=0;o<d.length;o++){const h=d[o];h.value.indexOf("{{")!==-1&&a.setAttribute(h.name,h.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ye(e,t,n,r,i,s){const a={};for(let o=0;o<e.children.length;o++){const h=e.children[o],l=h.getAttribute("data-ln-render-key");l&&(a[l]=h)}const d=document.createDocumentFragment();for(let o=0;o<t.length;o++){const h=t[o],l=String(r(h));let u=a[l];if(u)i(u,h,o);else{const c=be(n,s);if(!c||(W(c,h),u=c.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",l),i(u,h,o)}d.appendChild(u)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=H,window.lnCore.lnFill=ge,window.lnCore.renderList=ye);function v(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Q(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function J(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const r=new Set(e||[]),i=function(s,a){const d=s.getAttribute(a);return d!==null&&r.has(d)?d:t};return D.set(n,i),i}function G(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function P(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const d=o=>{i?console.warn(o,i):console.warn(o)};if(a==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(d(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const o=e.values||[];return o.includes(t)?!0:(d(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return d(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(d(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(d(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(d(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(o){return d(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,n){for(const r in n){const[i,s,a]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,a)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=V(r.values,r.fallback);break;case"integer":i=Q;break;case"float":i=G;break;case"boolean":i=J;break;case"list":i=K;break;case"json":i=z;break;case"string":default:i=v;break}i||(i=v),t[r.prop]=[i,n,r.fallback]}return t}function Ce(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 _e(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=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=v,window.lnCore.attrInt=Q,window.lnCore.attrBool=J,window.lnCore.attrList=K,window.lnCore.attrEnum=V,window.lnCore.attrFloat=G,window.lnCore.attrJson=z);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Z(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&E(e,a),e.querySelectorAll){const d=e.querySelectorAll(s);for(let o=0;o<d.length;o++)E(d[o],a)}}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 ve(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(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const a=s.effects&&s.effects[n];a?a(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function ke(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ee(),i=r.byAttr.get(t),s=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const a=e.target;if(e.oldValue!==a.getAttribute(t)){if(s&&L(a)){const d=r.byDeclaredAttr.get(t),o=a.getAttribute(t);for(let h=0;h<d.length;h++)P(d[h].spec,o,t,d[h].componentTag,a)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,a,{oldValue:e.oldValue,newValue:a.getAttribute(t)}),n){const d=r.byReactive.get(t);d&&te(d,a,t,e.oldValue),r.reactiveWildcard.length&&te(r.reactiveWildcard,a,t,e.oldValue)}if(i)for(let d=0;d<i.length;d++){const o=i[d];if(o.handler){o.handler(a,t,e.oldValue);continue}o.onAttributeChange&&a[o.attribute]?o.onAttributeChange(a,t):(Z(a,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(a))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ke(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function F(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ne(e){const t=T();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=I();if(e.target&&r.length)for(let i=0;i<r.length;i++){const s=r[i],a=s.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;d&&s.onSubtreeChange(d,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const a=!!(s.firstElementChild||s.children&&s.children.length);for(let d=0;d<t.length;d++){const o=t[d];if(o.selector&&o.attribute&&o.ComponentFn){if(!a)s.matches&&s.matches(o.query)&&E(s,o);else if(s.matches&&s.matches(o.query)&&E(s,o),s.querySelectorAll){const h=s.querySelectorAll(o.query);for(let l=0;l<h.length;l++)E(h[l],o)}}o.onInit&&o.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const a=!!(s.firstElementChild||s.children&&s.children.length);for(let d=0;d<t.length;d++){const o=t[d],h=o.query;if(h){if(!a)s.matches&&s.matches(h)&&F(s,o);else if(s.matches&&s.matches(h)&&F(s,o),s.querySelectorAll){const l=s.querySelectorAll(h);for(let u=0;u<l.length;u++)F(l[u],o)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ne(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{ne(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){T().push(e),e.onSubtreeChange&&e.query&&I().push(e),re()}function oe(e,t,n,r,i={}){const s=i.extraAttributes||[],a=i.onAttributeChange||null,d=i.onSubtreeChange||null,o=i.onInit||null,h=i.onAttrChange||null,l=i.effects||null,u=i.attributes||null,c=u?Ce(u):l,f=u?new Set(Object.keys(u)):null,p=i.persist||null;function w(S){const m=S||document.body;if(Z(m,e,t,n),u&&N())for(const y in u){const Pe=u[y],j=Array.from(m.querySelectorAll("["+y+"]"));m.matches&&m.matches("["+y+"]")&&j.push(m);for(let U=0;U<j.length;U++){const $=j[U];L($)&&P(Pe,$.getAttribute(y),y,r,$)}}o&&o(m)}const b=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let m;for(;(m=S.exec(e))!==null;)b.push(m[1])}else b.push(e);Ee({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:b.concat(s),onAttributeChange:a,onAttrChange:h,effects:c,declared:f,persist:p}),Se();const _=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,q=i.subtreeQuery||(_?e:"["+e+"]"),k={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:d,query:q};T().push(k),d&&q&&I().push(k),re(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=xe);function A(){Ae()>0?ve(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A(),w}function ie(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,n={},r=ie(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const a=i[s];if(!a)continue;const d=a.indexOf(":"),o=d>-1?a.slice(0,d):a,h=d>-1?a.slice(d+1):"";if(o)try{n[o]=decodeURIComponent(h)}catch{n[o]=h}}return n}function Le(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const n=R();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const a=n[s];return a===""?s:s+":"+encodeURIComponent(a)}).join("&");ie(location.hash)!==i&&(location.hash=i)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Te(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 Ie(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 Re(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 n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Te,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=je);function Ue(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Ue(t);if(!r)return n;const i=new URLSearchParams(r);for(const[s,a]of i.entries())n[s]=a;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");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 He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Qe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Je(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Ne,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=He,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=Qe,window.lnCore.queryFilterDecode=Je);function Ke(){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=Ke);const Ve={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function C(...e){return e.filter(t=>t!=null&&t!=="").map((t,n)=>{const r=String(t);return n===0?r.replace(/\/+$/,""):r.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function Ge(e,t){if(!e||typeof e!="object")return"";const n=Object.assign({},Ve);if(t&&typeof t=="object")for(const i in t)t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(n[i]=t[i]);const r=new URLSearchParams;return e.search&&r.append(n.search,e.search),e.offset!=null&&r.append(n.offset,e.offset),e.limit!=null&&r.append(n.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(r.append(n.sortField,e.sort.field),r.append(n.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(i=>{const s=e.filters[i];Array.isArray(s)&&s.length>0&&r.append(i,s.join(","))}),r.toString()}function ze(e,t,n){let r=C(e,t);return n&&(r+=(r.indexOf("?")!==-1?"&":"?")+n),r}function le(e){const t=e&&e.content!==void 0?e.content:e,n=e&&e.message?e.message:null;return{record:t,message:n}}(function(){const e="data-ln-api-connector",t="lnApiConnector",n="lnConnector";if(window[t]!==void 0)return;function r(l){const u=l[t];u&&u.refreshConfig()}function i(l){return l.getAttribute("data-ln-api-path")||l.getAttribute("data-ln-api-endpoint")||""}const s={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:v,type:"string",fallback:"",effect:r,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:i,type:"string",fallback:"",effect:r,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{read:i,type:"string",fallback:"",effect:r,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:v,type:"json",fallback:null,effect:r,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:r,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:r,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:r,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:r,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:r,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:r,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},a=Y(s);function d(l){return l.ok?l.status===204?null:l.json():l.json().catch(()=>null).then(u=>{const c=new Error("HTTP "+l.status+": "+l.statusText);throw c.status=l.status,c.data=u,c})}function o(l){return this.dom=l,X(this,l,a),l[t]=this,l[n]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,h(this),this}o.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin",this.headers=ue(this.rawHeaders);const u={},c=l.getAttribute("data-ln-api-param-offset");c&&(u.offset=c);const f=l.getAttribute("data-ln-api-param-limit");f&&(u.limit=f);const p=l.getAttribute("data-ln-api-param-search");p&&(u.search=p);const w=l.getAttribute("data-ln-api-param-sort-field");w&&(u.sortField=w);const b=l.getAttribute("data-ln-api-param-sort-dir");b&&(u.sortDir=b),this.paramKeys=u;const _=l.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=_!==null?+_:300,g(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},o.prototype._reqHeaders=function(l){const u=Object.assign({},this.headers);return!u.Accept&&!u.accept&&(u.Accept="application/json"),!u["Content-Type"]&&!u["content-type"]&&(u["Content-Type"]="application/json"),l&&(u["X-Idempotency-Key"]=l),u},o.prototype.cancel=function(l){return l&&this._inflight.has(l)?(this._inflight.get(l).abort(),this._inflight.delete(l),!0):!1},o.prototype.fetchDelta=function(l,u){const c=this;let f=C(c.baseUrl,c.path);l!=null&&l!==""&&(f+=(f.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(l));const p=u||"sync";c._inflight.has(p)&&c._inflight.get(p).abort();const w=new AbortController;return c._inflight.set(p,w),window.fetch(f,{method:"GET",headers:c._reqHeaders(),credentials:c.credentials,signal:w.signal}).then(d).finally(function(){c._inflight.get(p)===w&&c._inflight.delete(p)})},o.prototype.query=function(l,u){const c=this,f=Ge(l,c.paramKeys),p=ze(c.baseUrl,c.path,f),w=u||"query";c._inflight.has(w)&&c._inflight.get(w).abort();const b=new AbortController;return c._inflight.set(w,b),window.fetch(p,{method:"GET",headers:c._reqHeaders(),credentials:c.credentials,signal:b.signal}).then(d).finally(function(){c._inflight.get(w)===b&&c._inflight.delete(w)})},o.prototype.create=function(l,u,c){const f=this;return window.fetch(C(f.baseUrl,u||f.path),{method:"POST",headers:f._reqHeaders(c),credentials:f.credentials,body:JSON.stringify(l)}).then(d)},o.prototype.update=function(l,u,c,f,p){const w=this;c!=null&&(u=Object.assign({},u,{expected_version:c}));const b=f?C(w.baseUrl,f):C(w.baseUrl,w.path,l);return window.fetch(b,{method:"PUT",headers:w._reqHeaders(p),credentials:w.credentials,body:JSON.stringify(u)}).then(d)},o.prototype.delete=function(l,u,c){const f=this;return window.fetch(C(f.baseUrl,u||f.path,l),{method:"DELETE",headers:f._reqHeaders(c),credentials:f.credentials}).then(d)},o.prototype.bulkDelete=function(l,u,c){const f=this;return window.fetch(C(f.baseUrl,u||f.path,"bulk-delete"),{method:"DELETE",headers:f._reqHeaders(c),credentials:f.credentials,body:JSON.stringify({ids:l})}).then(d)};function h(l){l._handlers={sync:function(u){const c=u.detail||{},f=c.meta&&c.meta.targetEl?c.meta.targetEl:null;l.fetchDelta(c.since,f).then(function(p){g(l.dom,"ln-api-connector:fetched",{data:p,since:c.since,meta:c.meta||null})}).catch(function(p){p&&p.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"sync",error:p.message,status:p.status||0,data:p.data||null,since:c.since,meta:c.meta||null})})},query:function(u){const c=u.detail||{},f=c.query||c,p=c.meta&&c.meta.targetEl?c.meta.targetEl:null,w=p||"query",b=l.queryDebounce;function _(k,A,S){l.query(A,S).then(function(m){const y=m||{};g(l.dom,"ln-api-connector:fetched",{data:y.data||(Array.isArray(y)?y:[]),total:y.total,filtered:y.filtered,offset:A.offset,queryGen:A.queryGen,meta:k.meta||null})}).catch(function(m){m&&m.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"query",error:m.message,status:m.status||0,data:m.data||null,meta:k.meta||null})})}if(b===0){_(c,f,p);return}l._queryTimers.has(w)&&clearTimeout(l._queryTimers.get(w));const q=setTimeout(function(){l._queryTimers.delete(w),_(c,f,p)},b);l._queryTimers.set(w,q)},cancel:function(u){const c=u.detail||{},f=c.meta&&c.meta.targetEl?c.meta.targetEl:c.targetEl||c.key;f&&l.cancel(f)},create:function(u){const c=u.detail||{};l.create(c.data,c.url,c.idempotencyKey).then(function(f){const p=le(f);g(l.dom,"ln-api-connector:created",{record:p.record,tempId:c.tempId,message:p.message,meta:c.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"create",error:f.message,status:f.status||0,data:f.data||null,tempId:c.tempId,meta:c.meta||null})})},update:function(u){const c=u.detail||{};l.update(c.id,c.data,c.expected_version,c.url,c.idempotencyKey).then(function(f){const p=le(f);g(l.dom,"ln-api-connector:updated",{record:p.record,id:c.id,message:p.message,meta:c.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"update",error:f.message,status:f.status||0,data:f.data||null,id:c.id,conflictData:f.status===409?f.data:null,meta:c.meta||null})})},delete:function(u){const c=u.detail||{};l.delete(c.id,c.url,c.idempotencyKey).then(function(f){const p=f&&f.message?f.message:null;g(l.dom,"ln-api-connector:deleted",{response:f,id:c.id,message:p,meta:c.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"delete",error:f.message,status:f.status||0,data:f.data||null,id:c.id,meta:c.meta||null})})},bulkDelete:function(u){const c=u.detail||{};l.bulkDelete(c.ids,c.url,c.idempotencyKey).then(function(f){const p=f&&f.message?f.message:null;g(l.dom,"ln-api-connector:bulk-deleted",{response:f,ids:c.ids,message:p,meta:c.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"bulk-delete",error:f.message,status:f.status||0,data:f.data||null,ids:c.ids,meta:c.meta||null})})}},l.dom.addEventListener("ln-api-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-api-connector:request-query",l._handlers.query),l.dom.addEventListener("ln-api-connector:request-cancel",l._handlers.cancel),l.dom.addEventListener("ln-api-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-api-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-api-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-api-connector:request-bulk-delete",l._handlers.bulkDelete)}o.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._inflight&&(l._inflight.forEach(function(u){u.abort()}),l._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(u){u&&clearTimeout(u)}),this._queryTimers.clear()),this._handlers&&(l.dom.removeEventListener("ln-api-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-api-connector:request-query",l._handlers.query),l.dom.removeEventListener("ln-api-connector:request-cancel",l._handlers.cancel),l.dom.removeEventListener("ln-api-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-api-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-api-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-api-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[n]},oe(e,t,o,"ln-api-connector",{attributes:s})})()})();
|
|
1
|
+
(function(){"use strict";function $(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!L(r))return}e.apply(console,t)}}function g(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},c=e.elements,a={};if(n)for(let d=0;d<c.length;d++){const o=c[d];o.name&&o.type==="checkbox"&&!o.disabled&&(a[o.name]=(a[o.name]||0)+1)}for(let d=0;d<c.length;d++){const o=c[d];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&a[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let h=0;h<o.options.length;h++)o.options[h].selected&&i[o.name].push(o.options[h].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const h=Number(o.value);i[o.name]=o.value===""||isNaN(h)?null:h}else i[o.name]=o.value}return i}function ce(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=[],i={};for(let c=0;c<n.length;c++){const a=n[c];a.name&&a.type==="checkbox"&&(i[a.name]=(i[a.name]||0)+1)}for(let c=0;c<n.length;c++){const a=n[c];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const d=a.getAttribute("data-ln-fill-as")||a.name;if(!d||!(d in t))continue;const o=t[d];if(a.type==="checkbox"){if(Array.isArray(o))a.checked=o.indexOf(a.value)!==-1;else if(i[a.name]>1){const h=String(o).split(",").map(function(l){return l.trim()});a.checked=h.indexOf(a.value)!==-1}else a.checked=ce(o);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(o),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(o))for(let h=0;h<a.options.length;h++)a.options[h].selected=o.indexOf(a.options[h].value)!==-1;r.push(a)}else a.value=o,a.tagName==="SELECT"&&o!=null&&a.setAttribute("data-ln-value",o),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ae);function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(n){return console.error(`[${t}] Invalid headers JSON:`,n),{}}}const N={};function fe(e,t){N[e]=t}function he(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){g(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function we(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=pe);const O={};function be(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let a=0;a<n.length;a++){const d=n[a],o=d.getAttribute("data-ln-field");t[o]!=null&&(d.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const d=r[a],o=d.getAttribute("data-ln-attr").split(",");for(let h=0;h<o.length;h++){const l=o[h].trim().split(":");if(l.length!==2)continue;const u=l[0].trim(),s=l[1].trim();t[s]!=null&&d.setAttribute(u,t[s])}}const i=e.querySelectorAll("[data-ln-show]");for(let a=0;a<i.length;a++){const d=i[a],o=d.getAttribute("data-ln-show");o in t&&d.classList.toggle("hidden",!t[o])}const c=e.querySelectorAll("[data-ln-class]");for(let a=0;a<c.length;a++){const d=c[a],o=d.getAttribute("data-ln-class").split(",");for(let h=0;h<o.length;h++){const l=o[h].trim().split(":");if(l.length!==2)continue;const u=l[0].trim(),s=l[1].trim();s in t&&d.classList.toggle(u,!!t[s])}}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)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function H(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const c=n.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,d){return t[d]!==void 0?t[d]:""}))}const r=function(c,a){return t[a]!==void 0?t[a]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const a=i[c],d=a.attributes;for(let o=0;o<d.length;o++){const h=d[o];h.value.indexOf("{{")!==-1&&a.setAttribute(h.name,h.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ye(e,t,n,r,i,c){const a={};for(let o=0;o<e.children.length;o++){const h=e.children[o],l=h.getAttribute("data-ln-render-key");l&&(a[l]=h)}const d=document.createDocumentFragment();for(let o=0;o<t.length;o++){const h=t[o],l=String(r(h));let u=a[l];if(u)i(u,h,o);else{const s=be(n,c);if(!s||(H(s,h),u=s.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",l),i(u,h,o)}d.appendChild(u)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=H,window.lnCore.fill=B,window.lnCore.lnFill=ge,window.lnCore.renderList=ye);function v(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 Q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function J(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const D=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(D.has(n))return D.get(n);const r=new Set(e||[]),i=function(c,a){const d=c.getAttribute(a);return d!==null&&r.has(d)?d:t};return D.set(n,i),i}function V(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function G(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function z(e,t,n,r,i){if(!e||t===null)return!0;const c=r||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const d=o=>{i?console.warn(o,i):console.warn(o)};if(a==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(d(`[${c}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const o=e.values||[];return o.includes(t)?!0:(d(`[${c}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return d(`[${c}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(d(`[${c}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(d(`[${c}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(d(`[${c}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(o){return d(`[${c}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,n){for(const r in n){const[i,c,a]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,c,a)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=K(r.values,r.fallback);break;case"integer":i=W;break;case"float":i=V;break;case"boolean":i=Q;break;case"list":i=J;break;case"json":i=G;break;case"string":default:i=v;break}i||(i=v),t[r.prop]=[i,n,r.fallback]}return t}function Ce(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 _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=P,window.lnCore.attrSpec=X,window.lnCore.attrStr=v,window.lnCore.attrInt=W,window.lnCore.attrBool=Q,window.lnCore.attrList=J,window.lnCore.attrEnum=K,window.lnCore.attrFloat=V,window.lnCore.attrJson=G);function x(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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function Y(e,t,n,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(c)&&x(e,a),e.querySelectorAll){const d=e.querySelectorAll(c);for(let o=0;o<d.length;o++)x(d[o],a)}}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 ve(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 Z(){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=Z(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=_e(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,n,r){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const a=c.effects&&c.effects[n];a?a(t,n,r):c.onAttrChange&&(!c.declared||c.declared.has(n))&&c.onAttrChange(t,n,r)}}function ke(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Z(),i=r.byAttr.get(t),c=$()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!c)return;const a=e.target;if(e.oldValue!==a.getAttribute(t)){if(c&&L(a)){const d=r.byDeclaredAttr.get(t),o=a.getAttribute(t);for(let h=0;h<d.length;h++)z(d[h].spec,o,t,d[h].componentTag,a)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,a,{oldValue:e.oldValue,newValue:a.getAttribute(t)}),n){const d=r.byReactive.get(t);d&&ee(d,a,t,e.oldValue),r.reactiveWildcard.length&&ee(r.reactiveWildcard,a,t,e.oldValue)}if(i)for(let d=0;d<i.length;d++){const o=i[d];if(o.handler){o.handler(a,t,e.oldValue);continue}o.onAttributeChange&&a[o.attribute]?o.onAttributeChange(a,t):(Y(a,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(a))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ke(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function I(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function te(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ne(e){const t=T();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=I();if(e.target&&r.length)for(let i=0;i<r.length;i++){const c=r[i],a=c.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;d&&c.onSubtreeChange(d,e)}for(let i=0;i<e.addedNodes.length;i++){const c=e.addedNodes[i];if(c.nodeType!==1)continue;const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const o=t[d],h=o.query;if(h&&(c.matches&&c.matches(h)&&(o.ComponentFn&&x(c,o),o.onInit&&o.onInit(c)),a&&c.querySelectorAll)){const l=c.querySelectorAll(h);for(let u=0;u<l.length;u++)o.ComponentFn&&x(l[u],o),o.onInit&&o.onInit(l[u])}}}for(let i=0;i<e.removedNodes.length;i++){const c=e.removedNodes[i];if(c.nodeType!==1||document.contains(c))continue;const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const o=t[d],h=o.query;if(h&&(c.matches&&c.matches(h)&&te(c,o),a&&c.querySelectorAll)){const l=c.querySelectorAll(h);for(let u=0;u<l.length;u++)te(l[u],o)}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ne(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{ne(i)}catch(c){console.error("[ln-core] lifecycle handler failed",i.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){T().push(e),e.onSubtreeChange&&e.query&&I().push(e),re()}function oe(e,t,n,r,i={}){const c=i.extraAttributes||[],a=i.onAttributeChange||null,d=i.onSubtreeChange||null,o=i.onInit||null,h=i.onAttrChange||null,l=i.effects||null,u=i.attributes||null,s=u?Ce(u):l,f=u?new Set(Object.keys(u)):null,p=i.persist||null;function w(k){const m=k||document.body;if(Y(m,e,t,n),u&&$())for(const y in u){const Pe=u[y],R=Array.from(m.querySelectorAll("["+y+"]"));m.matches&&m.matches("["+y+"]")&&R.push(m);for(let j=0;j<R.length;j++){const U=R[j];L(U)&&z(Pe,U.getAttribute(y),y,r,U)}}o&&o(m)}const b=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let m;for(;(m=k.exec(e))!==null;)b.push(m[1])}else b.push(e);Ee({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:o,observed:b.concat(c),onAttributeChange:a,onAttrChange:h,effects:s,declared:f,persist:p}),Se();const _=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,q=i.subtreeQuery||(_?e:"["+e+"]"),E={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:d,query:q};T().push(E),d&&q&&I().push(E),re(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=xe);function A(){Ae()>0?ve(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A(),w}function ie(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,n={},r=ie(t);if(!r)return n;const i=r.split("&");for(let c=0;c<i.length;c++){const a=i[c];if(!a)continue;const d=a.indexOf(":"),o=d>-1?a.slice(0,d):a,h=d>-1?a.slice(d+1):"";if(o)try{n[o]=decodeURIComponent(h)}catch{n[o]=h}}return n}function Le(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const n=F();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(c){const a=n[c];return a===""?c:c+":"+encodeURIComponent(a)}).join("&");ie(location.hash)!==i&&(location.hash=i)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Te(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 Ie(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 Re(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 n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Te,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=je);function Ue(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Ue(t);if(!r)return n;const i=new URLSearchParams(r);for(const[c,a]of i.entries())n[c]=a;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");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 He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Qe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Je(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Ne,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=He,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=Qe,window.lnCore.queryFilterDecode=Je);function Ke(){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=Ke);const Ve={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function C(...e){return e.filter(t=>t!=null&&t!=="").map((t,n)=>{const r=String(t);return n===0?r.replace(/\/+$/,""):r.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function Ge(e,t){if(!e||typeof e!="object")return"";const n=Object.assign({},Ve);if(t&&typeof t=="object")for(const i in t)t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(n[i]=t[i]);const r=new URLSearchParams;return e.search&&r.append(n.search,e.search),e.offset!=null&&r.append(n.offset,e.offset),e.limit!=null&&r.append(n.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(r.append(n.sortField,e.sort.field),r.append(n.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(i=>{const c=e.filters[i];Array.isArray(c)&&c.length>0&&r.append(i,c.join(","))}),r.toString()}function ze(e,t,n){let r=C(e,t);return n&&(r+=(r.indexOf("?")!==-1?"&":"?")+n),r}function le(e){const t=e&&e.content!==void 0?e.content:e,n=e&&e.message?e.message:null;return{record:t,message:n}}(function(){const e="data-ln-api-connector",t="lnApiConnector",n="lnConnector";if(window[t]!==void 0)return;function r(l){const u=l[t];u&&u.refreshConfig()}function i(l){return l.getAttribute("data-ln-api-path")||l.getAttribute("data-ln-api-endpoint")||""}const c={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:v,type:"string",fallback:"",effect:r,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:i,type:"string",fallback:"",effect:r,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{read:i,type:"string",fallback:"",effect:r,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:v,type:"json",fallback:null,effect:r,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:r,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:r,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:r,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:r,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:r,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:r,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},a=X(c);function d(l){return l.ok?l.status===204?null:l.json():l.json().catch(()=>null).then(u=>{const s=new Error("HTTP "+l.status+": "+l.statusText);throw s.status=l.status,s.data=u,s})}function o(l){return this.dom=l,P(this,l,a),l[t]=this,l[n]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,h(this),this}o.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin",this.headers=ue(this.rawHeaders);const u={},s=l.getAttribute("data-ln-api-param-offset");s&&(u.offset=s);const f=l.getAttribute("data-ln-api-param-limit");f&&(u.limit=f);const p=l.getAttribute("data-ln-api-param-search");p&&(u.search=p);const w=l.getAttribute("data-ln-api-param-sort-field");w&&(u.sortField=w);const b=l.getAttribute("data-ln-api-param-sort-dir");b&&(u.sortDir=b),this.paramKeys=u;const _=l.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=_!==null?+_:300,g(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},o.prototype._reqHeaders=function(l){const u=Object.assign({},this.headers);return!u.Accept&&!u.accept&&(u.Accept="application/json"),!u["Content-Type"]&&!u["content-type"]&&(u["Content-Type"]="application/json"),l&&(u["X-Idempotency-Key"]=l),u},o.prototype.cancel=function(l){return l&&this._inflight.has(l)?(this._inflight.get(l).abort(),this._inflight.delete(l),!0):!1},o.prototype.fetchDelta=function(l,u){const s=this;let f=C(s.baseUrl,s.path);l!=null&&l!==""&&(f+=(f.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(l));const p=u||"sync";s._inflight.has(p)&&s._inflight.get(p).abort();const w=new AbortController;return s._inflight.set(p,w),window.fetch(f,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:w.signal}).then(d).finally(function(){s._inflight.get(p)===w&&s._inflight.delete(p)})},o.prototype.query=function(l,u){const s=this,f=Ge(l,s.paramKeys),p=ze(s.baseUrl,s.path,f),w=u||"query";s._inflight.has(w)&&s._inflight.get(w).abort();const b=new AbortController;return s._inflight.set(w,b),window.fetch(p,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:b.signal}).then(d).finally(function(){s._inflight.get(w)===b&&s._inflight.delete(w)})},o.prototype.create=function(l,u,s){const f=this;return window.fetch(C(f.baseUrl,u||f.path),{method:"POST",headers:f._reqHeaders(s),credentials:f.credentials,body:JSON.stringify(l)}).then(d)},o.prototype.update=function(l,u,s,f,p){const w=this;s!=null&&(u=Object.assign({},u,{expected_version:s}));const b=f?C(w.baseUrl,f):C(w.baseUrl,w.path,l);return window.fetch(b,{method:"PUT",headers:w._reqHeaders(p),credentials:w.credentials,body:JSON.stringify(u)}).then(d)},o.prototype.delete=function(l,u,s){const f=this;return window.fetch(C(f.baseUrl,u||f.path,l),{method:"DELETE",headers:f._reqHeaders(s),credentials:f.credentials}).then(d)},o.prototype.bulkDelete=function(l,u,s){const f=this;return window.fetch(C(f.baseUrl,u||f.path,"bulk-delete"),{method:"DELETE",headers:f._reqHeaders(s),credentials:f.credentials,body:JSON.stringify({ids:l})}).then(d)};function h(l){l._handlers={sync:function(u){const s=u.detail||{},f=s.meta&&s.meta.targetEl?s.meta.targetEl:null;l.fetchDelta(s.since,f).then(function(p){g(l.dom,"ln-api-connector:fetched",{data:p,since:s.since,meta:s.meta||null})}).catch(function(p){p&&p.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"sync",error:p.message,status:p.status||0,data:p.data||null,since:s.since,meta:s.meta||null})})},query:function(u){const s=u.detail||{},f=s.query||s,p=s.meta&&s.meta.targetEl?s.meta.targetEl:null,w=p||"query",b=l.queryDebounce;function _(E,A,k){l.query(A,k).then(function(m){const y=m||{};g(l.dom,"ln-api-connector:fetched",{data:y.data||(Array.isArray(y)?y:[]),total:y.total,filtered:y.filtered,offset:A.offset,queryGen:A.queryGen,meta:E.meta||null})}).catch(function(m){m&&m.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"query",error:m.message,status:m.status||0,data:m.data||null,meta:E.meta||null})})}if(b===0){_(s,f,p);return}l._queryTimers.has(w)&&clearTimeout(l._queryTimers.get(w));const q=setTimeout(function(){l._queryTimers.delete(w),_(s,f,p)},b);l._queryTimers.set(w,q)},cancel:function(u){const s=u.detail||{},f=s.meta&&s.meta.targetEl?s.meta.targetEl:s.targetEl||s.key;f&&l.cancel(f)},create:function(u){const s=u.detail||{};l.create(s.data,s.url,s.idempotencyKey).then(function(f){const p=le(f);g(l.dom,"ln-api-connector:created",{record:p.record,tempId:s.tempId,message:p.message,meta:s.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"create",error:f.message,status:f.status||0,data:f.data||null,tempId:s.tempId,meta:s.meta||null})})},update:function(u){const s=u.detail||{};l.update(s.id,s.data,s.expected_version,s.url,s.idempotencyKey).then(function(f){const p=le(f);g(l.dom,"ln-api-connector:updated",{record:p.record,id:s.id,message:p.message,meta:s.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"update",error:f.message,status:f.status||0,data:f.data||null,id:s.id,conflictData:f.status===409?f.data:null,meta:s.meta||null})})},delete:function(u){const s=u.detail||{};l.delete(s.id,s.url,s.idempotencyKey).then(function(f){const p=f&&f.message?f.message:null;g(l.dom,"ln-api-connector:deleted",{response:f,id:s.id,message:p,meta:s.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"delete",error:f.message,status:f.status||0,data:f.data||null,id:s.id,meta:s.meta||null})})},bulkDelete:function(u){const s=u.detail||{};l.bulkDelete(s.ids,s.url,s.idempotencyKey).then(function(f){const p=f&&f.message?f.message:null;g(l.dom,"ln-api-connector:bulk-deleted",{response:f,ids:s.ids,message:p,meta:s.meta||null})}).catch(function(f){f&&f.name==="AbortError"||g(l.dom,"ln-api-connector:error",{action:"bulk-delete",error:f.message,status:f.status||0,data:f.data||null,ids:s.ids,meta:s.meta||null})})}},l.dom.addEventListener("ln-api-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-api-connector:request-query",l._handlers.query),l.dom.addEventListener("ln-api-connector:request-cancel",l._handlers.cancel),l.dom.addEventListener("ln-api-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-api-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-api-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-api-connector:request-bulk-delete",l._handlers.bulkDelete)}o.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._inflight&&(l._inflight.forEach(function(u){u.abort()}),l._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(u){u&&clearTimeout(u)}),this._queryTimers.clear()),this._handlers&&(l.dom.removeEventListener("ln-api-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-api-connector:request-query",l._handlers.query),l.dom.removeEventListener("ln-api-connector:request-cancel",l._handlers.cancel),l.dom.removeEventListener("ln-api-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-api-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-api-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-api-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[n]},oe(e,t,o,"ln-api-connector",{attributes:c})})()})();
|