@livenetworks/ashlar 2.0.7 → 2.0.9
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/LICENSE +641 -641
- package/components/COMPONENTS.md +1116 -1116
- package/components/index.js +81 -81
- package/components/ln-accordion/ln-accordion-dev.scss +8 -8
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-accordion/ln-accordion.schema.json +30 -30
- package/components/ln-ajax/ln-ajax-dev.scss +8 -8
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/ln-ajax.schema.json +30 -30
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-connector/ln-api-connector.schema.json +9 -0
- package/components/ln-api-connector/src/ln-api-connector.js +2 -0
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -34
- package/components/ln-api-queue/src/ln-api-queue.js +3 -13
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -8
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -22
- package/components/ln-autosave/ln-autosave-dev.scss +13 -13
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-autosave/ln-autosave.schema.json +48 -48
- package/components/ln-autosave/src/autosave-model.js +34 -34
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-chart/ln-chart.schema.json +146 -146
- package/components/ln-chart/src/chart-model.js +154 -154
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -42
- package/components/ln-confirm/ln-confirm-dev.scss +24 -24
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-confirm/ln-confirm.schema.json +66 -66
- package/components/ln-confirm/src/ln-confirm.js +178 -178
- package/components/ln-core/attrs.js +13 -0
- package/components/ln-core/crypto.js +286 -265
- package/components/ln-core/dom.js +115 -115
- package/components/ln-core/form.js +146 -136
- package/components/ln-core/helpers.js +33 -33
- package/components/ln-core/http.js +48 -48
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +5 -0
- package/components/ln-core/ln-core.schema.json +3 -2
- package/components/ln-core/locale.js +55 -55
- package/components/ln-core/matching.js +78 -78
- package/components/ln-core/number.js +125 -125
- package/components/ln-core/template.js +206 -206
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -50
- package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +1 -0
- package/components/ln-data-coordinator/README.md +9 -38
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -8
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +16 -16
- package/components/ln-data-coordinator/src/data-read-policy.js +0 -7
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +432 -1308
- package/components/ln-data-store/ln-data-store-dev.scss +13 -13
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/ln-data-store.schema.json +84 -84
- package/components/ln-data-store/src/data-store-model.js +184 -184
- package/components/ln-data-store/src/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/ln-date.schema.json +92 -92
- package/components/ln-date/src/date-model.js +186 -186
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/console-sink.js +19 -19
- package/components/ln-debug/src/gate.js +95 -95
- package/components/ln-debug/src/generated-attributes.js +4 -2
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -13
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/ln-editor.schema.json +58 -58
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/ln-external-links.schema.json +18 -18
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-fill/ln-fill.schema.json +23 -23
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +153 -153
- package/components/ln-filter/src/filter-model.js +185 -185
- package/components/ln-form/ln-form-dev.scss +8 -8
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/ln-form.schema.json +6 -0
- package/components/ln-form/src/ln-form.js +21 -0
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-http/ln-http.schema.json +6 -6
- package/components/ln-icon/ln-icon.schema.json +6 -6
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-include/ln-include.schema.json +23 -23
- package/components/ln-key/ln-key-dev.scss +18 -18
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-key/ln-key.schema.json +56 -56
- package/components/ln-key/src/ln-key.js +10 -10
- package/components/ln-link/ln-link-dev.scss +8 -8
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/ln-link.schema.json +22 -22
- package/components/ln-list/README.md +152 -152
- package/components/ln-list/ln-list-dev.scss +8 -8
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/ln-list.schema.json +166 -166
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-modal/ln-modal.schema.json +65 -65
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/ln-nav.schema.json +25 -25
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/ln-number.schema.json +63 -63
- package/components/ln-number/src/ln-number.js +26 -0
- package/components/ln-number/src/number-model.js +31 -31
- package/components/ln-obfuscator/README.md +60 -60
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -49
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -159
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -250
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/ln-options.schema.json +6 -0
- package/components/ln-options/src/ln-options.js +4 -4
- package/components/ln-persist/README.md +151 -151
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-persist/ln-persist.schema.json +28 -28
- package/components/ln-persist/src/ln-persist.js +83 -83
- package/components/ln-picklist/README.md +230 -230
- package/components/ln-picklist/ln-picklist-dev.scss +22 -22
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-picklist/ln-picklist.schema.json +49 -49
- package/components/ln-picklist/src/ln-picklist.js +228 -228
- package/components/ln-popover/ln-popover-dev.scss +13 -13
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-progress/ln-progress-dev.scss +8 -8
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/ln-progress.schema.json +40 -40
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-router/ln-router.schema.json +76 -76
- package/components/ln-scroll/README.md +45 -45
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-scroll/ln-scroll.schema.json +85 -85
- package/components/ln-scroll/src/ln-scroll.js +150 -150
- package/components/ln-search/README.md +188 -188
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-slug/ln-slug.schema.json +23 -23
- package/components/ln-slug/src/ln-slug.js +25 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +104 -104
- package/components/ln-sort/src/ln-sort.js +321 -321
- package/components/ln-sort/src/sort-model.js +117 -117
- package/components/ln-sortable/ln-sortable-dev.scss +13 -13
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/ln-sortable.schema.json +36 -36
- package/components/ln-stat/ln-stat-dev.scss +8 -8
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-stat/ln-stat.schema.json +32 -32
- package/components/ln-stat/src/stat-model.js +28 -28
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +211 -211
- package/components/ln-table/src/table-model.js +98 -98
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -93
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/ln-tabs.schema.json +75 -75
- package/components/ln-tabs/src/ln-tabs.js +208 -208
- package/components/ln-tabs/src/tabs-model.js +82 -82
- package/components/ln-time/ln-time-dev.scss +13 -13
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/ln-time.schema.json +38 -38
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toast/ln-toast.schema.json +65 -65
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-toggle/ln-toggle.schema.json +52 -52
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -86
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-translations/ln-translations.schema.json +120 -120
- package/components/ln-ui-coordinator/README.md +62 -62
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +28 -28
- package/components/ln-ui-coordinator/src/ln-ui-coordinator.js +140 -140
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-upload/ln-upload.schema.json +193 -193
- package/components/ln-upload/src/upload-model.js +78 -78
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/ln-validate.schema.json +50 -50
- package/components/ln-validate/src/validate-model.js +64 -64
- package/components/ln-websocket-connector/README.md +166 -166
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -29
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +283 -279
- package/ln-ashlar.html-data.json +15 -8
- package/package.json +85 -84
- package/theme/brand.css +73 -73
- package/theme/components/_confirm.scss +6 -6
- package/theme/components/_picklist.scss +3 -3
- package/theme/config/_palette.scss +274 -274
- package/theme/config/_theme.scss +292 -292
- package/theme/config/_tokens.scss +285 -285
- package/theme/config/mixins/_index.scss +62 -62
- package/theme/config/mixins/_picklist.scss +66 -66
- package/theme/ln-ashlar-dev.scss +66 -66
- package/theme/ln-ashlar-landing.scss +56 -56
- package/theme/ln-ashlar-theme.scss +63 -63
- package/theme/presentation/_bento.scss +151 -151
- package/theme/presentation/_cta.scss +111 -111
- package/theme/presentation/_effects.scss +216 -216
- package/theme/presentation/_features.scss +108 -108
- package/theme/presentation/_footer.scss +129 -129
- package/theme/presentation/_hero.scss +158 -158
- package/theme/presentation/_layout.scss +170 -170
- package/theme/presentation/_navbar.scss +140 -140
- package/theme/presentation/_pricing.scss +262 -262
- package/theme/presentation/_stats.scss +87 -87
- package/theme/presentation/_testimonials.scss +124 -124
- package/theme/presentation/_tokens.scss +39 -39
- package/theme/presentation/_typography.scss +163 -163
- package/web-types.json +26 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function k(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!k(o))return}e.apply(console,t)}}function A(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 D(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 S(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function K(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function U(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}const $={};function G(e,t){$[e]=t}function Q(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=G,window.lnCore.getDataMapper=Q);function P(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function J(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function z(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=z,window.lnCore.ensureLocaleObserver=P);const O={};function X(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 r=0;r<n.length;r++){const c=n[r],d=c.getAttribute("data-ln-field");t[d]!=null&&(c.textContent=t[d])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const c=o[r],d=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<d.length;a++){const f=d[a].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();t[u]!=null&&c.setAttribute(s,t[u])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],d=c.getAttribute("data-ln-show");d in t&&c.classList.toggle("hidden",!t[d])}const i=e.querySelectorAll("[data-ln-class]");for(let r=0;r<i.length;r++){const c=i[r],d=c.getAttribute("data-ln-class").split(",");for(let a=0;a<d.length;a++){const f=d[a].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();u in t&&c.classList.toggle(s,!!t[u])}}return e}function Y(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 F(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const o=function(i,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let i=0;i<l.length;i++){const r=l[i],c=r.attributes;for(let d=0;d<c.length;d++){const a=c[d];a.value.indexOf("{{")!==-1&&r.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Z(e,t,n,o,l,i){const r={};for(let d=0;d<e.children.length;d++){const a=e.children[d],f=a.getAttribute("data-ln-render-key");f&&(r[f]=a)}const c=document.createDocumentFragment();for(let d=0;d<t.length;d++){const a=t[d],f=String(o(a));let s=r[f];if(s)l(s,a,d);else{const u=X(n,i);if(!u||(F(u,a),s=u.firstElementChild,!s))continue;s.setAttribute("data-ln-render-key",f),l(s,a,d)}c.appendChild(s)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=F,window.lnCore.fill=B,window.lnCore.lnFill=Y,window.lnCore.renderList=Z);function N(e,t,n,o,l){if(!e||t===null)return!0;const i=o||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=d=>{l?console.warn(d,l):console.warn(d)};if(r==="boolean"){const d=t.trim().toLowerCase();return d!==""&&d!=="true"&&d!=="false"&&d!=="1"&&d!=="0"?(c(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const d=e.values||[];return d.includes(t)?!0:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${d.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const d=parseInt(t,10);return e.min!==void 0&&d<e.min?(c(`[${i}] Value ${d} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&d>e.max?(c(`[${i}] Value ${d} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(d){return c(`[${i}] Invalid JSON for attribute "${n}": ${d.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(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 te(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function E(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&r.push(e);for(const c of r)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(d){console.error("["+n+"] init failed",c,d)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ne(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function oe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function W(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function re(e){const t=W(),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(i=>i.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=te(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 j(e,t,n,o){for(let l=0;l<e.length;l++){const i=e[l];if(!t[i.attribute])continue;const r=i.effects&&i.effects[n];r?r(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function ie(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=W(),l=o.byAttr.get(n);if(R()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&k(t)){const i=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let c=0;c<i.length;c++)N(i[c].spec,r,n,i[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=o.byReactive.get(n);i&&j(i,t,n,e.oldValue),o.reactiveWildcard.length&&j(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let i=0;i<l.length;i++){const r=l[i];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(E(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function le(){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{ie(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function se(e){const t=V();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,i=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;i&&o.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const i=t[l];E(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const i=t[l],r=i.query,c=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&c.push(o);for(let d=0;d<c.length;d++){const a=c[d];if(!document.contains(a)){const f=a[i.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(s){console.error("["+i.attribute+"] destroy failed",a,s)}delete a[i.attribute]}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{se(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ce(e,t,n,o,l={}){const i=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,d=l.onInit||null,a=l.onAttrChange||null,f=l.effects||null,s=l.attributes||null,u=s?ee(s):f,w=s?new Set(Object.keys(s)):null,b=l.persist||null;function p(C){const h=C||document.body;if(E(h,e,t,n),s&&R())for(const y in s){const ge=s[y],T=Array.from(h.querySelectorAll("["+y+"]"));h.matches&&h.matches("["+y+"]")&&T.push(h);for(let q=0;q<T.length;q++){const x=T[q];k(x)&&N(ge,x.getAttribute(y),y,o,x)}}d&&d(h)}const m=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let h;for(;(h=C.exec(e))!==null;)m.push(h[1])}else m.push(e);re({selector:e,attribute:t,componentTag:o,attributes:s,ComponentFn:n,onInit:d,observed:m.concat(i),onAttributeChange:r,onAttrChange:a,effects:u,declared:w,persist:b}),le();const I=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";V().push({selector:e,attribute:t,ComponentFn:n,onInit:d,onSubtreeChange:c,query:I}),de(),window[t]=p;function g(){ne()>0?oe(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),p}function H(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=H(t);if(!o)return n;const l=o.split("&");for(let i=0;i<l.length;i++){const r=l[i];if(!r)continue;const c=r.indexOf(":"),d=c>-1?r.slice(0,c):r,a=c>-1?r.slice(c+1):"";if(d)try{n[d]=decodeURIComponent(a)}catch{n[d]=a}}return n}function ue(e){if(!e)return null;const t=L();return e in t?t[e]:null}function ae(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(i){const r=n[i];return r===""?i:i+":"+encodeURIComponent(r)}).join("&");H(location.hash)!==l&&(location.hash=l)}function fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function we(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 be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function he(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ue,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=fe,window.lnCore.resolveHashNamespace=we,window.lnCore.hashSortEncode=be,window.lnCore.hashSortDecode=he,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=me),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",o="data-ln-modal-close";if(window[t]!==void 0)return;const l={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},i=new Set;let r=null;function c(){r||(r=function(s){if(K(s))return;const u=s.target.closest("["+n+"]");if(!u||U(u))return;const w=u.getAttribute(n);if(!w)return;const b=document.getElementById(w);!b||!b[t]||(s.preventDefault(),u.hasAttribute("data-ln-modal-mode")?b.setAttribute("data-ln-modal-mode",u.getAttribute("data-ln-modal-mode")):b.hasAttribute("data-ln-modal-mode")&&b.setAttribute("data-ln-modal-mode","new"),b.setAttribute(e,"open"))},document.addEventListener("click",r))}function d(){i.size>0||!r||(document.removeEventListener("click",r),r=null)}function a(s){this.dom=s,this.isOpen=s.getAttribute(e)==="open";const u=this;return this._onRequestOpen=function(){u.dom.setAttribute(e,"open")},this._onRequestClose=function(){u.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),u.dom.setAttribute(e,"close")},this._onClose=function(){!u.isOpen||u.dom.getAttribute(e)!=="open"||u.dom.open||(u._isNativeClosing=!0,u.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const b=w.target.closest("["+o+"]");b&&u.dom.contains(b)&&(w.preventDefault(),u.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),i.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),A(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}a.prototype.open=function(){this.dom.setAttribute(e,"open")},a.prototype.close=function(){this.dom.setAttribute(e,"close")},a.prototype.toggle=function(){const s=this.dom.getAttribute(e);this.dom.setAttribute(e,s==="open"?"close":"open")},a.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),i.delete(this),d(),this.isOpen){const s=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==s})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(s){const u=s[t];if(!u)return;const w=!!u._isNativeClosing;u._isNativeClosing=!1;const p=s.getAttribute(e)==="open";if(p===u.isOpen){p&&s.isConnected&&!s.open&&typeof s.showModal=="function"&&s.showModal();return}if(p){if(D(s,"ln-modal:before-open",{modalId:s.id,target:s}).defaultPrevented){s.setAttribute(e,"close");return}u.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof s.showModal=="function"&&s.showModal();const v=s.querySelector("[autofocus]");if(v&&S(v))v.focus();else{const I=s.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),g=Array.prototype.find.call(I,S);if(g)g.focus();else{const C=s.querySelectorAll("a[href], button:not([disabled])"),h=Array.prototype.find.call(C,S);h&&h.focus()}}A(s,"ln-modal:open",{modalId:s.id,target:s})}else{if(!w&&D(s,"ln-modal:before-close",{modalId:s.id,target:s}).defaultPrevented){s.setAttribute(e,"open");return}u.isOpen=!1,s.hasAttribute("data-ln-modal-mode")&&s.setAttribute("data-ln-modal-mode","new"),typeof s.close=="function"&&s.open&&s.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),A(s,"ln-modal:close",{modalId:s.id,target:s})}}ce(e,t,a,"ln-modal",{attributes:l})})()})();
|
|
1
|
+
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function k(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!k(o))return}e.apply(console,t)}}function A(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 M(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 v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function x(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function Z(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ee(e){return!!(!e||e.disabled||typeof e.getAttribute=="function"&&e.getAttribute("aria-disabled")==="true"||typeof e.closest=="function"&&e.closest("[inert]"))}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,r={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(r[i.name]=(r[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")n&&r[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.value}return l}function oe(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=[],l={};for(let s=0;s<n.length;s++){const r=n[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<n.length;s++){const r=n[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const i=t[c];if(r.type==="checkbox"){if(Array.isArray(i))r.checked=i.indexOf(r.value)!==-1;else if(l[r.name]>1){const u=String(i).split(",").map(function(f){return f.trim()});r.checked=u.indexOf(r.value)!==-1}else r.checked=oe(i);o.push(r)}else if(r.type==="radio")r.checked=r.value===String(i),o.push(r);else if(r.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<r.options.length;u++)r.options[u].selected=i.indexOf(r.options[u].value)!==-1;o.push(r)}else r.value=i,r.tagName==="SELECT"&&i!=null&&r.setAttribute("data-ln-value",i),o.push(r)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const $={};function ie(e,t){$[e]=t}function le(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ce(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=se);const S={};function ue(e,t){S[e]||(S[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=S[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 r=0;r<n.length;r++){const c=n[r],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<o.length;r++){const c=o[r],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();t[a]!=null&&c.setAttribute(d,t[a])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const f=i[u].trim().split(":");if(f.length!==2)continue;const d=f[0].trim(),a=f[1].trim();a in t&&c.classList.toggle(d,!!t[a])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function j(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],c=r.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&r.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function fe(e,t,n,o,l,s){const r={};for(let i=0;i<e.children.length;i++){const u=e.children[i],f=u.getAttribute("data-ln-render-key");f&&(r[f]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],f=String(o(u));let d=r[f];if(d)l(d,u,i);else{const a=ue(n,s);if(!a||(j(a,u),d=a.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",f),l(d,u,i)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=fe);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function W(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function U(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 E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(s,r){const c=s.getAttribute(r);return c!==null&&o.has(c)?c:t};return E.set(n,l),l}function K(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function G(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function J(e,t,n,o,l){if(!e||t===null)return!0;const s=o||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(r==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function we(e,t,n){for(const o in n){const[l,s,r]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=H(o.values,o.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=G;break;case"string":default:l=O;break}l||(l=O),t[o.prop]=[l,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=we,window.lnCore.attrSpec=pe,window.lnCore.attrStr=O,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=G);function L(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&r.push(e);for(const c of r)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(i){console.error("["+n+"] init failed",c,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){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 Ce(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=be(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 P(e,t,n,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[n];r?r(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function ye(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=Q(),l=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&k(t)){const s=o.byDeclaredAttr.get(n),r=t.getAttribute(n);for(let c=0;c<s.length;c++)J(s[c].spec,r,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=o.byReactive.get(n);s&&P(s,t,n,e.oldValue),o.reactiveWildcard.length&&P(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,n,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,n):(L(t,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(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 z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ve(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&o.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];L(o,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,c=Array.from(o.querySelectorAll(r));o.matches&&o.matches(r)&&c.push(o);for(let i=0;i<c.length;i++){const u=c[i];if(!document.contains(u)){const f=u[s.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",u,d)}delete u[s.attribute]}}}}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ve(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,f=l.effects||null,d=l.attributes||null,a=d?he(d):f,w=d?new Set(Object.keys(d)):null,p=l.persist||null;function b(C){const h=C||document.body;if(L(h,e,t,n),d&&F())for(const y in d){const Re=d[y],q=Array.from(h.querySelectorAll("["+y+"]"));h.matches&&h.matches("["+y+"]")&&q.push(h);for(let R=0;R<q.length;R++){const D=q[R];k(D)&&J(Re,D.getAttribute(y),y,o,D)}}i&&i(h)}const m=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let h;for(;(h=C.exec(e))!==null;)m.push(h[1])}else m.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:i,observed:m.concat(s),onAttributeChange:r,onAttrChange:u,effects:a,declared:w,persist:p}),Ae();const T=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:T}),_e(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function g(){me()>0?ge(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g(),b}function Y(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const l=o.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const c=r.indexOf(":"),i=c>-1?r.slice(0,c):r,u=c>-1?r.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function xe(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 r=n[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 Le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),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=ke,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Te);function qe(){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=qe),(function(){const e="data-ln-modal",t="lnModal",n="data-ln-modal-for",o="data-ln-modal-close";if(window[t]!==void 0)return;const l={"data-ln-modal":{type:"enum",values:["open","close"],fallback:"close",effect:f,description:"Control state of the modal dialog"},"data-ln-modal-for":{type:"string",description:"Target modal ID to open on trigger click"},"data-ln-modal-mode":{type:"enum",values:["new","edit"],fallback:"new",description:"Operational mode of the modal (new vs edit)"},"data-ln-modal-close":{type:"trigger",description:"Click dismiss trigger inside the modal"}},s=new Set;let r=null;function c(){r||(r=function(d){if(Z(d))return;const a=d.target.closest("["+n+"]");if(!a||ee(a))return;const w=a.getAttribute(n);if(!w)return;const p=document.getElementById(w);!p||!p[t]||(d.preventDefault(),a.hasAttribute("data-ln-modal-mode")?p.setAttribute("data-ln-modal-mode",a.getAttribute("data-ln-modal-mode")):p.hasAttribute("data-ln-modal-mode")&&p.setAttribute("data-ln-modal-mode","new"),p.setAttribute(e,"open"))},document.addEventListener("click",r))}function i(){s.size>0||!r||(document.removeEventListener("click",r),r=null)}function u(d){this.dom=d,this.isOpen=d.getAttribute(e)==="open";const a=this;return this._onRequestOpen=function(){a.dom.setAttribute(e,"open")},this._onRequestClose=function(){a.dom.setAttribute(e,"close")},this._onCancel=function(w){w.preventDefault(),a.dom.setAttribute(e,"close")},this._onClose=function(){!a.isOpen||a.dom.getAttribute(e)!=="open"||a.dom.open||(a._isNativeClosing=!0,a.dom.setAttribute(e,"close"))},this._onClickClose=function(w){const p=w.target.closest("["+o+"]");p&&a.dom.contains(p)&&(w.preventDefault(),a.dom.setAttribute(e,"close"))},this.dom.addEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.addEventListener("ln-modal:request-close",this._onRequestClose),this.dom.addEventListener("cancel",this._onCancel),this.dom.addEventListener("close",this._onClose),this.dom.addEventListener("click",this._onClickClose),s.add(this),c(),this.isOpen&&(typeof this.dom.showModal=="function"&&this.dom.showModal(),document.body.classList.add("ln-modal-open"),A(this.dom,"ln-modal:open",{modalId:this.dom.id,target:this.dom})),this}u.prototype.open=function(){this.dom.setAttribute(e,"open")},u.prototype.close=function(){this.dom.setAttribute(e,"close")},u.prototype.toggle=function(){const d=this.dom.getAttribute(e);this.dom.setAttribute(e,d==="open"?"close":"open")},u.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("ln-modal:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-modal:request-close",this._onRequestClose),this.dom.removeEventListener("cancel",this._onCancel),this.dom.removeEventListener("close",this._onClose),this.dom.removeEventListener("click",this._onClickClose),s.delete(this),i(),this.isOpen){const d=this.dom;Array.prototype.some.call(document.querySelectorAll("["+e+'="open"]'),function(w){return w!==d})||document.body.classList.remove("ln-modal-open")}delete this.dom[t]}};function f(d){const a=d[t];if(!a)return;const w=!!a._isNativeClosing;a._isNativeClosing=!1;const b=d.getAttribute(e)==="open";if(b===a.isOpen){b&&d.isConnected&&!d.open&&typeof d.showModal=="function"&&d.showModal();return}if(b){if(M(d,"ln-modal:before-open",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"close");return}a.isOpen=!0,document.body.classList.add("ln-modal-open"),typeof d.showModal=="function"&&d.showModal();const _=d.querySelector("[autofocus]");if(_&&x(_))_.focus();else{const T=d.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'),g=Array.prototype.find.call(T,x);if(g)g.focus();else{const C=d.querySelectorAll("a[href], button:not([disabled])"),h=Array.prototype.find.call(C,x);h&&h.focus()}}A(d,"ln-modal:open",{modalId:d.id,target:d})}else{if(!w&&M(d,"ln-modal:before-close",{modalId:d.id,target:d}).defaultPrevented){d.setAttribute(e,"open");return}a.isOpen=!1,d.hasAttribute("data-ln-modal-mode")&&d.setAttribute("data-ln-modal-mode","new"),typeof d.close=="function"&&d.open&&d.close(),document.querySelector("["+e+'="open"]')||document.body.classList.remove("ln-modal-open"),A(d,"ln-modal:close",{modalId:d.id,target:d})}}X(e,t,u,"ln-modal",{attributes:l})})()})();
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
-
"component": "ln-modal",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-modal-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-modal": {
|
|
13
|
-
"direction": "both",
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-modal-dev.scss",
|
|
16
|
-
"ln-modal.scss",
|
|
17
|
-
"src/ln-modal.js"
|
|
18
|
-
],
|
|
19
|
-
"type": "enum",
|
|
20
|
-
"values": [
|
|
21
|
-
"open",
|
|
22
|
-
"close"
|
|
23
|
-
],
|
|
24
|
-
"fallback": "close",
|
|
25
|
-
"description": "Control state of the modal dialog"
|
|
26
|
-
},
|
|
27
|
-
"data-ln-modal-close": {
|
|
28
|
-
"direction": "author",
|
|
29
|
-
"sources": [
|
|
30
|
-
"src/ln-modal.js"
|
|
31
|
-
],
|
|
32
|
-
"type": "trigger",
|
|
33
|
-
"description": "Click dismiss trigger inside the modal"
|
|
34
|
-
},
|
|
35
|
-
"data-ln-modal-for": {
|
|
36
|
-
"direction": "author",
|
|
37
|
-
"sources": [
|
|
38
|
-
"ln-modal-dev.scss",
|
|
39
|
-
"src/ln-modal.js"
|
|
40
|
-
],
|
|
41
|
-
"type": "string",
|
|
42
|
-
"description": "Target modal ID to open on trigger click"
|
|
43
|
-
},
|
|
44
|
-
"data-ln-modal-mode": {
|
|
45
|
-
"direction": "both",
|
|
46
|
-
"sources": [
|
|
47
|
-
"ln-modal.scss",
|
|
48
|
-
"src/ln-modal.js"
|
|
49
|
-
],
|
|
50
|
-
"type": "enum",
|
|
51
|
-
"values": [
|
|
52
|
-
"new",
|
|
53
|
-
"edit"
|
|
54
|
-
],
|
|
55
|
-
"fallback": "new",
|
|
56
|
-
"description": "Operational mode of the modal (new vs edit)"
|
|
57
|
-
},
|
|
58
|
-
"data-ln-modal-when": {
|
|
59
|
-
"direction": null,
|
|
60
|
-
"sources": [
|
|
61
|
-
"ln-modal.scss"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
+
"component": "ln-modal",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-modal-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-modal": {
|
|
13
|
+
"direction": "both",
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-modal-dev.scss",
|
|
16
|
+
"ln-modal.scss",
|
|
17
|
+
"src/ln-modal.js"
|
|
18
|
+
],
|
|
19
|
+
"type": "enum",
|
|
20
|
+
"values": [
|
|
21
|
+
"open",
|
|
22
|
+
"close"
|
|
23
|
+
],
|
|
24
|
+
"fallback": "close",
|
|
25
|
+
"description": "Control state of the modal dialog"
|
|
26
|
+
},
|
|
27
|
+
"data-ln-modal-close": {
|
|
28
|
+
"direction": "author",
|
|
29
|
+
"sources": [
|
|
30
|
+
"src/ln-modal.js"
|
|
31
|
+
],
|
|
32
|
+
"type": "trigger",
|
|
33
|
+
"description": "Click dismiss trigger inside the modal"
|
|
34
|
+
},
|
|
35
|
+
"data-ln-modal-for": {
|
|
36
|
+
"direction": "author",
|
|
37
|
+
"sources": [
|
|
38
|
+
"ln-modal-dev.scss",
|
|
39
|
+
"src/ln-modal.js"
|
|
40
|
+
],
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Target modal ID to open on trigger click"
|
|
43
|
+
},
|
|
44
|
+
"data-ln-modal-mode": {
|
|
45
|
+
"direction": "both",
|
|
46
|
+
"sources": [
|
|
47
|
+
"ln-modal.scss",
|
|
48
|
+
"src/ln-modal.js"
|
|
49
|
+
],
|
|
50
|
+
"type": "enum",
|
|
51
|
+
"values": [
|
|
52
|
+
"new",
|
|
53
|
+
"edit"
|
|
54
|
+
],
|
|
55
|
+
"fallback": "new",
|
|
56
|
+
"description": "Operational mode of the modal (new vs edit)"
|
|
57
|
+
},
|
|
58
|
+
"data-ln-modal-when": {
|
|
59
|
+
"direction": null,
|
|
60
|
+
"sources": [
|
|
61
|
+
"ln-modal.scss"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function E(){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 r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!m(r))return}e.apply(console,t)}}function $(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 V(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const N={};function P(e,t){N[e]=t}function U(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=P,window.lnCore.getDataMapper=U);function Q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function J(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function K(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=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=Q);const v={};function z(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function D(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],a=s.getAttribute("data-ln-field");t[a]!=null&&(s.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const s=r[l],a=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<a.length;c++){const d=a[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const s=o[l],a=s.getAttribute("data-ln-show");a in t&&s.classList.toggle("hidden",!t[a])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const s=i[l],a=s.getAttribute("data-ln-class").split(",");for(let c=0;c<a.length;c++){const d=a[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function G(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)D(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function I(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],s=l.attributes;for(let a=0;a<s.length;a++){const c=s[a];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function X(e,t,n,r,o,i){const l={};for(let a=0;a<e.children.length;a++){const c=e.children[a],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const s=document.createDocumentFragment();for(let a=0;a<t.length;a++){const c=t[a],d=String(r(c));let u=l[d];if(u)o(u,c,a);else{const f=z(n,i);if(!f||(I(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),o(u,c,a)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=D,window.lnCore.lnFill=G,window.lnCore.renderList=X);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Y(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function q(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function Z(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const A=new Map;function ee(e,t){const n=(e?e.join("|"):"")+"::"+t;if(A.has(n))return A.get(n);const r=new Set(e||[]),o=function(i,l){const s=i.getAttribute(l);return s!==null&&r.has(s)?s:t};return A.set(n,o),o}function te(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ne(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function M(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=a=>{o?console.warn(a,o):console.warn(a)};if(l==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(s(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const a=e.values||[];return a.includes(t)?!0:(s(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(s(`[${i}] Value ${a} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(s(`[${i}] Value ${a} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(a){return s(`[${i}] Invalid JSON for attribute "${n}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=ee(r.values,r.fallback);break;case"integer":o=Y;break;case"float":o=te;break;case"boolean":o=q;break;case"list":o=Z;break;case"json":o=ne;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function ie(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 le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function _(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const s of l)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new r(s)}catch(a){console.error("["+n+"] init failed",s,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function se(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function F(){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=F(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=le(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function W(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function ue(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=F(),o=r.byAttr.get(n);if(E()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&m(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let s=0;s<i.length;s++)M(i[s].spec,l,n,i[s].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&W(i,t,n,e.oldValue),r.reactiveWildcard.length&&W(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(_(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ue(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 j(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function fe(e){const t=j();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];_(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,s=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&s.push(r);for(let a=0;a<s.length;a++){const c=s[a];if(!document.contains(c)){const d=c[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+i.attribute+"] destroy failed",c,u)}delete c[i.attribute]}}}}}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{fe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function he(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,s=o.onSubtreeChange||null,a=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,u=o.attributes||null,f=u?ie(u):d,w=u?new Set(Object.keys(u)):null,p=o.persist||null;function b(S){const h=S||document.body;if(_(h,e,t,n),u&&E())for(const C in u){const ke=u[C],O=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&O.push(h);for(let x=0;x<O.length;x++){const L=O[x];m(L)&&M(ke,L.getAttribute(C),C,r,L)}}a&&a(h)}const g=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let h;for(;(h=S.exec(e))!==null;)g.push(h[1])}else g.push(e);ce({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:a,observed:g.concat(i),onAttributeChange:l,onAttrChange:c,effects:f,declared:w,persist:p}),de();const _e=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";j().push({selector:e,attribute:t,ComponentFn:n,onInit:a,onSubtreeChange:s,query:_e}),we(),window[t]=b;function H(){se()>0?ae(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H):H(),b}function B(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},r=B(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const s=l.indexOf(":"),a=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(a)try{n[a]=decodeURIComponent(c)}catch{n[a]=c}}return n}function be(e){if(!e)return null;const t=k();return e in t?t[e]:null}function pe(e,t){if(!e)return;const n=k();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");B(location.hash)!==o&&(location.hash=o)}function ge(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function me(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ve(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ae(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=be,window.lnCore.hashSet=pe,window.lnCore.hashLinkClick=ge,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=me,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=Ae),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const n={"data-ln-nav":{effect:l,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:q,effect:l,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},r=oe(n);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const s=history.pushState;history.pushState=function(){s.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const a=history.replaceState;history.replaceState=function(){a.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function o(s){return this.dom=s,re(this,s,r),this.activeClass=s.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=new MutationObserver(()=>this.update()),this.observer.observe(s,{childList:!0,subtree:!0}),this.update(),this}o.prototype.update=function(){if(!this.activeClass||V(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const a=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,d=i(c),u=[];for(const f of a){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const p=i(w),b=p===d,g=!this.exact&&p!=="/"&&d.startsWith(p+"/");b||g?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),u.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}$(this.dom,"ln-nav:update",{target:this.dom,activeLinks:u})},o.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const s=history._lnNavCallbacks.indexOf(this.updateHandler);s!==-1&&history._lnNavCallbacks.splice(s,1),delete this.dom[t]};function i(s){try{return new URL(s,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return s.replace(/\/$/,"")||"/"}}function l(s,a){const c=s[t];if(c){if(a===e){if(!s.hasAttribute(e)){c.destroy();return}const d=c.activeClass,u=s.getAttribute(e)||"active";if(d!==u){const f=s.querySelectorAll("a");for(const w of f)d&&w.classList.remove(d);c.activeClass=u}}c.update()}}he(e,t,o,"ln-nav",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!y(r))return}e.apply(console,t)}}function I(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function X(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const o=s[a];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<s.length;a++){const o=s[a];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&l[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 c=0;c<o.options.length;c++)o.options[c].selected&&i[o.name].push(o.options[c].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const c=Number(o.value);i[o.name]=o.value===""||isNaN(c)?null:c}else i[o.name]=o.value}return i}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const o=t[a];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(o).split(",").map(function(u){return u.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=ee(o);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let c=0;c<l.options.length;c++)l.options[c].selected=o.indexOf(l.options[c].value)!==-1;r.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),r.push(l)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const T={};function ne(e,t){T[e]=t}function re(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function ie(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const v={};function se(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],o=a.getAttribute("data-ln-field");t[o]!=null&&(a.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],o=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],o=a.getAttribute("data-ln-show");o in t&&a.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],o=a.getAttribute("data-ln-class").split(",");for(let c=0;c<o.length;c++){const u=o[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function 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 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)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function 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,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let o=0;o<a.length;o++){const c=a[o];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ce(e,t,n,r,i,s){const l={};for(let o=0;o<e.children.length;o++){const c=e.children[o],u=c.getAttribute("data-ln-render-key");u&&(l[u]=c)}const a=document.createDocumentFragment();for(let o=0;o<t.length;o++){const c=t[o],u=String(r(c));let d=l[u];if(d)i(d,c,o);else{const f=se(n,s);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,o)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=F,window.lnCore.lnFill=ae,window.lnCore.renderList=ce);function A(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function x(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 q(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const k=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(k.has(n))return k.get(n);const r=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&r.has(a)?a:t};return k.set(n,i),i}function B(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function W(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function H(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=o=>{i?console.warn(o,i):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(a(`[${s}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(a(`[${s}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return a(`[${s}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,n){for(const r in n){const[i,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function V(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=j(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=B;break;case"boolean":i=x;break;case"list":i=q;break;case"json":i=W;break;case"string":default:i=A;break}i||(i=A),t[r.prop]=[i,n,r.fallback]}return t}function ue(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function de(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=U,window.lnCore.attrSpec=V,window.lnCore.attrStr=A,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=q,window.lnCore.attrEnum=j,window.lnCore.attrFloat=B,window.lnCore.attrJson=W);function _(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(o){console.error("["+n+"] init failed",a,o)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=P(),n=e.observed||[];for(let 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=de(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 z(e,t,n,r){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,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=P(),i=r.byAttr.get(n);if($()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&y(t)){const s=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<s.length;a++)H(s[a].spec,l,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&z(s,t,n,e.oldValue),r.reactiveWildcard.length&&z(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const l=i[s];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(_(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function J(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=J();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];_(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],l=s.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let o=0;o<a.length;o++){const c=a[o];if(!document.contains(c)){const u=c[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ge(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function K(e,t,n,r,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,o=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?ue(d):u,w=d?new Set(Object.keys(d)):null,b=i.persist||null;function p(O){const h=O||document.body;if(_(h,e,t,n),d&&$())for(const C in d){const Ee=d[C],L=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&L.push(h);for(let E=0;E<L.length;E++){const N=L[E];y(N)&&H(Ee,N.getAttribute(C),C,r,N)}}o&&o(h)}const g=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let h;for(;(h=O.exec(e))!==null;)g.push(h[1])}else g.push(e);he({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:o,observed:g.concat(s),onAttributeChange:l,onAttrChange:c,effects:f,declared:w,persist:b}),be();const Le=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";J().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:a,query:Le}),Ce(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=K);function G(){fe()>0?we(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),p}function Q(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=Q(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),o=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(o)try{n[o]=decodeURIComponent(c)}catch{n[o]=c}}return n}function me(e){if(!e)return null;const t=S();return e in t?t[e]:null}function ye(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("&");Q(location.hash)!==i&&(location.hash=i)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ae(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(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=S,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Ae,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Se);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const n={"data-ln-nav":{effect:l,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:x,effect:l,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},r=V(n);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const a=history.pushState;history.pushState=function(){a.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const o=history.replaceState;history.replaceState=function(){o.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function i(a){return this.dom=a,U(this,a,r),this.activeClass=a.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=new MutationObserver(()=>this.update()),this.observer.observe(a,{childList:!0,subtree:!0}),this.update(),this}i.prototype.update=function(){if(!this.activeClass||X(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const o=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,u=s(c),d=[];for(const f of o){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const b=s(w),p=b===u,g=!this.exact&&b!=="/"&&u.startsWith(b+"/");p||g?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),d.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}I(this.dom,"ln-nav:update",{target:this.dom,activeLinks:d})},i.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const a=history._lnNavCallbacks.indexOf(this.updateHandler);a!==-1&&history._lnNavCallbacks.splice(a,1),delete this.dom[t]};function s(a){try{return new URL(a,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return a.replace(/\/$/,"")||"/"}}function l(a,o){const c=a[t];if(c){if(o===e){if(!a.hasAttribute(e)){c.destroy();return}const u=c.activeClass,d=a.getAttribute(e)||"active";if(u!==d){const f=a.querySelectorAll("a");for(const w of f)u&&w.classList.remove(u);c.activeClass=d}}c.update()}}K(e,t,i,"ln-nav",{attributes:n})})()})();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
-
"component": "ln-nav",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-nav": {
|
|
7
|
-
"direction": "author",
|
|
8
|
-
"sources": [
|
|
9
|
-
"src/ln-nav.js"
|
|
10
|
-
],
|
|
11
|
-
"type": "string",
|
|
12
|
-
"fallback": "active",
|
|
13
|
-
"description": "CSS class name applied to active navigation links"
|
|
14
|
-
},
|
|
15
|
-
"data-ln-nav-exact": {
|
|
16
|
-
"direction": null,
|
|
17
|
-
"sources": [
|
|
18
|
-
"src/ln-nav.js"
|
|
19
|
-
],
|
|
20
|
-
"type": "boolean",
|
|
21
|
-
"fallback": false,
|
|
22
|
-
"description": "Match exact URL pathname instead of prefix matching"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
+
"component": "ln-nav",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-nav": {
|
|
7
|
+
"direction": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"src/ln-nav.js"
|
|
10
|
+
],
|
|
11
|
+
"type": "string",
|
|
12
|
+
"fallback": "active",
|
|
13
|
+
"description": "CSS class name applied to active navigation links"
|
|
14
|
+
},
|
|
15
|
+
"data-ln-nav-exact": {
|
|
16
|
+
"direction": null,
|
|
17
|
+
"sources": [
|
|
18
|
+
"src/ln-nav.js"
|
|
19
|
+
],
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"fallback": false,
|
|
22
|
+
"description": "Match exact URL pathname instead of prefix matching"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function H(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function k(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!k(r))return}e.apply(console,t)}}function A(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e,t,{get:i,set:r}){Object.defineProperty(e,"value",{get:function(){return i?i.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,l=>t.set.call(this,l)):t.set.call(this,o)},configurable:!0})}const V={};function z(e,t){V[e]=t}function X(e){return V[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=z,window.lnCore.getDataMapper=X);function y(e){const t=e?e.closest("[lang]"):null,i=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return i?i.trim():"en-US"}function M(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function Y(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];j[i]=t}function Z(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Y,window.lnCore.getLocaleFallback=Z,window.lnCore.ensureLocaleObserver=M);const O={};function ee(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=O[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const s=i[n],a=s.getAttribute("data-ln-field");t[a]!=null&&(s.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<r.length;n++){const s=r[n],a=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<a.length;d++){const u=a[d].trim().split(":");if(u.length!==2)continue;const c=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(c,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let n=0;n<o.length;n++){const s=o[n],a=s.getAttribute("data-ln-show");a in t&&s.classList.toggle("hidden",!t[a])}const l=e.querySelectorAll("[data-ln-class]");for(let n=0;n<l.length;n++){const s=l[n],a=s.getAttribute("data-ln-class").split(",");for(let d=0;d<a.length;d++){const u=a[d].trim().split(":");if(u.length!==2)continue;const c=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(c,!!t[f])}}return e}function te(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function W(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const l=i.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const r=function(l,n){return t[n]!==void 0?t[n]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let l=0;l<o.length;l++){const n=o[l],s=n.attributes;for(let a=0;a<s.length;a++){const d=s[a];d.value.indexOf("{{")!==-1&&n.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ne(e,t,i,r,o,l){const n={};for(let a=0;a<e.children.length;a++){const d=e.children[a],u=d.getAttribute("data-ln-render-key");u&&(n[u]=d)}const s=document.createDocumentFragment();for(let a=0;a<t.length;a++){const d=t[a],u=String(r(d));let c=n[u];if(c)o(c,d,a);else{const f=ee(i,l);if(!f||(W(f,d),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",u),o(c,d,a)}s.appendChild(c)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=q,window.lnCore.lnFill=te,window.lnCore.renderList=ne);function B(e,t,i,r,o){if(!e||t===null)return!0;const l=r||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=a=>{o?console.warn(a,o):console.warn(a)};if(n==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(s(`[${l}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const a=e.values||[];return a.includes(t)?!0:(s(`[${l}] Invalid value "${t}" for attribute "${i}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${l}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(s(`[${l}] Value ${a} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(s(`[${l}] Value ${a} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${l}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(a){return s(`[${l}] Invalid JSON for attribute "${i}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function re(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}function T(e,t,i,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&n.push(e);for(const s of n)if(!s[i]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[i]=new r(s)}catch(a){console.error("["+i+"] init failed",s,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function le(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function se(e){const t=P(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(l=>l.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=re(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function K(e,t,i,r){for(let o=0;o<e.length;o++){const l=e[o];if(!t[l.attribute])continue;const n=l.effects&&l.effects[i];n?n(t,i,r):l.onAttrChange&&(!l.declared||l.declared.has(i))&&l.onAttrChange(t,i,r)}}function ae(e){const t=e.target,i=e.attributeName;if(e.oldValue===t.getAttribute(i))return;const r=P(),o=r.byAttr.get(i);if(H()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(i)&&k(t)){const l=r.byDeclaredAttr.get(i),n=t.getAttribute(i);for(let s=0;s<l.length;s++)B(l[s].spec,n,i,l[s].componentTag,t)}if(window.lnCore._debugSink&&(i.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",i,t,{oldValue:e.oldValue,newValue:t.getAttribute(i)}),i.indexOf("data-ln-")===0){const l=r.byReactive.get(i);l&&K(l,t,i,e.oldValue),r.reactiveWildcard.length&&K(r.reactiveWildcard,t,i,e.oldValue)}if(o)for(let l=0;l<o.length;l++){const n=o[l];if(n.handler){n.handler(t,i,e.oldValue);continue}n.onAttributeChange&&t[n.attribute]?n.onAttributeChange(t,i):(T(t,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(t))}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{ae(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function U(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ce(e){const t=U();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange){const o=r.query,l=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;l&&r.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const l=t[o];T(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const l=t[o],n=l.query,s=Array.from(r.querySelectorAll(n));r.matches&&r.matches(n)&&s.push(r);for(let a=0;a<s.length;a++){const d=s[a];if(!document.contains(d)){const u=d[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(c){console.error("["+l.attribute+"] destroy failed",d,c)}delete d[l.attribute]}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{ce(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function fe(e,t,i,r,o={}){const l=o.extraAttributes||[],n=o.onAttributeChange||null,s=o.onSubtreeChange||null,a=o.onInit||null,d=o.onAttrChange||null,u=o.effects||null,c=o.attributes||null,f=c?ie(c):u,p=c?new Set(Object.keys(c)):null,w=o.persist||null;function m(N){const h=N||document.body;if(T(h,e,t,i),c&&H())for(const g in c){const R=c[g],L=Array.from(h.querySelectorAll("["+g+"]"));h.matches&&h.matches("["+g+"]")&&L.push(h);for(let I=0;I<L.length;I++){const $=L[I];k($)&&B(R,$.getAttribute(g),g,r,$)}}a&&a(h)}const b=[];if(e.indexOf("[")!==-1){const N=/\[([\w-]+)/g;let h;for(;(h=N.exec(e))!==null;)b.push(h[1])}else b.push(e);se({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:i,onInit:a,observed:b.concat(l),onAttributeChange:n,onAttrChange:d,effects:f,declared:p,persist:w}),ue();const D=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";U().push({selector:e,attribute:t,ComponentFn:i,onInit:a,onSubtreeChange:s,query:D}),de(),window[t]=m;function v(){oe()>0?le(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),m}function G(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,i={},r=G(t);if(!r)return i;const o=r.split("&");for(let l=0;l<o.length;l++){const n=o[l];if(!n)continue;const s=n.indexOf(":"),a=s>-1?n.slice(0,s):n,d=s>-1?n.slice(s+1):"";if(a)try{i[a]=decodeURIComponent(d)}catch{i[a]=d}}return i}function he(e){if(!e)return null;const t=F();return e in t?t[e]:null}function we(e,t){if(!e)return;const i=F();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(l){const n=i[l];return n===""?l:l+":"+encodeURIComponent(n)}).join("&");G(location.hash)!==o&&(location.hash=o)}function pe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function me(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ge(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function ye(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ce(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=he,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=pe,window.lnCore.resolveHashNamespace=me,window.lnCore.hashSortEncode=be,window.lnCore.hashSortDecode=ge,window.lnCore.hashFilterEncode=ye,window.lnCore.hashFilterDecode=Ce);const C={};function S(e){const t=e||"default";if(!C[t]){const i=new Intl.NumberFormat(e,{useGrouping:!0}),r=i.formatToParts(1234.5);let o="",l=".";for(let n=0;n<r.length;n++)r[n].type==="group"&&(o=r[n].value),r[n].type==="decimal"&&(l=r[n].value);C[t]={groupSep:o,decimalSep:l,fmt:i}}return C[t]}function Q(e,t,i){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),i&&i!=="."&&(r=r.replace(i,".")),r=r.replace(/[^\d.-]/g,""),r)}function _e(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const i=e.trim();if(i===""||i==="-")return NaN;const r=S(t),o=Q(i,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const l=parseFloat(o);return isNaN(l)?NaN:l}function _(e,t,i={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=i.maxDecimals!=null?parseInt(i.maxDecimals,10):null,l=i.userDecimals!=null?i.userDecimals:null;if(o!==null){const n=r+"|max:"+o;return C[n]||(C[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),C[n].format(e)}if(l!==null&&l>0){const n=r+"|exact:"+l;return C[n]||(C[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:l,maximumFractionDigits:l})),C[n].format(e)}return S(t).fmt.format(e)}function Ae(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let i=t,r=0;for(let o=0;o<e.length&&i>0;o++)r=o+1,/[0-9]/.test(e[o])&&i--;return i>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function i(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const r={"data-ln-number":{type:"marker",effect:i,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:i,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:i,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:i,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:i,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function l(n){if(n[t])return n[t];n[t]=this,this.dom=n;const s=this;if(this._onLocaleChange=function(){s.isTextElement?s._formatTextContent():isNaN(s.value)||s._displayFormatted(s.value)},M(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const a=document.createElement("input");a.type="hidden",a.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&a.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",a),this._hidden=a,Object.defineProperty(a,"value",{get:function(){return o.get.call(a)},set:function(u){if(o.set.call(a,u),u!==""&&!isNaN(parseFloat(u))){const c=s.dom.getAttribute("data-ln-number-decimals");s._setDisplayRaw(_(parseFloat(u),y(s.dom),{maxDecimals:c}))}else s._setDisplayRaw("");s.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),J(n,o,{get:function(){return o.get.call(n)},set:function(u){if(u===""){s._setDisplayRaw(""),s._setHiddenRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}));return}const c=typeof u=="number"?u:parseFloat(String(u));if(isNaN(c))s._setDisplayRaw(String(u)),s._setHiddenRaw("");else{s._setHiddenRaw(c);const f=n.getAttribute("data-ln-number-decimals");s._setDisplayRaw(_(c,y(n),{maxDecimals:f}))}n.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){s._handleInput()},n.addEventListener("input",this._onInput),this._onKeyDown=function(u){if(u.key!=="Backspace")return;const c=n.selectionStart,f=n.selectionEnd;if(c!==f||c===0)return;const p=S(y(n)),w=o.get.call(n),m=w[c-1];if(m===p.groupSep||/\s/.test(m)){u.preventDefault();const b=c-2>=0?c-2:0,x=w.slice(0,b)+w.slice(c);o.set.call(n,x),n.setSelectionRange(b,b),n.dispatchEvent(new Event("input",{bubbles:!0}))}},n.addEventListener("keydown",this._onKeyDown),this._onPaste=function(u){u.preventDefault();const c=(u.clipboardData||window.clipboardData).getData("text"),f=_e(c,y(n));s.value=isNaN(f)?NaN:f},n.addEventListener("paste",this._onPaste);const d=n.value;if(d!==""){const u=parseFloat(d);if(!isNaN(u)){const c=n.getAttribute("data-ln-number-decimals");this._setHiddenRaw(u),this._setDisplayRaw(_(u,y(n),{maxDecimals:c})),n.dispatchEvent(new Event("input",{bubbles:!0}))}}return this}l.prototype._initTextElement=function(){const n=this.dom;let s=n.getAttribute("data-ln-value"),a=n.getAttribute("data-ln-number"),d=null;s!==null&&s!==""?d=s:a!==null&&a!==""&&a!=="true"?d=a:d=n.textContent.trim();const u=parseFloat(d);isNaN(u)?this._rawValue=null:(this._rawValue=u,n.hasAttribute("data-ln-value")||n.setAttribute("data-ln-value",String(u)),this._formatTextContent())},l.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const n=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=_(this._rawValue,y(this.dom),{maxDecimals:n})}},l.prototype._handleInput=function(){const n=this.dom,s=o.get.call(n);if(s===""){this._setHiddenRaw(""),A(n,"ln-number:input",{value:NaN,formatted:""});return}if(s==="-"){this._setHiddenRaw(""),A(n,"ln-number:input",{value:NaN,formatted:"-"});return}const a=n.selectionStart;let d=0;for(let h=0;h<a;h++)/[0-9]/.test(s[h])&&d++;const u=y(n),c=S(u);let f=s,p=Q(s,c.groupSep,c.decimalSep),w=parseFloat(p);if(isNaN(w)){this._setHiddenRaw(""),A(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=p.indexOf(".");if(m!==null&&b!==-1){const h=parseInt(m,10),g=p.slice(b+1);if(h===0)p=p.slice(0,b),f=f.split(c.decimalSep)[0],w=parseFloat(p),this._setDisplayRaw(f);else if(g.length>h){p=p.slice(0,b+1+h);const R=f.split(c.decimalSep);f=R[0]+c.decimalSep+R[1].slice(0,h),w=parseFloat(p),this._setDisplayRaw(f)}}const x=n.getAttribute("data-ln-number-max");if(x!==null&&w>parseFloat(x)){const h=parseFloat(x),g=_(h,u,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(h),n.setSelectionRange(g.length,g.length),A(n,"ln-number:input",{value:h,formatted:g});return}if(f.endsWith(c.decimalSep)||c.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(w),A(n,"ln-number:input",{value:w,formatted:f});return}const D=p.indexOf(".");if(D!==-1&&p.slice(D+1).endsWith("0")){this._setHiddenRaw(w),A(n,"ln-number:input",{value:w,formatted:f});return}let v;if(m!==null)v=_(w,u,{maxDecimals:m});else{const h=D!==-1?p.slice(D+1).length:0;v=_(w,u,{userDecimals:h})}this._setDisplayRaw(v);const N=Ae(v,d);n.setSelectionRange(N,N),this._setHiddenRaw(w),A(n,"ln-number:input",{value:w,formatted:v})},l.prototype._setHiddenRaw=function(n){this._hidden&&o.set.call(this._hidden,String(n))},l.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):o.set.call(this.dom,String(n))},l.prototype._displayFormatted=function(n){if(this.isTextElement)this._formatTextContent();else{const s=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(_(n,y(this.dom),{maxDecimals:s}))}},Object.defineProperty(l.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const n=o.get.call(this._hidden);return n===""?NaN:parseFloat(n)},set:function(n){const s=typeof n=="number"?n:parseFloat(n);if(this.isTextElement){isNaN(s)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=s,this.dom.setAttribute("data-ln-value",String(s)),this._formatTextContent());return}if(isNaN(s)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(s);const a=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(_(s,y(this.dom),{maxDecimals:a})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(l.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),l.prototype.destroy=function(){this.dom[t]&&(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},fe(e,t,l,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:i})})()})();
|
|
1
|
+
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function R(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!R(r))return}e.apply(console,t)}}function x(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,n={};if(i)for(let s=0;s<a.length;s++){const l=a[s];l.name&&l.type==="checkbox"&&!l.disabled&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<a.length;s++){const l=a[s];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")i&&n[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(i&&l.type==="hidden")o[l.name]=l.value;else if(i&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const i=e.elements,r=[],o={};for(let a=0;a<i.length;a++){const n=i[a];n.name&&n.type==="checkbox"&&(o[n.name]=(o[n.name]||0)+1)}for(let a=0;a<i.length;a++){const n=i[a];if(n.type==="file"||n.type==="submit"||n.type==="button")continue;const s=n.getAttribute("data-ln-fill-as")||n.name;if(!s||!(s in t))continue;const l=t[s];if(n.type==="checkbox"){if(Array.isArray(l))n.checked=l.indexOf(n.value)!==-1;else if(o[n.name]>1){const u=String(l).split(",").map(function(c){return c.trim()});n.checked=u.indexOf(n.value)!==-1}else n.checked=le(l);r.push(n)}else if(n.type==="radio")n.checked=n.value===String(l),r.push(n);else if(n.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<n.options.length;u++)n.options[u].selected=l.indexOf(n.options[u].value)!==-1;r.push(n)}else n.value=l,n.tagName==="SELECT"&&l!=null&&n.setAttribute("data-ln-value",l),r.push(n)}return r}function ae(e,t,{get:i,set:r}){Object.defineProperty(e,"value",{get:function(){return i?i.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const V={};function ue(e,t){V[e]=t}function ce(e){return V[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=ce);function y(e){const t=e?e.closest("[lang]"):null,i=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return i?i.trim():"en-US"}function B(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const q={};function de(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];q[i]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return q[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=B);const F={};function we(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=F[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const s=i[n],l=s.getAttribute("data-ln-field");t[l]!=null&&(s.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<r.length;n++){const s=r[n],l=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let n=0;n<o.length;n++){const s=o[n],l=s.getAttribute("data-ln-show");l in t&&s.classList.toggle("hidden",!t[l])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],l=s.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function P(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,n){return t[n]!==void 0?t[n]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const n=o[a],s=n.attributes;for(let l=0;l<s.length;l++){const u=s[l];u.value.indexOf("{{")!==-1&&n.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function he(e,t,i,r,o,a){const n={};for(let l=0;l<e.children.length;l++){const u=e.children[l],c=u.getAttribute("data-ln-render-key");c&&(n[c]=u)}const s=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],c=String(r(u));let d=n[c];if(d)o(d,u,l);else{const f=we(i,a);if(!f||(P(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),o(d,u,l)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=W,window.lnCore.lnFill=pe,window.lnCore.renderList=he);function O(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function U(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function K(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const L=new Map;function J(e,t){const i=(e?e.join("|"):"")+"::"+t;if(L.has(i))return L.get(i);const r=new Set(e||[]),o=function(a,n){const s=a.getAttribute(n);return s!==null&&r.has(s)?s:t};return L.set(i,o),o}function Q(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function z(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function X(e,t,i,r,o){if(!e||t===null)return!0;const a=r||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=l=>{o?console.warn(l,o):console.warn(l)};if(n==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const l=e.values||[];return l.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(s(`[${a}] Value ${l} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(s(`[${a}] Value ${l} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(l){return s(`[${a}] Invalid JSON for attribute "${i}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,i){for(const r in i){const[o,a,n]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,a,n)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=J(r.values,r.fallback);break;case"integer":o=U;break;case"float":o=Q;break;case"boolean":o=K;break;case"list":o=G;break;case"json":o=z;break;case"string":default:o=O;break}o||(o=O),t[r.prop]=[o,i,r.fallback]}return t}function ge(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=be,window.lnCore.attrStr=O,window.lnCore.attrInt=U,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=J,window.lnCore.attrFloat=Q,window.lnCore.attrJson=z);function T(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&n.push(e);for(const s of n)if(!s[i]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[i]=new r(s)}catch(l){console.error("["+i+"] init failed",s,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function xe(e){const t=Y(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ye(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,i,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const n=a.effects&&a.effects[i];n?n(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function ve(e){const t=e.target,i=e.attributeName;if(e.oldValue===t.getAttribute(i))return;const r=Y(),o=r.byAttr.get(i);if(M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(i)&&R(t)){const a=r.byDeclaredAttr.get(i),n=t.getAttribute(i);for(let s=0;s<a.length;s++)X(a[s].spec,n,i,a[s].componentTag,t)}if(window.lnCore._debugSink&&(i.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",i,t,{oldValue:e.oldValue,newValue:t.getAttribute(i)}),i.indexOf("data-ln-")===0){const a=r.byReactive.get(i);a&&Z(a,t,i,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,t,i,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const n=o[a];if(n.handler){n.handler(t,i,e.oldValue);continue}n.onAttributeChange&&t[n.attribute]?n.onAttributeChange(t,i):(T(t,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(t))}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{ve(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ee(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ne(e){const t=ee();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange){const o=r.query,a=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;a&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o];T(r,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(r)}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1)for(let o=0;o<t.length;o++){const a=t[o],n=a.query,s=Array.from(r.querySelectorAll(n));r.matches&&r.matches(n)&&s.push(r);for(let l=0;l<s.length;l++){const u=s[l];if(!document.contains(u)){const c=u[a.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",u,d)}delete u[a.attribute]}}}}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{Ne(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function te(e,t,i,r,o={}){const a=o.extraAttributes||[],n=o.onAttributeChange||null,s=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,c=o.effects||null,d=o.attributes||null,f=d?ge(d):c,h=d?new Set(Object.keys(d)):null,p=o.persist||null;function m(D){const w=D||document.body;if(T(w,e,t,i),d&&M())for(const g in d){const k=d[g],$=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&$.push(w);for(let H=0;H<$.length;H++){const j=$[H];R(j)&&X(k,j.getAttribute(g),g,r,j)}}l&&l(w)}const b=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let w;for(;(w=D.exec(e))!==null;)b.push(w[1])}else b.push(e);xe({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:i,onInit:l,observed:b.concat(a),onAttributeChange:n,onAttrChange:u,effects:f,declared:h,persist:p}),Ae();const N=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";ee().push({selector:e,attribute:t,ComponentFn:i,onInit:l,onSubtreeChange:s,query:N}),De(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te);function v(){Ce()>0?_e(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):v(),m}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,i={},r=ne(t);if(!r)return i;const o=r.split("&");for(let a=0;a<o.length;a++){const n=o[a];if(!n)continue;const s=n.indexOf(":"),l=s>-1?n.slice(0,s):n,u=s>-1?n.slice(s+1):"";if(l)try{i[l]=decodeURIComponent(u)}catch{i[l]=u}}return i}function Ee(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Se(e,t){if(!e)return;const i=I();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const n=i[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");ne(location.hash)!==o&&(location.hash=o)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Te);function Ie(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ie);const _={};function S(e){const t=e||"default";if(!_[t]){const i=new Intl.NumberFormat(e,{useGrouping:!0}),r=i.formatToParts(1234.5);let o="",a=".";for(let n=0;n<r.length;n++)r[n].type==="group"&&(o=r[n].value),r[n].type==="decimal"&&(a=r[n].value);_[t]={groupSep:o,decimalSep:a,fmt:i}}return _[t]}function ie(e,t,i){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),i&&i!=="."&&(r=r.replace(i,".")),r=r.replace(/[^\d.-]/g,""),r)}function $e(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const i=e.trim();if(i===""||i==="-")return NaN;const r=S(t),o=ie(i,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function C(e,t,i={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=i.maxDecimals!=null?parseInt(i.maxDecimals,10):null,a=i.userDecimals!=null?i.userDecimals:null;if(o!==null){const n=r+"|max:"+o;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),_[n].format(e)}if(a!==null&&a>0){const n=r+"|exact:"+a;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),_[n].format(e)}return S(t).fmt.format(e)}function He(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let i=t,r=0;for(let o=0;o<e.length&&i>0;o++)r=o+1,/[0-9]/.test(e[o])&&i--;return i>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function i(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const r={"data-ln-number":{type:"marker",effect:i,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:i,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:i,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:i,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:i,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function a(n){if(n[t])return n[t];n[t]=this,this.dom=n;const s=this;if(this._onLocaleChange=function(){s.isTextElement?s._formatTextContent():isNaN(s.value)||s._displayFormatted(s.value)},B(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const l=document.createElement("input");l.type="hidden",l.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&l.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",l),this._hidden=l,Object.defineProperty(l,"value",{get:function(){return o.get.call(l)},set:function(c){if(o.set.call(l,c),c!==""&&!isNaN(parseFloat(c))){const d=s.dom.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(parseFloat(c),y(s.dom),{maxDecimals:d}))}else s._setDisplayRaw("");s.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),ae(n,o,{get:function(){return o.get.call(n)},set:function(c){if(c===""){s._setDisplayRaw(""),s._setHiddenRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}));return}const d=typeof c=="number"?c:parseFloat(String(c));if(isNaN(d))s._setDisplayRaw(String(c)),s._setHiddenRaw("");else{s._setHiddenRaw(d);const f=n.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(d,y(n),{maxDecimals:f}))}n.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){s._handleInput()},n.addEventListener("input",this._onInput),this._onKeyDown=function(c){if(c.key!=="Backspace")return;const d=n.selectionStart,f=n.selectionEnd;if(d!==f||d===0)return;const h=S(y(n)),p=o.get.call(n),m=p[d-1];if(m===h.groupSep||/\s/.test(m)){c.preventDefault();const b=d-2>=0?d-2:0,A=p.slice(0,b)+p.slice(d);o.set.call(n,A),n.setSelectionRange(b,b),n.dispatchEvent(new Event("input",{bubbles:!0}))}},n.addEventListener("keydown",this._onKeyDown),this._onPaste=function(c){c.preventDefault();const d=(c.clipboardData||window.clipboardData).getData("text"),f=$e(d,y(n));s.value=isNaN(f)?NaN:f},n.addEventListener("paste",this._onPaste);const u=n.value;if(u!==""){const c=parseFloat(u);if(!isNaN(c)){const d=n.getAttribute("data-ln-number-decimals");this._setHiddenRaw(c),this._setDisplayRaw(C(c,y(n),{maxDecimals:d})),n.dispatchEvent(new Event("input",{bubbles:!0}))}}return n.form&&(this._onFormReset=function(){setTimeout(function(){const c=n.defaultValue;if(c!==""){const d=parseFloat(c);if(!isNaN(d)){const f=n.getAttribute("data-ln-number-decimals");s._setHiddenRaw(d),s._setDisplayRaw(C(d,y(n),{maxDecimals:f})),n.dispatchEvent(new Event("input",{bubbles:!0}));return}}s._setHiddenRaw(""),s._setDisplayRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}))},0)},n.form.addEventListener("reset",this._onFormReset)),this}a.prototype._initTextElement=function(){const n=this.dom;let s=n.getAttribute("data-ln-value"),l=n.getAttribute("data-ln-number"),u=null;s!==null&&s!==""?u=s:l!==null&&l!==""&&l!=="true"?u=l:u=n.textContent.trim();const c=parseFloat(u);isNaN(c)?this._rawValue=null:(this._rawValue=c,n.hasAttribute("data-ln-value")||n.setAttribute("data-ln-value",String(c)),this._formatTextContent())},a.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const n=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=C(this._rawValue,y(this.dom),{maxDecimals:n})}},a.prototype._handleInput=function(){const n=this.dom,s=o.get.call(n);if(s===""){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:""});return}if(s==="-"){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:"-"});return}const l=n.selectionStart;let u=0;for(let w=0;w<l;w++)/[0-9]/.test(s[w])&&u++;const c=y(n),d=S(c);let f=s,h=ie(s,d.groupSep,d.decimalSep),p=parseFloat(h);if(isNaN(p)){this._setHiddenRaw(""),x(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=h.indexOf(".");if(m!==null&&b!==-1){const w=parseInt(m,10),g=h.slice(b+1);if(w===0)h=h.slice(0,b),f=f.split(d.decimalSep)[0],p=parseFloat(h),this._setDisplayRaw(f);else if(g.length>w){h=h.slice(0,b+1+w);const k=f.split(d.decimalSep);f=k[0]+d.decimalSep+k[1].slice(0,w),p=parseFloat(h),this._setDisplayRaw(f)}}const A=n.getAttribute("data-ln-number-max");if(A!==null&&p>parseFloat(A)){const w=parseFloat(A),g=C(w,c,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(w),n.setSelectionRange(g.length,g.length),x(n,"ln-number:input",{value:w,formatted:g});return}if(f.endsWith(d.decimalSep)||d.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:f});return}const N=h.indexOf(".");if(N!==-1&&h.slice(N+1).endsWith("0")){this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:f});return}let v;if(m!==null)v=C(p,c,{maxDecimals:m});else{const w=N!==-1?h.slice(N+1).length:0;v=C(p,c,{userDecimals:w})}this._setDisplayRaw(v);const D=He(v,u);n.setSelectionRange(D,D),this._setHiddenRaw(p),x(n,"ln-number:input",{value:p,formatted:v})},a.prototype._setHiddenRaw=function(n){this._hidden&&o.set.call(this._hidden,String(n))},a.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):o.set.call(this.dom,String(n))},a.prototype._displayFormatted=function(n){if(this.isTextElement)this._formatTextContent();else{const s=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(n,y(this.dom),{maxDecimals:s}))}},Object.defineProperty(a.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const n=o.get.call(this._hidden);return n===""?NaN:parseFloat(n)},set:function(n){const s=typeof n=="number"?n:parseFloat(n);if(this.isTextElement){isNaN(s)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=s,this.dom.setAttribute("data-ln-value",String(s)),this._formatTextContent());return}if(isNaN(s)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(s);const l=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(s,y(this.dom),{maxDecimals:l})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(a.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),a.prototype.destroy=function(){this.dom[t]&&(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},te(e,t,a,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:i})})()})();
|