@livenetworks/ashlar 2.0.7 → 2.0.8
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 +96 -96
- package/components/ln-api-connector/src/ln-api-connector.js +1 -0
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-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/crypto.js +286 -265
- package/components/ln-core/dom.js +115 -115
- package/components/ln-core/form.js +136 -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/ln-core.schema.json +109 -109
- 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 +428 -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 +2 -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 +45 -45
- 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/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 +41 -41
- 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-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 +7 -8
- package/package.json +84 -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 +12 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@use '../../theme/config/mixins' as *;
|
|
2
|
-
|
|
3
|
-
[data-ln-debug] {
|
|
4
|
-
// 1. Host Element Check: data-ln-autoresize belongs only on <textarea>
|
|
5
|
-
[data-ln-autoresize]:not(textarea) {
|
|
6
|
-
@include dev-inline-error("data-ln-autoresize belongs only on <textarea> elements");
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
@use '../../theme/config/mixins' as *;
|
|
2
|
+
|
|
3
|
+
[data-ln-debug] {
|
|
4
|
+
// 1. Host Element Check: data-ln-autoresize belongs only on <textarea>
|
|
5
|
+
[data-ln-autoresize]:not(textarea) {
|
|
6
|
+
@include dev-inline-error("data-ln-autoresize belongs only on <textarea> elements");
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function O(){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 p(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!p(o))return}e.apply(console,t)}}function M(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const x={};function B(e,t){x[e]=t}function N(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=B,window.lnCore.getDataMapper=N);function W(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){M(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const E={};function j(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];E[n]=t}function V(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return E[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=j,window.lnCore.getLocaleFallback=V,window.lnCore.ensureLocaleObserver=W);const C={};function H(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function L(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<s.length;u++){const a=s[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let u=0;u<s.length;u++){const a=s[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function z(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)L(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(i,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let i=0;i<r.length;i++){const l=r[i],c=l.attributes;for(let s=0;s<c.length;s++){const u=c[s];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function U(e,t,n,o,r,i){const l={};for(let s=0;s<e.children.length;s++){const u=e.children[s],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const u=t[s],a=String(o(u));let d=l[a];if(d)r(d,u,s);else{const f=H(n,i);if(!f||($(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),r(d,u,s)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=L,window.lnCore.lnFill=z,window.lnCore.renderList=U);function T(e,t,n,o,r){if(!e||t===null)return!0;const i=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=s=>{r?console.warn(s,r):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(c(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(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 K(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 y(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function G(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function J(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 D(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function X(e){const t=D(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(i=>i.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=K(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function I(e,t,n,o){for(let r=0;r<e.length;r++){const i=e[r];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function P(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=D(),r=o.byAttr.get(n);if(O()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&p(t)){const i=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)T(i[c].spec,l,n,i[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=o.byReactive.get(n);i&&I(i,t,n,e.oldValue),o.reactiveWildcard.length&&I(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const l=r[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(y(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{P(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 R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(e){const t=R();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,i=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;i&&o.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r];y(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r],l=i.query,c=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&c.push(o);for(let s=0;s<c.length;s++){const u=c[s];if(!document.contains(u)){const a=u[i.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+i.attribute+"] destroy failed",u,d)}delete u[i.attribute]}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Z(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function te(e,t,n,o,r={}){const i=r.extraAttributes||[],l=r.onAttributeChange||null,c=r.onSubtreeChange||null,s=r.onInit||null,u=r.onAttrChange||null,a=r.effects||null,d=r.attributes||null,f=d?Q(d):a,de=d?new Set(Object.keys(d)):null,ae=r.persist||null;function g(_){const w=_||document.body;if(y(w,e,t,n),d&&O())for(const h in d){const we=d[h],v=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&v.push(w);for(let S=0;S<v.length;S++){const k=v[S];p(k)&&T(we,k.getAttribute(h),h,o,k)}}s&&s(w)}const A=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let w;for(;(w=_.exec(e))!==null;)A.push(w[1])}else A.push(e);X({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:s,observed:A.concat(i),onAttributeChange:l,onAttrChange:u,effects:f,declared:de,persist:ae}),Y();const fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";R().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:fe}),ee(),window[t]=g;function F(){G()>0?J(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",F):F(),g}function q(e){return(e||"").replace(/^#/,"")}function m(e){const t=e===void 0?location.hash:e,n={},o=q(t);if(!o)return n;const r=o.split("&");for(let i=0;i<r.length;i++){const l=r[i];if(!l)continue;const c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(u)}catch{n[s]=u}}return n}function ne(e){if(!e)return null;const t=m();return e in t?t[e]:null}function oe(e,t){if(!e)return;const n=m();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");q(location.hash)!==r&&(location.hash=r)}function re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function se(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 ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=m,window.lnCore.hashGet=ne,window.lnCore.hashSet=oe,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=ie,window.lnCore.hashSortEncode=le,window.lnCore.hashSortDecode=se,window.lnCore.hashFilterEncode=ce,window.lnCore.hashFilterDecode=ue),(function(){const e="data-ln-autoresize",t="lnAutoresize";if(window[t]!==void 0)return;const n={"data-ln-autoresize":{type:"marker",description:"Automatically adjusts textarea height to match its scrollable content"}};function o(r){if(r.tagName!=="TEXTAREA")return console.warn("[ln-autoresize] Can only be applied to <textarea>, got:",r.tagName),this;this.dom=r;const i=this;return this._onInput=function(){i._resize()},r.addEventListener("input",this._onInput),this._resize(),this}o.prototype._resize=function(){this.dom.style.height="auto",this.dom.style.height=this.dom.scrollHeight+"px"},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("input",this._onInput),this.dom.style.height="",delete this.dom[t])},te(e,t,o,"ln-autoresize",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function k(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function p(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){o=t[r];break}if(!p(o))return}e.apply(console,t)}}function F(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const O={};function B(e,t){O[e]=t}function N(e){return O[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=B,window.lnCore.getDataMapper=N);function W(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const E={};function j(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];E[n]=t}function V(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return E[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=j,window.lnCore.getLocaleFallback=V,window.lnCore.ensureLocaleObserver=W);const C={};function H(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function L(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<s.length;u++){const a=s[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let u=0;u<s.length;u++){const a=s[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function U(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)L(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(i,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let i=0;i<r.length;i++){const l=r[i],c=l.attributes;for(let s=0;s<c.length;s++){const u=c[s];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function z(e,t,n,o,r,i){const l={};for(let s=0;s<e.children.length;s++){const u=e.children[s],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const u=t[s],a=String(o(u));let d=l[a];if(d)r(d,u,s);else{const f=H(n,i);if(!f||($(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),r(d,u,s)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=L,window.lnCore.lnFill=U,window.lnCore.renderList=z);function D(e,t,n,o,r){if(!e||t===null)return!0;const i=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=s=>{r?console.warn(s,r):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(c(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(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 K(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 y(e,t,n,o){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function G(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function J(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 I(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function X(e){const t=I(),n=e.observed||[];for(let o=0;o<n.length;o++){const r=n[o];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const r=t.byDeclaredAttr.get(o);r.some(i=>i.componentTag===e.componentTag)||r.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=K(e);if(o===null)t.reactiveWildcard.push(e);else for(const r of o)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function T(e,t,n,o){for(let r=0;r<e.length;r++){const i=e[r];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,o):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,o)}}function P(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=I(),r=o.byAttr.get(n);if(k()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&p(t)){const i=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)D(i[c].spec,l,n,i[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||r)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=o.byReactive.get(n);i&&T(i,t,n,e.oldValue),o.reactiveWildcard.length&&T(o.reactiveWildcard,t,n,e.oldValue)}if(r)for(let i=0;i<r.length;i++){const l=r[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(y(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{P(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 R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(e){const t=R();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const r=o.query,i=e.target.nodeType===1?e.target.matches(r)?e.target:e.target.closest(r):e.target.parentElement?e.target.parentElement.closest(r):null;i&&o.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r];y(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let r=0;r<t.length;r++){const i=t[r],l=i.query,c=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&c.push(o);for(let s=0;s<c.length;s++){const u=c[s];if(!document.contains(u)){const a=u[i.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(d){console.error("["+i.attribute+"] destroy failed",u,d)}delete u[i.attribute]}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{Z(o)}catch(r){console.error("[ln-core] lifecycle handler failed",o.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function te(e,t,n,o,r={}){const i=r.extraAttributes||[],l=r.onAttributeChange||null,c=r.onSubtreeChange||null,s=r.onInit||null,u=r.onAttrChange||null,a=r.effects||null,d=r.attributes||null,f=d?Q(d):a,ae=d?new Set(Object.keys(d)):null,fe=r.persist||null;function g(x){const w=x||document.body;if(y(w,e,t,n),d&&k())for(const h in d){const he=d[h],_=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&_.push(w);for(let v=0;v<_.length;v++){const S=_[v];p(S)&&D(he,S.getAttribute(h),h,o,S)}}s&&s(w)}const A=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let w;for(;(w=x.exec(e))!==null;)A.push(w[1])}else A.push(e);X({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:s,observed:A.concat(i),onAttributeChange:l,onAttrChange:u,effects:f,declared:ae,persist:fe}),Y();const we=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";R().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:we}),ee(),window[t]=g;function M(){G()>0?J(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),g}function q(e){return(e||"").replace(/^#/,"")}function m(e){const t=e===void 0?location.hash:e,n={},o=q(t);if(!o)return n;const r=o.split("&");for(let i=0;i<r.length;i++){const l=r[i];if(!l)continue;const c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(u)}catch{n[s]=u}}return n}function ne(e){if(!e)return null;const t=m();return e in t?t[e]:null}function oe(e,t){if(!e)return;const n=m();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");q(location.hash)!==r&&(location.hash=r)}function re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function se(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 ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),r=o?o.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=m,window.lnCore.hashGet=ne,window.lnCore.hashSet=oe,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=ie,window.lnCore.hashSortEncode=le,window.lnCore.hashSortDecode=se,window.lnCore.hashFilterEncode=ce,window.lnCore.hashFilterDecode=ue);function de(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=de),(function(){const e="data-ln-autoresize",t="lnAutoresize";if(window[t]!==void 0)return;const n={"data-ln-autoresize":{type:"marker",description:"Automatically adjusts textarea height to match its scrollable content"}};function o(r){if(r.tagName!=="TEXTAREA")return console.warn("[ln-autoresize] Can only be applied to <textarea>, got:",r.tagName),this;this.dom=r;const i=this;return this._onInput=function(){i._resize()},r.addEventListener("input",this._onInput),this._resize(),this}o.prototype._resize=function(){this.dom.style.height="auto",this.dom.style.height=this.dom.scrollHeight+"px"},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("input",this._onInput),this.dom.style.height="",delete this.dom[t])},te(e,t,o,"ln-autoresize",{attributes:n})})()})();
|
|
@@ -1,22 +1,22 @@
|
|
|
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-autoresize",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-autoresize": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-autoresize-dev.scss",
|
|
10
|
-
"src/ln-autoresize.js"
|
|
11
|
-
],
|
|
12
|
-
"type": "marker",
|
|
13
|
-
"description": "Automatically adjusts textarea height to match its scrollable content"
|
|
14
|
-
},
|
|
15
|
-
"data-ln-debug": {
|
|
16
|
-
"direction": null,
|
|
17
|
-
"sources": [
|
|
18
|
-
"ln-autoresize-dev.scss"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
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-autoresize",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-autoresize": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-autoresize-dev.scss",
|
|
10
|
+
"src/ln-autoresize.js"
|
|
11
|
+
],
|
|
12
|
+
"type": "marker",
|
|
13
|
+
"description": "Automatically adjusts textarea height to match its scrollable content"
|
|
14
|
+
},
|
|
15
|
+
"data-ln-debug": {
|
|
16
|
+
"direction": null,
|
|
17
|
+
"sources": [
|
|
18
|
+
"ln-autoresize-dev.scss"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
@use '../../theme/config/mixins' as *;
|
|
2
|
-
|
|
3
|
-
[data-ln-debug] {
|
|
4
|
-
// 1. Host Element Check: data-ln-autosave belongs only on <form>
|
|
5
|
-
[data-ln-autosave]:not(form) {
|
|
6
|
-
@include dev-inline-error("data-ln-autosave belongs only on <form> elements");
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// 2. Storage Key Check: form must have an id or explicit data-ln-autosave key
|
|
10
|
-
form[data-ln-autosave=""]:not([id]) {
|
|
11
|
-
@include dev-dom-error("form[data-ln-autosave] requires an 'id' or explicit storage key value.");
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
@use '../../theme/config/mixins' as *;
|
|
2
|
+
|
|
3
|
+
[data-ln-debug] {
|
|
4
|
+
// 1. Host Element Check: data-ln-autosave belongs only on <form>
|
|
5
|
+
[data-ln-autosave]:not(form) {
|
|
6
|
+
@include dev-inline-error("data-ln-autosave belongs only on <form> elements");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 2. Storage Key Check: form must have an id or explicit data-ln-autosave key
|
|
10
|
+
form[data-ln-autosave=""]:not([id]) {
|
|
11
|
+
@include dev-dom-error("form[data-ln-autosave] requires an 'id' or explicit storage key value.");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function v(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function U(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function _(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 H(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,r={};if(o)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&r[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function V(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function K(e,t){const o=e.elements,i=[],l={};for(let s=0;s<o.length;s++){const r=o[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<o.length;s++){const r=o[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 n=t[c];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(l[r.name]>1){const a=String(n).split(",").map(function(d){return d.trim()});r.checked=a.indexOf(r.value)!==-1}else r.checked=V(n);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<r.options.length;a++)r.options[a].selected=n.indexOf(r.options[a].value)!==-1;i.push(r)}else r.value=n,i.push(r)}return i}const R={};function Q(e,t){R[e]=t}function J(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Q,window.lnCore.getDataMapper=J);function P(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function X(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];$[o]=t}function G(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=X,window.lnCore.getLocaleFallback=G,window.lnCore.ensureLocaleObserver=P);const k={};function z(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=k[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const c=o[r],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const c=i[r],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();t[h]!=null&&c.setAttribute(u,t[h])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();h in t&&c.classList.toggle(u,!!t[h])}}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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function N(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.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 i=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 n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&r.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Z(e,t,o,i,l,s){const r={};for(let n=0;n<e.children.length;n++){const a=e.children[n],d=a.getAttribute("data-ln-render-key");d&&(r[d]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],d=String(i(a));let u=r[d];if(u)l(u,a,n);else{const h=z(o,s);if(!h||(N(h,a),u=h.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=F,window.lnCore.lnFill=Y,window.lnCore.renderList=Z);function q(e,t,o,i,l){if(!e||t===null)return!0;const s=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}function E(e,t,o,i){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[o]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[o]=new i(c)}catch(n){console.error("["+o+"] init failed",c,n)}}}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 B(){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=B(),o=e.observed||[];for(let i=0;i<o.length;i++){const l=o[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=te(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function M(e,t,o,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[o];r?r(t,o,i):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,i)}}function ie(e){const t=e.target,o=e.attributeName;if(e.oldValue===t.getAttribute(o))return;const i=B(),l=i.byAttr.get(o);if(D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(o)&&A(t)){const s=i.byDeclaredAttr.get(o),r=t.getAttribute(o);for(let c=0;c<s.length;c++)q(s[c].spec,r,o,s[c].componentTag,t)}if(window.lnCore._debugSink&&(o.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",o,t,{oldValue:e.oldValue,newValue:t.getAttribute(o)}),o.indexOf("data-ln-")===0){const s=i.byReactive.get(o);s&&M(s,t,o,e.oldValue),i.reactiveWildcard.length&&M(i.reactiveWildcard,t,o,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,o,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,o):(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 o=0;o<t.length;o++)try{ie(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).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 se(e){const t=j();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const i=t[o];if(i.onSubtreeChange){const l=i.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&&i.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];E(i,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(i)}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,c=Array.from(i.querySelectorAll(r));i.matches&&i.matches(r)&&c.push(i);for(let n=0;n<c.length;n++){const a=c[n];if(!document.contains(a)){const d=a[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+s.attribute+"] destroy failed",a,u)}delete a[s.attribute]}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{se(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ae(e,t,o,i,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,a=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,h=u?ee(u):d,m=u?new Set(Object.keys(u)):null,O=l.persist||null;function p(g){const b=g||document.body;if(E(b,e,t,o),u&&D())for(const y in u){const _e=u[y],L=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&L.push(b);for(let T=0;T<L.length;T++){const I=L[T];A(I)&&q(_e,I.getAttribute(y),y,i,I)}}n&&n(b)}const C=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let b;for(;(b=g.exec(e))!==null;)C.push(b[1])}else C.push(e);re({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:o,onInit:n,observed:C.concat(s),onAttributeChange:r,onAttrChange:a,effects:h,declared:m,persist:O}),le();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";j().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:f}),ce(),window[t]=p;function x(){ne()>0?oe(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),p}function W(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,o={},i=W(t);if(!i)return o;const l=i.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const c=r.indexOf(":"),n=c>-1?r.slice(0,c):r,a=c>-1?r.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(a)}catch{o[n]=a}}return o}function ue(e){if(!e)return null;const t=S();return e in t?t[e]:null}function de(e,t){if(!e)return;const o=S();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const r=o[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");W(location.hash)!==l&&(location.hash=l)}function fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function he(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function we(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function be(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 ge(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ue,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=fe,window.lnCore.resolveHashNamespace=he,window.lnCore.hashSortEncode=we,window.lnCore.hashSortDecode=be,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=ge);const Ce="ln-autosave:",me=1e3;function ye(e,t){return t?Ce+(e||"")+":"+t:null}function ve(e,t=me){if(e==null)return 0;if(e==="")return t;const o=parseInt(String(e),10);return isNaN(o)||o<0?t:o}(function(){const e="data-ln-autosave",t="lnAutosave",o="data-ln-autosave-clear",i="data-ln-autosave-debounce-input",l='[data-ln-autosave-exclude], input[type="password"]';if(window[t]!==void 0)return;const s={"data-ln-autosave":{type:"string",description:"Form autosave storage key identifier"},"data-ln-autosave-debounce-input":{type:"integer",fallback:500,min:0,description:"Debounce delay in milliseconds before saving on input events"},"data-ln-autosave-clear":{type:"marker",description:"Designates a button that clears saved form data from localStorage"},"data-ln-autosave-exclude":{type:"marker",description:"Excludes form control from autosave serialization"}};function r(n){const a=n.tagName;return a==="INPUT"||a==="TEXTAREA"||a==="SELECT"}function c(n){const d=n.getAttribute(e)||n.id,u=ye(window.location.pathname,d);if(!u){console.warn("ln-autosave: form needs an id or data-ln-autosave value",n);return}this.dom=n,this.key=u;let h=null;function m(){const w=H(n,{exclude:l});try{localStorage.setItem(u,JSON.stringify(w))}catch{return}v(n,"ln-autosave:saved",{target:n,data:w})}function O(){let w;try{w=localStorage.getItem(u)}catch{return}if(!w)return;let f;try{f=JSON.parse(w)}catch{return}if(U(n,"ln-autosave:before-restore",{target:n,data:f}).defaultPrevented)return;const g=K(n,f);for(let b=0;b<g.length;b++)g[b].dispatchEvent(new Event("input",{bubbles:!0})),g[b].dispatchEvent(new Event("change",{bubbles:!0}));v(n,"ln-autosave:restored",{target:n,data:f})}function p(){try{localStorage.removeItem(u)}catch{return}v(n,"ln-autosave:cleared",{target:n})}this._onFocusout=function(w){const f=w.target;r(f)&&f.name&&!f.matches(l)&&m()},this._onChange=function(w){const f=w.target;r(f)&&f.name&&!f.matches(l)&&m()},this._onSubmit=function(){p()},this._onReset=function(){p()},this._onClearClick=function(w){w.target.closest("["+o+"]")&&p()},n.addEventListener("focusout",this._onFocusout),n.addEventListener("change",this._onChange),n.addEventListener("submit",this._onSubmit),n.addEventListener("reset",this._onReset),n.addEventListener("click",this._onClearClick);const C=ve(n.getAttribute(i));return C>0&&(this._onInput=function(w){const f=w.target;!r(f)||!f.name||f.matches(l)||(h!==null&&clearTimeout(h),h=setTimeout(m,C))},n.addEventListener("input",this._onInput)),this._getInputTimer=function(){return h},O(),this}c.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("focusout",this._onFocusout),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("reset",this._onReset),this.dom.removeEventListener("click",this._onClearClick),this._onInput){this.dom.removeEventListener("input",this._onInput);const n=this._getInputTimer();n!==null&&clearTimeout(n)}delete this.dom[t]}},ae(e,t,c,"ln-autosave",{attributes:s})})()})();
|
|
1
|
+
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function v(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function W(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(l),l}function _(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 H(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,r={};if(o)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&r[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function V(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function K(e,t){const o=e.elements,i=[],l={};for(let s=0;s<o.length;s++){const r=o[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<o.length;s++){const r=o[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 n=t[c];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(l[r.name]>1){const a=String(n).split(",").map(function(d){return d.trim()});r.checked=a.indexOf(r.value)!==-1}else r.checked=V(n);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<r.options.length;a++)r.options[a].selected=n.indexOf(r.options[a].value)!==-1;i.push(r)}else r.value=n,i.push(r)}return i}const R={};function Q(e,t){R[e]=t}function J(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Q,window.lnCore.getDataMapper=J);function P(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function X(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];$[o]=t}function G(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=X,window.lnCore.getLocaleFallback=G,window.lnCore.ensureLocaleObserver=P);const x={};function z(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=x[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const c=o[r],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const c=i[r],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();t[h]!=null&&c.setAttribute(u,t[h])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();h in t&&c.classList.toggle(u,!!t[h])}}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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)F(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function N(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.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 i=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 n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&r.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Z(e,t,o,i,l,s){const r={};for(let n=0;n<e.children.length;n++){const a=e.children[n],d=a.getAttribute("data-ln-render-key");d&&(r[d]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],d=String(i(a));let u=r[d];if(u)l(u,a,n);else{const h=z(o,s);if(!h||(N(h,a),u=h.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=F,window.lnCore.lnFill=Y,window.lnCore.renderList=Z);function q(e,t,o,i,l){if(!e||t===null)return!0;const s=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=n=>{l?console.warn(n,l):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.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 o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}function k(e,t,o,i){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[o]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[o]=new i(c)}catch(n){console.error("["+o+"] init failed",c,n)}}}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 M(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function re(e){const t=M(),o=e.observed||[];for(let i=0;i<o.length;i++){const l=o[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=te(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function B(e,t,o,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[o];r?r(t,o,i):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,i)}}function ie(e){const t=e.target,o=e.attributeName;if(e.oldValue===t.getAttribute(o))return;const i=M(),l=i.byAttr.get(o);if(D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(o)&&A(t)){const s=i.byDeclaredAttr.get(o),r=t.getAttribute(o);for(let c=0;c<s.length;c++)q(s[c].spec,r,o,s[c].componentTag,t)}if(window.lnCore._debugSink&&(o.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",o,t,{oldValue:e.oldValue,newValue:t.getAttribute(o)}),o.indexOf("data-ln-")===0){const s=i.byReactive.get(o);s&&B(s,t,o,e.oldValue),i.reactiveWildcard.length&&B(i.reactiveWildcard,t,o,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const r=l[s];if(r.handler){r.handler(t,o,e.oldValue);continue}r.onAttributeChange&&t[r.attribute]?r.onAttributeChange(t,o):(k(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 o=0;o<t.length;o++)try{ie(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).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 se(e){const t=j();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const i=t[o];if(i.onSubtreeChange){const l=i.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&&i.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];k(i,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(i)}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],r=s.query,c=Array.from(i.querySelectorAll(r));i.matches&&i.matches(r)&&c.push(i);for(let n=0;n<c.length;n++){const a=c[n];if(!document.contains(a)){const d=a[s.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+s.attribute+"] destroy failed",a,u)}delete a[s.attribute]}}}}}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{se(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ae(e,t,o,i,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,a=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,h=u?ee(u):d,m=u?new Set(Object.keys(u)):null,S=l.persist||null;function p(g){const b=g||document.body;if(k(b,e,t,o),u&&D())for(const y in u){const Ae=u[y],L=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&L.push(b);for(let T=0;T<L.length;T++){const I=L[T];A(I)&&q(Ae,I.getAttribute(y),y,i,I)}}n&&n(b)}const C=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let b;for(;(b=g.exec(e))!==null;)C.push(b[1])}else C.push(e);re({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:o,onInit:n,observed:C.concat(s),onAttributeChange:r,onAttrChange:a,effects:h,declared:m,persist:S}),le();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";j().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:f}),ce(),window[t]=p;function O(){ne()>0?oe(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",O):O(),p}function U(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,o={},i=U(t);if(!i)return o;const l=i.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const c=r.indexOf(":"),n=c>-1?r.slice(0,c):r,a=c>-1?r.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(a)}catch{o[n]=a}}return o}function ue(e){if(!e)return null;const t=E();return e in t?t[e]:null}function de(e,t){if(!e)return;const o=E();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const r=o[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");U(location.hash)!==l&&(location.hash=l)}function fe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function he(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function we(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function be(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 ge(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=ue,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=fe,window.lnCore.resolveHashNamespace=he,window.lnCore.hashSortEncode=we,window.lnCore.hashSortDecode=be,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=ge);function Ce(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ce);const me="ln-autosave:",ye=1e3;function ve(e,t){return t?me+(e||"")+":"+t:null}function _e(e,t=ye){if(e==null)return 0;if(e==="")return t;const o=parseInt(String(e),10);return isNaN(o)||o<0?t:o}(function(){const e="data-ln-autosave",t="lnAutosave",o="data-ln-autosave-clear",i="data-ln-autosave-debounce-input",l='[data-ln-autosave-exclude], input[type="password"]';if(window[t]!==void 0)return;const s={"data-ln-autosave":{type:"string",description:"Form autosave storage key identifier"},"data-ln-autosave-debounce-input":{type:"integer",fallback:500,min:0,description:"Debounce delay in milliseconds before saving on input events"},"data-ln-autosave-clear":{type:"marker",description:"Designates a button that clears saved form data from localStorage"},"data-ln-autosave-exclude":{type:"marker",description:"Excludes form control from autosave serialization"}};function r(n){const a=n.tagName;return a==="INPUT"||a==="TEXTAREA"||a==="SELECT"}function c(n){const d=n.getAttribute(e)||n.id,u=ve(window.location.pathname,d);if(!u){console.warn("ln-autosave: form needs an id or data-ln-autosave value",n);return}this.dom=n,this.key=u;let h=null;function m(){const w=H(n,{exclude:l});try{localStorage.setItem(u,JSON.stringify(w))}catch{return}v(n,"ln-autosave:saved",{target:n,data:w})}function S(){let w;try{w=localStorage.getItem(u)}catch{return}if(!w)return;let f;try{f=JSON.parse(w)}catch{return}if(W(n,"ln-autosave:before-restore",{target:n,data:f}).defaultPrevented)return;const g=K(n,f);for(let b=0;b<g.length;b++)g[b].dispatchEvent(new Event("input",{bubbles:!0})),g[b].dispatchEvent(new Event("change",{bubbles:!0}));v(n,"ln-autosave:restored",{target:n,data:f})}function p(){try{localStorage.removeItem(u)}catch{return}v(n,"ln-autosave:cleared",{target:n})}this._onFocusout=function(w){const f=w.target;r(f)&&f.name&&!f.matches(l)&&m()},this._onChange=function(w){const f=w.target;r(f)&&f.name&&!f.matches(l)&&m()},this._onSubmit=function(){p()},this._onReset=function(){p()},this._onClearClick=function(w){w.target.closest("["+o+"]")&&p()},n.addEventListener("focusout",this._onFocusout),n.addEventListener("change",this._onChange),n.addEventListener("submit",this._onSubmit),n.addEventListener("reset",this._onReset),n.addEventListener("click",this._onClearClick);const C=_e(n.getAttribute(i));return C>0&&(this._onInput=function(w){const f=w.target;!r(f)||!f.name||f.matches(l)||(h!==null&&clearTimeout(h),h=setTimeout(m,C))},n.addEventListener("input",this._onInput)),this._getInputTimer=function(){return h},S(),this}c.prototype.destroy=function(){if(this.dom[t]){if(this.dom.removeEventListener("focusout",this._onFocusout),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("submit",this._onSubmit),this.dom.removeEventListener("reset",this._onReset),this.dom.removeEventListener("click",this._onClearClick),this._onInput){this.dom.removeEventListener("input",this._onInput);const n=this._getInputTimer();n!==null&&clearTimeout(n)}delete this.dom[t]}},ae(e,t,c,"ln-autosave",{attributes:s})})()})();
|
|
@@ -1,48 +1,48 @@
|
|
|
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-autosave",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-autosave": {
|
|
7
|
-
"direction": "author",
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-autosave-dev.scss",
|
|
10
|
-
"src/ln-autosave.js"
|
|
11
|
-
],
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Form autosave storage key identifier"
|
|
14
|
-
},
|
|
15
|
-
"data-ln-autosave-clear": {
|
|
16
|
-
"direction": "author",
|
|
17
|
-
"sources": [
|
|
18
|
-
"src/ln-autosave.js"
|
|
19
|
-
],
|
|
20
|
-
"type": "marker",
|
|
21
|
-
"description": "Designates a button that clears saved form data from localStorage"
|
|
22
|
-
},
|
|
23
|
-
"data-ln-autosave-debounce-input": {
|
|
24
|
-
"direction": "author",
|
|
25
|
-
"sources": [
|
|
26
|
-
"src/ln-autosave.js"
|
|
27
|
-
],
|
|
28
|
-
"type": "integer",
|
|
29
|
-
"fallback": 500,
|
|
30
|
-
"min": 0,
|
|
31
|
-
"description": "Debounce delay in milliseconds before saving on input events"
|
|
32
|
-
},
|
|
33
|
-
"data-ln-autosave-exclude": {
|
|
34
|
-
"direction": null,
|
|
35
|
-
"sources": [
|
|
36
|
-
"src/ln-autosave.js"
|
|
37
|
-
],
|
|
38
|
-
"type": "marker",
|
|
39
|
-
"description": "Excludes form control from autosave serialization"
|
|
40
|
-
},
|
|
41
|
-
"data-ln-debug": {
|
|
42
|
-
"direction": null,
|
|
43
|
-
"sources": [
|
|
44
|
-
"ln-autosave-dev.scss"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
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-autosave",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-autosave": {
|
|
7
|
+
"direction": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-autosave-dev.scss",
|
|
10
|
+
"src/ln-autosave.js"
|
|
11
|
+
],
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Form autosave storage key identifier"
|
|
14
|
+
},
|
|
15
|
+
"data-ln-autosave-clear": {
|
|
16
|
+
"direction": "author",
|
|
17
|
+
"sources": [
|
|
18
|
+
"src/ln-autosave.js"
|
|
19
|
+
],
|
|
20
|
+
"type": "marker",
|
|
21
|
+
"description": "Designates a button that clears saved form data from localStorage"
|
|
22
|
+
},
|
|
23
|
+
"data-ln-autosave-debounce-input": {
|
|
24
|
+
"direction": "author",
|
|
25
|
+
"sources": [
|
|
26
|
+
"src/ln-autosave.js"
|
|
27
|
+
],
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"fallback": 500,
|
|
30
|
+
"min": 0,
|
|
31
|
+
"description": "Debounce delay in milliseconds before saving on input events"
|
|
32
|
+
},
|
|
33
|
+
"data-ln-autosave-exclude": {
|
|
34
|
+
"direction": null,
|
|
35
|
+
"sources": [
|
|
36
|
+
"src/ln-autosave.js"
|
|
37
|
+
],
|
|
38
|
+
"type": "marker",
|
|
39
|
+
"description": "Excludes form control from autosave serialization"
|
|
40
|
+
},
|
|
41
|
+
"data-ln-debug": {
|
|
42
|
+
"direction": null,
|
|
43
|
+
"sources": [
|
|
44
|
+
"ln-autosave-dev.scss"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export const STORAGE_PREFIX = 'ln-autosave:';
|
|
2
|
-
export const DEFAULT_DEBOUNCE_MS = 1000;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Builds a deterministic storage key for autosave persistence.
|
|
6
|
-
* @param {string} pathname
|
|
7
|
-
* @param {string} identifier
|
|
8
|
-
* @returns {string|null}
|
|
9
|
-
*/
|
|
10
|
-
export function buildAutosaveKey(pathname, identifier) {
|
|
11
|
-
if (!identifier) return null;
|
|
12
|
-
const path = pathname || '';
|
|
13
|
-
return STORAGE_PREFIX + path + ':' + identifier;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Parses and sanitizes the debounce milliseconds attribute value for ln-autosave.
|
|
18
|
-
*
|
|
19
|
-
* Semantics:
|
|
20
|
-
* - Returns `0` if the attribute is absent (null/undefined), signaling that input debouncing is disabled (no listener).
|
|
21
|
-
* - Returns `fallbackMs` (default 1000) if the attribute is present as boolean/empty string `""` or contains an invalid value.
|
|
22
|
-
* - Returns the parsed positive integer if a valid numeric string is provided.
|
|
23
|
-
*
|
|
24
|
-
* @param {unknown} rawValue Raw DOM attribute value (e.g. data-ln-autosave-debounce-input)
|
|
25
|
-
* @param {number} [fallbackMs=1000] Fallback debounce duration in ms
|
|
26
|
-
* @returns {number} Milliseconds to debounce, or 0 if disabled
|
|
27
|
-
*/
|
|
28
|
-
export function parseAutosaveDebounce(rawValue, fallbackMs = DEFAULT_DEBOUNCE_MS) {
|
|
29
|
-
if (rawValue === null || rawValue === undefined) return 0;
|
|
30
|
-
if (rawValue === '') return fallbackMs;
|
|
31
|
-
const parsed = parseInt(String(rawValue), 10);
|
|
32
|
-
if (isNaN(parsed) || parsed < 0) return fallbackMs;
|
|
33
|
-
return parsed;
|
|
34
|
-
}
|
|
1
|
+
export const STORAGE_PREFIX = 'ln-autosave:';
|
|
2
|
+
export const DEFAULT_DEBOUNCE_MS = 1000;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Builds a deterministic storage key for autosave persistence.
|
|
6
|
+
* @param {string} pathname
|
|
7
|
+
* @param {string} identifier
|
|
8
|
+
* @returns {string|null}
|
|
9
|
+
*/
|
|
10
|
+
export function buildAutosaveKey(pathname, identifier) {
|
|
11
|
+
if (!identifier) return null;
|
|
12
|
+
const path = pathname || '';
|
|
13
|
+
return STORAGE_PREFIX + path + ':' + identifier;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Parses and sanitizes the debounce milliseconds attribute value for ln-autosave.
|
|
18
|
+
*
|
|
19
|
+
* Semantics:
|
|
20
|
+
* - Returns `0` if the attribute is absent (null/undefined), signaling that input debouncing is disabled (no listener).
|
|
21
|
+
* - Returns `fallbackMs` (default 1000) if the attribute is present as boolean/empty string `""` or contains an invalid value.
|
|
22
|
+
* - Returns the parsed positive integer if a valid numeric string is provided.
|
|
23
|
+
*
|
|
24
|
+
* @param {unknown} rawValue Raw DOM attribute value (e.g. data-ln-autosave-debounce-input)
|
|
25
|
+
* @param {number} [fallbackMs=1000] Fallback debounce duration in ms
|
|
26
|
+
* @returns {number} Milliseconds to debounce, or 0 if disabled
|
|
27
|
+
*/
|
|
28
|
+
export function parseAutosaveDebounce(rawValue, fallbackMs = DEFAULT_DEBOUNCE_MS) {
|
|
29
|
+
if (rawValue === null || rawValue === undefined) return 0;
|
|
30
|
+
if (rawValue === '') return fallbackMs;
|
|
31
|
+
const parsed = parseInt(String(rawValue), 10);
|
|
32
|
+
if (isNaN(parsed) || parsed < 0) return fallbackMs;
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
@@ -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 O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!O(r))return}e.apply(console,t)}}function E(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 k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const j={};function z(e,t){j[e]=t}function X(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=z,window.lnCore.getDataMapper=X);function W(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function Z(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ee,window.lnCore.getLocaleFallback=te,window.lnCore.ensureLocaleObserver=Z);const F={};function P(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ne(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return P(t,n)}function H(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],a=c.getAttribute("data-ln-field");t[a]!=null&&(c.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],a=c.getAttribute("data-ln-attr").split(",");for(let s=0;s<a.length;s++){const u=a[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],a=c.getAttribute("data-ln-show");a in t&&c.classList.toggle("hidden",!t[a])}const l=e.querySelectorAll("[data-ln-class]");for(let i=0;i<l.length;i++){const c=l[i],a=c.getAttribute("data-ln-class").split(",");for(let s=0;s<a.length;s++){const u=a[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function re(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)H(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let l=0;l<o.length;l++){const i=o[l],c=i.attributes;for(let a=0;a<c.length;a++){const s=c[a];s.value.indexOf("{{")!==-1&&i.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function oe(e,t,n,r,o,l){const i={};for(let a=0;a<e.children.length;a++){const s=e.children[a],u=s.getAttribute("data-ln-render-key");u&&(i[u]=s)}const c=document.createDocumentFragment();for(let a=0;a<t.length;a++){const s=t[a],u=String(r(s));let d=i[u];if(d)o(d,s,a);else{const f=P(n,l);if(!f||(q(f,s),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),o(d,s,a)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=H,window.lnCore.lnFill=re,window.lnCore.renderList=oe);function N(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function ie(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function le(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 ae(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(l,i){const c=l.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,o),o}function ce(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ue(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function U(e,t,n,r,o){if(!e||t===null)return!0;const l=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=a=>{o?console.warn(a,o):console.warn(a)};if(i==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const a=e.values||[];return a.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(c(`[${l}] Value ${a} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(c(`[${l}] Value ${a} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(a){return c(`[${l}] Invalid JSON for attribute "${n}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,n){for(const r in n){const[o,l,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,l,i)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=se(r.values,r.fallback);break;case"integer":o=ie;break;case"float":o=ce;break;case"boolean":o=le;break;case"list":o=ae;break;case"json":o=ue;break;case"string":default:o=N;break}o||(o=N),t[r.prop]=[o,n,r.fallback]}return t}function he(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 ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function T(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(a){console.error("["+n+"] init failed",c,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function pe(e){const t=K(),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(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=ge(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 G(e,t,n,r){for(let o=0;o<e.length;o++){const l=e[o];if(!t[l.attribute])continue;const i=l.effects&&l.effects[n];i?i(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function me(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),o=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const l=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<l.length;c++)U(l[c].spec,i,n,l[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&G(l,t,n,e.oldValue),r.reactiveWildcard.length&&G(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let l=0;l<o.length;l++){const i=o[l];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(T(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{me(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 Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ce(e){const t=Q();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,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 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 l=t[o];T(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.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 l=t[o],i=l.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let a=0;a<c.length;a++){const s=c[a];if(!document.contains(s)){const u=s[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",s,d)}delete s[l.attribute]}}}}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];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 _e(e,t,n,r,o={}){const l=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,a=o.onInit||null,s=o.onAttrChange||null,u=o.effects||null,d=o.attributes||null,f=d?he(d):u,x=d?new Set(Object.keys(d)):null,y=o.persist||null;function b(h){const g=h||document.body;if(T(g,e,t,n),d&&R())for(const w in d){const _=d[w],v=Array.from(g.querySelectorAll("["+w+"]"));g.matches&&g.matches("["+w+"]")&&v.push(g);for(let $=0;$<v.length;$++){const B=v[$];O(B)&&U(_,B.getAttribute(w),w,r,B)}}a&&a(g)}const C=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let g;for(;(g=h.exec(e))!==null;)C.push(g[1])}else C.push(e);pe({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:a,observed:C.concat(l),onAttributeChange:i,onAttrChange:s,effects:f,declared:x,persist:y}),ye();const D=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Q().push({selector:e,attribute:t,ComponentFn:n,onInit:a,onSubtreeChange:c,query:D}),Ae(),window[t]=b;function S(){we()>0?be(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),b}function J(e){return(e||"").replace(/^#/,"")}function M(e){const t=e===void 0?location.hash:e,n={},r=J(t);if(!r)return n;const o=r.split("&");for(let l=0;l<o.length;l++){const i=o[l];if(!i)continue;const c=i.indexOf(":"),a=c>-1?i.slice(0,c):i,s=c>-1?i.slice(c+1):"";if(a)try{n[a]=decodeURIComponent(s)}catch{n[a]=s}}return n}function ve(e){if(!e)return null;const t=M();return e in t?t[e]:null}function xe(e,t){if(!e)return;const n=M();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(l){const i=n[l];return i===""?l:l+":"+encodeURIComponent(i)}).join("&");J(location.hash)!==o&&(location.hash=o)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=M,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ee);const p={};function Fe(e){const t=e||"default";if(!p[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let o="",l=".";for(let i=0;i<r.length;i++)r[i].type==="group"&&(o=r[i].value),r[i].type==="decimal"&&(l=r[i].value);p[t]={groupSep:o,decimalSep:l,fmt:n}}return p[t]}function L(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,l=n.userDecimals!=null?n.userDecimals:null;if(o!==null){const i=r+"|max:"+o;return p[i]||(p[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),p[i].format(e)}if(l!==null&&l>0){const i=r+"|exact:"+l;return p[i]||(p[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:l,maximumFractionDigits:l})),p[i].format(e)}return Fe(t).fmt.format(e)}function Y(e){if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function A(e){return String(Math.round(e*1e3)/1e3)}function qe(e,t,n){const r=Y(e);return r===null||r<0?0:Math.min(r,Math.min(t,n)/2)}function Ne(e){if(typeof e!="string")return null;const t=e.trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(n=>!Number.isFinite(n))||t[2]<=0||t[3]<=0?null:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Ie(e){if(!e||typeof e!="string")return null;const t=e.split(":"),n=t[0].trim();return n?{field:n,direction:t[1]&&t[1].trim().toLowerCase()==="desc"?"desc":"asc"}:null}function Te(e,t){t=t||{};const n=t.viewBox||{x:0,y:0,width:1e3,height:320},r=t.xField||"label",o=t.yField||"value",l=t.includeZero!==!1,i=qe(t.padding,n.width,n.height),c=Array.isArray(e)?e:[],a=[];for(let h=0;h<c.length;h++){const g=c[h]||{},w=Y(g[o]);w!==null&&a.push({record:g,sourceIndex:h,label:g[r]==null?String(h+1):String(g[r]),value:w})}if(a.length===0)return{points:[],linePoints:"",areaPoints:"",count:0,min:null,max:null,domainMin:0,domainMax:1,baselineY:n.y+n.height-i};let s=a[0].value,u=a[0].value;for(let h=1;h<a.length;h++)a[h].value<s&&(s=a[h].value),a[h].value>u&&(u=a[h].value);let d=s,f=u;l&&(d=Math.min(0,d),f=Math.max(0,f)),d===f&&(f===0?f=1:f>0?d=0:f=0);const x=Math.max(1,n.width-i*2),y=Math.max(1,n.height-i*2),b=f-d,C=n.y+n.height-i-(0-d)/b*y,m=[];for(let h=0;h<a.length;h++){const g=a[h],w=a.length===1?.5:h/(a.length-1),_=n.x+i+w*x,v=n.y+n.height-i-(g.value-d)/b*y;m.push({record:g.record,sourceIndex:g.sourceIndex,label:g.label,value:g.value,x:_,y:v,pointString:A(_)+","+A(v)})}const D=m.map(h=>h.pointString).join(" ");let S="";if(m.length>0){const h=m[0],g=m[m.length-1],w=A(h.x)+","+A(C),_=A(g.x)+","+A(C);S=w+" "+D+" "+_}return{points:m,linePoints:D,areaPoints:S,count:m.length,min:s,max:u,domainMin:d,domainMax:f,baselineY:C}}(function(){const e="data-ln-chart",t="lnChart",n={x:0,y:0,width:1e3,height:320};if(window[t]!==void 0)return;function r(s){const u=s[t];u&&u.requestData()}function o(s){const u=s[t];u&&u._render()}const l={"data-ln-chart":{prop:"name",type:"string",read:N,fallback:"",effect:o,description:"Chart instance name or identifier"},"data-ln-chart-source":{type:"string",effect:r,description:"Source store or coordinator identifier"},"data-ln-chart-sort":{type:"string",effect:r,description:"Field name to sort chart series data by"},"data-ln-chart-type":{type:"enum",values:["line","bar","area","scatter"],fallback:"line",effect:o,description:"Visual chart render type"},"data-ln-chart-x":{type:"string",effect:o,description:"Field name mapping to X axis"},"data-ln-chart-y":{type:"string",effect:o,description:"Field name mapping to Y axis"},"data-ln-chart-padding":{type:"integer",fallback:20,min:0,effect:o,description:"Internal plot padding in pixels"},"data-ln-chart-zero":{type:"boolean",effect:o,description:"Forces Y axis scale to start at zero"}},i=fe(l);function c(s,u){s&&(s.textContent=u)}function a(s){this.dom=s,de(this,s,i),this.source=s.getAttribute("data-ln-chart-source")||this.name,this.plot=s.querySelector("[data-ln-chart-plot]"),this.line=s.querySelector("[data-ln-chart-line]"),this.area=s.querySelector("[data-ln-chart-area]"),this.labels=s.querySelector("[data-ln-chart-labels]"),this.empty=s.querySelector("[data-ln-chart-empty]"),this.minimum=s.querySelector("[data-ln-chart-min]"),this.maximum=s.querySelector("[data-ln-chart-max]"),this.count=s.querySelector("[data-ln-chart-count]"),this._data=[],this.model=null,this.isLoaded=!1;const u=this;return this._onSetData=function(d){const f=d.detail||{};u._data=Array.isArray(f.data)?f.data:[],u.isLoaded=!0,u._setLoading(!1),u._render()},this._onSetLoading=function(d){u._setLoading(!!(d.detail&&d.detail.loading))},this._onRefresh=function(){u.requestData()},s.addEventListener("ln-chart:set-data",this._onSetData),s.addEventListener("ln-chart:set-loading",this._onSetLoading),s.addEventListener("ln-chart:request-refresh",this._onRefresh),this.requestData(),this}a.prototype._readOptions=function(){const s=this.dom.getAttribute("data-ln-chart-padding"),u=s===null?NaN:Number(s),d=(this.dom.getAttribute("data-ln-chart-type")||"line").toLowerCase();return{xField:this.dom.getAttribute("data-ln-chart-x")||"label",yField:this.dom.getAttribute("data-ln-chart-y")||"value",includeZero:this.dom.getAttribute("data-ln-chart-zero")!=="false",padding:Number.isFinite(u)&&u>=0?u:16,type:d==="area"||d==="polygon"?"area":"line",viewBox:this.plot&&Ne(this.plot.getAttribute("viewBox"))||n}},a.prototype._setLoading=function(s){this.dom.classList.toggle("ln-chart--loading",s),this.dom.setAttribute("aria-busy",s?"true":"false")},a.prototype._renderLabels=function(s){if(!this.labels||(this.labels.replaceChildren(),s.count===0))return;const u=this.name+"-label",d='[data-ln-template="'+u+'"]';if(!this.dom.querySelector(d)&&!document.querySelector(d))return;const f=ne(this.dom,u,"ln-chart");if(!f)return;const x=W(this.dom);for(const y of s.points){const b=f.cloneNode(!0);q(b,{label:y.label,value:L(y.value,x)}),this.labels.appendChild(b)}},a.prototype._render=function(){const s=this._readOptions(),u=Te(this._data,s);this.model=u,this.line&&(this.line.setAttribute("points",u.linePoints),this.line.toggleAttribute("hidden",u.count===0)),this.area&&(this.area.setAttribute("points",u.areaPoints),this.area.toggleAttribute("hidden",u.count===0||s.type!=="area"));const d=u.count===0;this.dom.classList.toggle("ln-chart--empty",d),this.empty&&this.empty.toggleAttribute("hidden",!d);const f=W(this.dom);c(this.minimum,L(u.min,f)),c(this.maximum,L(u.max,f)),c(this.count,L(u.count,f)),this._renderLabels(u),E(this.dom,"ln-chart:rendered",{chart:this.name,count:u.count,min:u.min,max:u.max})},a.prototype.requestData=function(){this.source=this.dom.getAttribute("data-ln-chart-source")||this.name,E(this.dom,"ln-chart:request-data",{chart:this.name,source:this.source,sort:Ie(this.dom.getAttribute("data-ln-chart-sort")),filters:{},search:""})},a.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-chart:set-data",this._onSetData),this.dom.removeEventListener("ln-chart:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-chart:request-refresh",this._onRefresh),this._data=[],this.model=null,delete this.dom[t])},_e(e,t,a,"ln-chart",{attributes:l})})()})();
|
|
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 O(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!O(r))return}e.apply(console,t)}}function E(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 k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const j={};function z(e,t){j[e]=t}function X(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=z,window.lnCore.getDataMapper=X);function W(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function Z(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const V={};function ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];V[n]=t}function te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return V[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ee,window.lnCore.getLocaleFallback=te,window.lnCore.ensureLocaleObserver=Z);const F={};function P(e,t){F[e]||(F[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=F[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ne(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return P(t,n)}function U(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],a=c.getAttribute("data-ln-field");t[a]!=null&&(c.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],a=c.getAttribute("data-ln-attr").split(",");for(let s=0;s<a.length;s++){const u=a[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],a=c.getAttribute("data-ln-show");a in t&&c.classList.toggle("hidden",!t[a])}const l=e.querySelectorAll("[data-ln-class]");for(let i=0;i<l.length;i++){const c=l[i],a=c.getAttribute("data-ln-class").split(",");for(let s=0;s<a.length;s++){const u=a[s].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function re(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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let l=0;l<o.length;l++){const i=o[l],c=i.attributes;for(let a=0;a<c.length;a++){const s=c[a];s.value.indexOf("{{")!==-1&&i.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function oe(e,t,n,r,o,l){const i={};for(let a=0;a<e.children.length;a++){const s=e.children[a],u=s.getAttribute("data-ln-render-key");u&&(i[u]=s)}const c=document.createDocumentFragment();for(let a=0;a<t.length;a++){const s=t[a],u=String(r(s));let d=i[u];if(d)o(d,s,a);else{const f=P(n,l);if(!f||(q(f,s),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),o(d,s,a)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=U,window.lnCore.lnFill=re,window.lnCore.renderList=oe);function N(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function ie(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function le(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 ae(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(l,i){const c=l.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,o),o}function ce(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ue(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,o){if(!e||t===null)return!0;const l=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=a=>{o?console.warn(a,o):console.warn(a)};if(i==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const a=e.values||[];return a.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(c(`[${l}] Value ${a} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(c(`[${l}] Value ${a} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(a){return c(`[${l}] Invalid JSON for attribute "${n}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,n){for(const r in n){const[o,l,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,l,i)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=se(r.values,r.fallback);break;case"integer":o=ie;break;case"float":o=ce;break;case"boolean":o=le;break;case"list":o=ae;break;case"json":o=ue;break;case"string":default:o=N;break}o||(o=N),t[r.prop]=[o,n,r.fallback]}return t}function he(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 we(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function M(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(a){console.error("["+n+"] init failed",c,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function be(e){const t=K(),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(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=we(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 G(e,t,n,r){for(let o=0;o<e.length;o++){const l=e[o];if(!t[l.attribute])continue;const i=l.effects&&l.effects[n];i?i(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function me(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),o=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&O(t)){const l=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<l.length;c++)H(l[c].spec,i,n,l[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&G(l,t,n,e.oldValue),r.reactiveWildcard.length&&G(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let l=0;l<o.length;l++){const i=o[l];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(M(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{me(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 Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ce(e){const t=Q();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,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 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 l=t[o];M(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.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 l=t[o],i=l.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let a=0;a<c.length;a++){const s=c[a];if(!document.contains(s)){const u=s[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",s,d)}delete s[l.attribute]}}}}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];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 Ae(e,t,n,r,o={}){const l=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,a=o.onInit||null,s=o.onAttrChange||null,u=o.effects||null,d=o.attributes||null,f=d?he(d):u,v=d?new Set(Object.keys(d)):null,y=o.persist||null;function p(h){const w=h||document.body;if(M(w,e,t,n),d&&R())for(const g in d){const A=d[g],_=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&_.push(w);for(let $=0;$<_.length;$++){const B=_[$];O(B)&&H(A,B.getAttribute(g),g,r,B)}}a&&a(w)}const C=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let w;for(;(w=h.exec(e))!==null;)C.push(w[1])}else C.push(e);be({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:a,observed:C.concat(l),onAttributeChange:i,onAttrChange:s,effects:f,declared:v,persist:y}),ye();const D=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Q().push({selector:e,attribute:t,ComponentFn:n,onInit:a,onSubtreeChange:c,query:D}),xe(),window[t]=p;function S(){ge()>0?pe(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),p}function J(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=J(t);if(!r)return n;const o=r.split("&");for(let l=0;l<o.length;l++){const i=o[l];if(!i)continue;const c=i.indexOf(":"),a=c>-1?i.slice(0,c):i,s=c>-1?i.slice(c+1):"";if(a)try{n[a]=decodeURIComponent(s)}catch{n[a]=s}}return n}function _e(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ve(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(l){const i=n[l];return i===""?l:l+":"+encodeURIComponent(i)}).join("&");J(location.hash)!==o&&(location.hash=o)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=_e,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ee);function Fe(){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=Fe);const b={};function qe(e){const t=e||"default";if(!b[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let o="",l=".";for(let i=0;i<r.length;i++)r[i].type==="group"&&(o=r[i].value),r[i].type==="decimal"&&(l=r[i].value);b[t]={groupSep:o,decimalSep:l,fmt:n}}return b[t]}function L(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,l=n.userDecimals!=null?n.userDecimals:null;if(o!==null){const i=r+"|max:"+o;return b[i]||(b[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),b[i].format(e)}if(l!==null&&l>0){const i=r+"|exact:"+l;return b[i]||(b[i]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:l,maximumFractionDigits:l})),b[i].format(e)}return qe(t).fmt.format(e)}function Y(e){if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function x(e){return String(Math.round(e*1e3)/1e3)}function Ne(e,t,n){const r=Y(e);return r===null||r<0?0:Math.min(r,Math.min(t,n)/2)}function Ie(e){if(typeof e!="string")return null;const t=e.trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(n=>!Number.isFinite(n))||t[2]<=0||t[3]<=0?null:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Me(e){if(!e||typeof e!="string")return null;const t=e.split(":"),n=t[0].trim();return n?{field:n,direction:t[1]&&t[1].trim().toLowerCase()==="desc"?"desc":"asc"}:null}function Te(e,t){t=t||{};const n=t.viewBox||{x:0,y:0,width:1e3,height:320},r=t.xField||"label",o=t.yField||"value",l=t.includeZero!==!1,i=Ne(t.padding,n.width,n.height),c=Array.isArray(e)?e:[],a=[];for(let h=0;h<c.length;h++){const w=c[h]||{},g=Y(w[o]);g!==null&&a.push({record:w,sourceIndex:h,label:w[r]==null?String(h+1):String(w[r]),value:g})}if(a.length===0)return{points:[],linePoints:"",areaPoints:"",count:0,min:null,max:null,domainMin:0,domainMax:1,baselineY:n.y+n.height-i};let s=a[0].value,u=a[0].value;for(let h=1;h<a.length;h++)a[h].value<s&&(s=a[h].value),a[h].value>u&&(u=a[h].value);let d=s,f=u;l&&(d=Math.min(0,d),f=Math.max(0,f)),d===f&&(f===0?f=1:f>0?d=0:f=0);const v=Math.max(1,n.width-i*2),y=Math.max(1,n.height-i*2),p=f-d,C=n.y+n.height-i-(0-d)/p*y,m=[];for(let h=0;h<a.length;h++){const w=a[h],g=a.length===1?.5:h/(a.length-1),A=n.x+i+g*v,_=n.y+n.height-i-(w.value-d)/p*y;m.push({record:w.record,sourceIndex:w.sourceIndex,label:w.label,value:w.value,x:A,y:_,pointString:x(A)+","+x(_)})}const D=m.map(h=>h.pointString).join(" ");let S="";if(m.length>0){const h=m[0],w=m[m.length-1],g=x(h.x)+","+x(C),A=x(w.x)+","+x(C);S=g+" "+D+" "+A}return{points:m,linePoints:D,areaPoints:S,count:m.length,min:s,max:u,domainMin:d,domainMax:f,baselineY:C}}(function(){const e="data-ln-chart",t="lnChart",n={x:0,y:0,width:1e3,height:320};if(window[t]!==void 0)return;function r(s){const u=s[t];u&&u.requestData()}function o(s){const u=s[t];u&&u._render()}const l={"data-ln-chart":{prop:"name",type:"string",read:N,fallback:"",effect:o,description:"Chart instance name or identifier"},"data-ln-chart-source":{type:"string",effect:r,description:"Source store or coordinator identifier"},"data-ln-chart-sort":{type:"string",effect:r,description:"Field name to sort chart series data by"},"data-ln-chart-type":{type:"enum",values:["line","bar","area","scatter"],fallback:"line",effect:o,description:"Visual chart render type"},"data-ln-chart-x":{type:"string",effect:o,description:"Field name mapping to X axis"},"data-ln-chart-y":{type:"string",effect:o,description:"Field name mapping to Y axis"},"data-ln-chart-padding":{type:"integer",fallback:20,min:0,effect:o,description:"Internal plot padding in pixels"},"data-ln-chart-zero":{type:"boolean",effect:o,description:"Forces Y axis scale to start at zero"}},i=fe(l);function c(s,u){s&&(s.textContent=u)}function a(s){this.dom=s,de(this,s,i),this.source=s.getAttribute("data-ln-chart-source")||this.name,this.plot=s.querySelector("[data-ln-chart-plot]"),this.line=s.querySelector("[data-ln-chart-line]"),this.area=s.querySelector("[data-ln-chart-area]"),this.labels=s.querySelector("[data-ln-chart-labels]"),this.empty=s.querySelector("[data-ln-chart-empty]"),this.minimum=s.querySelector("[data-ln-chart-min]"),this.maximum=s.querySelector("[data-ln-chart-max]"),this.count=s.querySelector("[data-ln-chart-count]"),this._data=[],this.model=null,this.isLoaded=!1;const u=this;return this._onSetData=function(d){const f=d.detail||{};u._data=Array.isArray(f.data)?f.data:[],u.isLoaded=!0,u._setLoading(!1),u._render()},this._onSetLoading=function(d){u._setLoading(!!(d.detail&&d.detail.loading))},this._onRefresh=function(){u.requestData()},s.addEventListener("ln-chart:set-data",this._onSetData),s.addEventListener("ln-chart:set-loading",this._onSetLoading),s.addEventListener("ln-chart:request-refresh",this._onRefresh),this.requestData(),this}a.prototype._readOptions=function(){const s=this.dom.getAttribute("data-ln-chart-padding"),u=s===null?NaN:Number(s),d=(this.dom.getAttribute("data-ln-chart-type")||"line").toLowerCase();return{xField:this.dom.getAttribute("data-ln-chart-x")||"label",yField:this.dom.getAttribute("data-ln-chart-y")||"value",includeZero:this.dom.getAttribute("data-ln-chart-zero")!=="false",padding:Number.isFinite(u)&&u>=0?u:16,type:d==="area"||d==="polygon"?"area":"line",viewBox:this.plot&&Ie(this.plot.getAttribute("viewBox"))||n}},a.prototype._setLoading=function(s){this.dom.classList.toggle("ln-chart--loading",s),this.dom.setAttribute("aria-busy",s?"true":"false")},a.prototype._renderLabels=function(s){if(!this.labels||(this.labels.replaceChildren(),s.count===0))return;const u=this.name+"-label",d='[data-ln-template="'+u+'"]';if(!this.dom.querySelector(d)&&!document.querySelector(d))return;const f=ne(this.dom,u,"ln-chart");if(!f)return;const v=W(this.dom);for(const y of s.points){const p=f.cloneNode(!0);q(p,{label:y.label,value:L(y.value,v)}),this.labels.appendChild(p)}},a.prototype._render=function(){const s=this._readOptions(),u=Te(this._data,s);this.model=u,this.line&&(this.line.setAttribute("points",u.linePoints),this.line.toggleAttribute("hidden",u.count===0)),this.area&&(this.area.setAttribute("points",u.areaPoints),this.area.toggleAttribute("hidden",u.count===0||s.type!=="area"));const d=u.count===0;this.dom.classList.toggle("ln-chart--empty",d),this.empty&&this.empty.toggleAttribute("hidden",!d);const f=W(this.dom);c(this.minimum,L(u.min,f)),c(this.maximum,L(u.max,f)),c(this.count,L(u.count,f)),this._renderLabels(u),E(this.dom,"ln-chart:rendered",{chart:this.name,count:u.count,min:u.min,max:u.max})},a.prototype.requestData=function(){this.source=this.dom.getAttribute("data-ln-chart-source")||this.name,E(this.dom,"ln-chart:request-data",{chart:this.name,source:this.source,sort:Me(this.dom.getAttribute("data-ln-chart-sort")),filters:{},search:""})},a.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-chart:set-data",this._onSetData),this.dom.removeEventListener("ln-chart:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-chart:request-refresh",this._onRefresh),this._data=[],this.model=null,delete this.dom[t])},Ae(e,t,a,"ln-chart",{attributes:l})})()})();
|