@livenetworks/ashlar 2.1.11 → 2.1.13
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/README.md +25 -2
- package/components/COMPONENTS.md +82 -78
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/README.md +25 -69
- package/components/ln-core/events.js +5 -2
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +25 -44
- package/components/ln-core/reactive.js +0 -59
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/debug-verifier.js +24 -30
- package/components/ln-debug/src/ln-debug.js +3 -11
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/src/ln-filter.js +3 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +95 -85
- package/theme/README.md +73 -0
- package/theme/components/_table.scss +1 -2
- package/theme/config/_density.scss +104 -191
- package/theme/config/mixins/_avatar.scss +2 -2
- package/theme/config/mixins/_card.scss +2 -5
- package/theme/config/mixins/_form.scss +26 -39
- package/theme/config/mixins/_nav.scss +4 -4
- package/theme/config/mixins/_spacing.scss +4 -4
- package/theme/config/mixins/_table.scss +9 -33
- package/theme/tailwind/components.css +1661 -0
- package/theme/tailwind/entry.css +3 -0
- package/theme/tailwind/theme.css +23 -0
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!S(o))return}e.apply(console,t)}}function L(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(r)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const r=e.elements,o=[],i={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=se(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const $={};function ce(e,t){$[e]=t}function de(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);const x={};function he(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(u,t[p])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(u,!!t[p])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,r,o,i,s){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(o(c));let u=l[d];if(u)i(u,c,n);else{const p=he(r,s);if(!p||(j(p,c),u=p.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=V,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function E(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function U(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function W(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function P(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return k.set(r,i),i}function K(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function Q(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function G(e,t,r,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,r){for(const o in r){const[i,s,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=P(o.values,o.fallback);break;case"integer":i=U;break;case"float":i=K;break;case"boolean":i=W;break;case"list":i=H;break;case"json":i=Q;break;case"string":default:i=E;break}i||(i=E),t[o.prop]=[i,r,o.fallback]}return t}function ye(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=ge,window.lnCore.attrStr=E,window.lnCore.attrInt=U,window.lnCore.attrBool=W,window.lnCore.attrList=H,window.lnCore.attrEnum=P,window.lnCore.attrFloat=K,window.lnCore.attrJson=Q);function C(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&C(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)C(a[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=z(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function X(e,t,r,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=z(),i=o.byAttr.get(t),s=M()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&S(l)){const a=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<a.length;c++)G(a[c].spec,n,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&X(a,l,t,e.oldValue),o.reactiveWildcard.length&&X(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(J(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function q(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Y(e){const t=O();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=q();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)s.matches&&s.matches(n.query)&&C(s,n);else if(s.matches&&s.matches(n.query)&&C(s,n),s.querySelectorAll){const c=s.querySelectorAll(n.query);for(let d=0;d<c.length;d++)C(c[d],n)}}n.onInit&&n.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c){if(!l)s.matches&&s.matches(c)&&R(s,n);else if(s.matches&&s.matches(c)&&R(s,n),s.querySelectorAll){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)R(d[u],n)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Y(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Y(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ee(e){O().push(e),e.onSubtreeChange&&e.query&&q().push(e),Z()}function ee(e,t,r,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,p=u?ye(u):d,b=u?new Set(Object.keys(u)):null,m=i.persist||null;function f(F){const g=F||document.body;if(J(g,e,t,r),u&&M())for(const _ in u){const Ge=u[_],I=Array.from(g.querySelectorAll("["+_+"]"));g.matches&&g.matches("["+_+"]")&&I.push(g);for(let T=0;T<I.length;T++){const N=I[T];S(N)&&G(Ge,N.getAttribute(_),_,o,N)}}n&&n(g)}const w=[];if(e.indexOf("[")!==-1){const F=/\[([\w-]+)/g;let g;for(;(g=F.exec(e))!==null;)w.push(g[1])}else w.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:b,persist:m}),Le();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=i.subtreeQuery||(h?e:"["+e+"]"),v={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:y};O().push(v),a&&y&&q().push(v),Z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=Ee,window.lnCore.withoutLifecycle=xe);function oe(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function te(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,r={},o=te(t);if(!o)return r;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=D();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=D();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");te(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function De(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=ke,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=De,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Te);function Ne(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[s,l]of i.entries())r[s]=l;return r}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ve(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function He(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=$e,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ve,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=We,window.lnCore.queryFilterDecode=He);function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Pe);const ne={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function re(e,t=0){return e?!!(e.valid&&t===0):t===0}function Ke(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Qe(e,t){const r=[];if(e){const o=Object.keys(ne);for(let i=0;i<o.length;i++){const s=o[i],l=ne[s];e[l]&&r.push(s)}}if(t){const o=Array.from(t);for(let i=0;i<o.length;i++)o[i]&&r.indexOf(o[i])===-1&&r.push(o[i])}return r}(function(){const e="data-ln-validate",t="lnValidate",r="data-ln-validate-errors",o="data-ln-validate-error",i="ln-validate-valid",s="ln-validate-invalid";if(window[t]!==void 0)return;const l={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,d=n.tagName,u=n.type,p=d==="SELECT"||u==="checkbox"||u==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(m){const f=m.detail&&m.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const w=n.closest(".form-element");if(w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.remove("hidden")}n.classList.remove(i),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const f=m.detail&&m.detail.error,w=n.closest(".form-element");if(f){if(c._customErrors.delete(f),w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.add("hidden")}}else c._customErrors.forEach(function(h){if(w){const y=w.querySelector("["+o+'="'+h+'"]');y&&y.classList.add("hidden")}}),c._customErrors.clear();c._touched&&c.validate()},p||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const b=n.form;return b&&(b.hasAttribute("novalidate")||b.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(m){c._touched=!0,!c.validate()&&m.detail&&m.detail.invalidFields&&m.detail.invalidFields.push(c.dom)},b.addEventListener("reset",this._onFormReset),b.addEventListener("ln-validate:request-validate",this._onValidateRequest),b._lnValidateGateBound||(b._lnValidateGateBound=!0,b.addEventListener("submit",function(m){const f={invalidFields:[]};L(b,"ln-validate:request-validate",f),f.invalidFields.length>0&&(m.preventDefault(),f.invalidFields.sort((w,h)=>w.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Ke(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=re(c,this._customErrors.size),u=Qe(c,this._customErrors),p=n.closest(".form-element");if(p){const f=p.querySelector("["+r+"]");if(f){const w=f.querySelectorAll("["+o+"]");for(let h=0;h<w.length;h++){const y=w[h].getAttribute(o),v=!u.includes(y);w[h].classList.contains("hidden")!==v&&w[h].classList.toggle("hidden",v)}}}n.classList.contains(i)!==d&&n.classList.toggle(i,d),n.classList.contains(s)===d&&n.classList.toggle(s,!d);const b=d?"false":"true";return n.getAttribute("aria-invalid")!==b&&n.setAttribute("aria-invalid",b),L(n,d?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:u}),d},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.contains(i)&&this.dom.classList.remove(i),this.dom.classList.contains(s)&&this.dom.classList.remove(s),this.dom.hasAttribute("aria-invalid")&&this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const c=n.querySelectorAll("["+o+"]");for(let d=0;d<c.length;d++)c[d].classList.contains("hidden")||c[d].classList.add("hidden")}},Object.defineProperty(a.prototype,"isValid",{get:function(){return re(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(i,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},ee(e,t,a,"ln-validate",{attributes:l})})()})();
|
|
1
|
+
(function(){"use strict";function N(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function S(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!S(o))return}e.apply(console,t)}}function L(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function _(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 ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(r)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const r=e.elements,o=[],i={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const n=t[a];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=se(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const M={};function ce(e,t){M[e]=t}function de(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=de);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,_(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ue);const E={};function he(e,t){E[e]||(E[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=E[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const a=r[l],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();t[p]!=null&&a.setAttribute(u,t[p])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),p=d[1].trim();p in t&&a.classList.toggle(u,!!t[p])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function V(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,r,o,i,s){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(o(c));let u=l[d];if(u)i(u,c,n);else{const p=he(r,s);if(!p||(V(p,c),u=p.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=B,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function x(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function j(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function U(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return k.set(r,i),i}function P(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function K(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function Q(e,t,r,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function me(e,t,r){for(const o in r){const[i,s,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ge(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=H(o.values,o.fallback);break;case"integer":i=j;break;case"float":i=P;break;case"boolean":i=U;break;case"list":i=W;break;case"json":i=K;break;case"string":default:i=x;break}i||(i=x),t[o.prop]=[i,r,o.fallback]}return t}function ye(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=me,window.lnCore.attrSpec=ge,window.lnCore.attrStr=x,window.lnCore.attrInt=j,window.lnCore.attrBool=U,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=P,window.lnCore.attrJson=K);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function G(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&A(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)A(a[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function _e(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=J(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ce(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=J(),i=o.byAttr.get(t),s=N()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&S(l)){const a=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<a.length;c++)Q(a[c].spec,n,t,a[c].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&z(a,l,t,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(G(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function Le(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,_(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function q(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function X(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Y(e){const t=O();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=q();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(s.matches&&s.matches(c)&&(n.ComponentFn&&A(s,n),n.onInit&&n.onInit(s)),l&&s.querySelectorAll)){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)n.ComponentFn&&A(d[u],n),n.onInit&&n.onInit(d[u])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(s.matches&&s.matches(c)&&X(s,n),l&&s.querySelectorAll)){const d=s.querySelectorAll(c);for(let u=0;u<d.length;u++)X(d[u],n)}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,_(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Y(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Y(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){O().push(e),e.onSubtreeChange&&e.query&&q().push(e),Z()}function ee(e,t,r,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,p=u?ye(u):d,b=u?new Set(Object.keys(u)):null,m=i.persist||null;function f(I){const g=I||document.body;if(G(g,e,t,r),u&&N())for(const v in u){const Ge=u[v],D=Array.from(g.querySelectorAll("["+v+"]"));g.matches&&g.matches("["+v+"]")&&D.push(g);for(let F=0;F<D.length;F++){const T=D[F];S(T)&&Q(Ge,T.getAttribute(v),v,o,T)}}n&&n(g)}const w=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)w.push(g[1])}else w.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:w.concat(s),onAttributeChange:l,onAttrChange:c,effects:p,declared:b,persist:m}),Le();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,y=i.subtreeQuery||(h?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:y};O().push(C),a&&y&&q().push(C),Z(),window[t]=f,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Ee);function oe(){ve()>0?_e(function(){f(document.body)}):f(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),f}function te(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,r={},o=te(t);if(!o)return r;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),n=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=R();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");te(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=ke,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Te);function Ne(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[s,l]of i.entries())r[s]=l;return r}function $e(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Be(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ve(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function We(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function He(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=$e,window.lnCore.querySet=Be,window.lnCore.resolveQueryParam=Ve,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=We,window.lnCore.queryFilterDecode=He);function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Pe);const ne={required:"valueMissing",typeMismatch:"typeMismatch",tooShort:"tooShort",tooLong:"tooLong",patternMismatch:"patternMismatch",rangeUnderflow:"rangeUnderflow",rangeOverflow:"rangeOverflow"};function re(e,t=0){return e?!!(e.valid&&t===0):t===0}function Ke(e){return e.type==="checkbox"||e.type==="radio"?!!e.checked:!!(e.value&&e.value.trim()!=="")}function Qe(e,t){const r=[];if(e){const o=Object.keys(ne);for(let i=0;i<o.length;i++){const s=o[i],l=ne[s];e[l]&&r.push(s)}}if(t){const o=Array.from(t);for(let i=0;i<o.length;i++)o[i]&&r.indexOf(o[i])===-1&&r.push(o[i])}return r}(function(){const e="data-ln-validate",t="lnValidate",r="data-ln-validate-errors",o="data-ln-validate-error",i="ln-validate-valid",s="ln-validate-invalid";if(window[t]!==void 0)return;const l={"data-ln-validate":{type:"marker",description:"Activates validation on form input or field"},"data-ln-validate-errors":{type:"marker",description:"Container element holding validation error message elements"},"data-ln-validate-error":{type:"string",description:"Identifies error message template for a specific validation rule"}};function a(n){this.dom=n,this._touched=!1,this._customErrors=new Set;const c=this,d=n.tagName,u=n.type,p=d==="SELECT"||u==="checkbox"||u==="radio";this._onInput=function(){c._touched=!0,c.validate()},this._onChange=function(){c._touched=!0,c.validate()},this._onSetCustom=function(m){const f=m.detail&&m.detail.error;if(!f)return;c._customErrors.add(f),c._touched=!0;const w=n.closest(".form-element");if(w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.remove("hidden")}n.classList.remove(i),n.classList.add(s),n.setAttribute("aria-invalid","true")},this._onClearCustom=function(m){const f=m.detail&&m.detail.error,w=n.closest(".form-element");if(f){if(c._customErrors.delete(f),w){const h=w.querySelector("["+o+'="'+f+'"]');h&&h.classList.add("hidden")}}else c._customErrors.forEach(function(h){if(w){const y=w.querySelector("["+o+'="'+h+'"]');y&&y.classList.add("hidden")}}),c._customErrors.clear();c._touched&&c.validate()},p||n.addEventListener("input",this._onInput),n.addEventListener("change",this._onChange),n.addEventListener("ln-validate:set-custom",this._onSetCustom),n.addEventListener("ln-validate:clear-custom",this._onClearCustom);const b=n.form;return b&&(b.hasAttribute("novalidate")||b.setAttribute("novalidate",""),this._onFormReset=function(){c.reset()},this._onValidateRequest=function(m){c._touched=!0,!c.validate()&&m.detail&&m.detail.invalidFields&&m.detail.invalidFields.push(c.dom)},b.addEventListener("reset",this._onFormReset),b.addEventListener("ln-validate:request-validate",this._onValidateRequest),b._lnValidateGateBound||(b._lnValidateGateBound=!0,b.addEventListener("submit",function(m){const f={invalidFields:[]};L(b,"ln-validate:request-validate",f),f.invalidFields.length>0&&(m.preventDefault(),f.invalidFields.sort((w,h)=>w.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_PRECEDING?-1:1),f.invalidFields[0].focus())}))),Ke(n)&&(this._touched=!0,this.validate()),this}a.prototype.validate=function(){const n=this.dom,c=n.validity,d=re(c,this._customErrors.size),u=Qe(c,this._customErrors),p=n.closest(".form-element");if(p){const f=p.querySelector("["+r+"]");if(f){const w=f.querySelectorAll("["+o+"]");for(let h=0;h<w.length;h++){const y=w[h].getAttribute(o),C=!u.includes(y);w[h].classList.contains("hidden")!==C&&w[h].classList.toggle("hidden",C)}}}n.classList.contains(i)!==d&&n.classList.toggle(i,d),n.classList.contains(s)===d&&n.classList.toggle(s,!d);const b=d?"false":"true";return n.getAttribute("aria-invalid")!==b&&n.setAttribute("aria-invalid",b),L(n,d?"ln-validate:valid":"ln-validate:invalid",{target:n,field:n.name,errors:u}),d},a.prototype.reset=function(){this._touched=!1,this._customErrors.clear(),this.dom.classList.contains(i)&&this.dom.classList.remove(i),this.dom.classList.contains(s)&&this.dom.classList.remove(s),this.dom.hasAttribute("aria-invalid")&&this.dom.removeAttribute("aria-invalid");const n=this.dom.closest(".form-element");if(n){const c=n.querySelectorAll("["+o+"]");for(let d=0;d<c.length;d++)c[d].classList.contains("hidden")||c[d].classList.add("hidden")}},Object.defineProperty(a.prototype,"isValid",{get:function(){return re(this.dom.validity,this._customErrors.size)}}),a.prototype.destroy=function(){if(!this.dom[t])return;this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("change",this._onChange),this.dom.removeEventListener("ln-validate:set-custom",this._onSetCustom),this.dom.removeEventListener("ln-validate:clear-custom",this._onClearCustom);const n=this.dom.form;n&&(this._onFormReset&&n.removeEventListener("reset",this._onFormReset),this._onValidateRequest&&n.removeEventListener("ln-validate:request-validate",this._onValidateRequest)),this.dom.classList.remove(i,s),this.dom.removeAttribute("aria-invalid"),delete this.dom[t]},ee(e,t,a,"ln-validate",{attributes:l})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!v(r))return}e.apply(console,t)}}function m(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},l=e.elements,s={};if(n)for(let c=0;c<l.length;c++){const o=l[c];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<l.length;c++){const o=l[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&s[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&i[o.name].push(o.options[a].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const a=Number(o.value);i[o.name]=o.value===""||isNaN(a)?null:a}else i[o.name]=o.value}return i}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],i={};for(let l=0;l<n.length;l++){const s=n[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<n.length;l++){const s=n[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const o=t[c];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(i[s.name]>1){const a=String(o).split(",").map(function(h){return h.trim()});s.checked=a.indexOf(s.value)!==-1}else s.checked=le(o);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<s.options.length;a++)s.options[a].selected=o.indexOf(s.options[a].value)!==-1;r.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),r.push(s)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ie);const $={};function de(e,t){$[e]=t}function ue(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];j[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const q={};function he(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const c=r[s],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const c=l[s],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function U(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(s,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],c=s.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&s.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function be(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const a=e.children[o],h=a.getAttribute("data-ln-render-key");h&&(s[h]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],h=String(r(a));let f=s[h];if(f)i(f,a,o);else{const d=he(n,l);if(!d||(U(d,a),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),i(f,a,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=B,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function x(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function W(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function H(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const r=new Set(e||[]),i=function(l,s){const c=l.getAttribute(s);return c!==null&&r.has(c)?c:t};return E.set(n,i),i}function P(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Q(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function J(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e,t,n){for(const r in n){const[i,l,s]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=H(r.values,r.fallback);break;case"integer":i=W;break;case"float":i=P;break;case"boolean":i=K;break;case"list":i=V;break;case"json":i=Q;break;case"string":default:i=x;break}i||(i=x),t[r.prop]=[i,n,r.fallback]}return t}function me(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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=G,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=W,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=P,window.lnCore.attrJson=Q);function _(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function X(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(l)&&_(e,s),e.querySelectorAll){const c=e.querySelectorAll(l);for(let o=0;o<c.length;o++)_(c[o],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Y(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=Y(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.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 i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function ke(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=Y(),i=r.byAttr.get(t),l=M()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&v(s)){const c=r.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let a=0;a<c.length;a++)J(c[a].spec,o,t,c[a].componentTag,s)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&Z(c,s,t,e.oldValue),r.reactiveWildcard.length&&Z(r.reactiveWildcard,s,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(X(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ke(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function R(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ee(e){const t=O();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=L();if(e.target&&r.length)for(let i=0;i<r.length;i++){const l=r[i],s=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c];if(o.selector&&o.attribute&&o.ComponentFn){if(!s)l.matches&&l.matches(o.query)&&_(l,o);else if(l.matches&&l.matches(o.query)&&_(l,o),l.querySelectorAll){const a=l.querySelectorAll(o.query);for(let h=0;h<a.length;h++)_(a[h],o)}}o.onInit&&o.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c],a=o.query;if(a){if(!s)l.matches&&l.matches(a)&&R(l,o);else if(l.matches&&l.matches(a)&&R(l,o),l.querySelectorAll){const h=l.querySelectorAll(a);for(let f=0;f<h.length;f++)R(h[f],o)}}}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ee(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{ee(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){O().push(e),e.onSubtreeChange&&e.query&&L().push(e),te()}function ne(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,a=i.onAttrChange||null,h=i.effects||null,f=i.attributes||null,d=f?me(f):h,u=f?new Set(Object.keys(f)):null,w=i.persist||null;function p(I){const g=I||document.body;if(X(g,e,t,n),f&&M())for(const A in f){const Ve=f[A],T=Array.from(g.querySelectorAll("["+A+"]"));g.matches&&g.matches("["+A+"]")&&T.push(g);for(let F=0;F<T.length;F++){const N=T[F];v(N)&&J(Ve,N.getAttribute(A),A,r,N)}}o&&o(g)}const b=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)b.push(g[1])}else b.push(e);_e({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:b.concat(l),onAttributeChange:s,onAttrChange:a,effects:d,declared:u,persist:w}),Ae();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=i.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:k};O().push(C),c&&k&&L().push(C),te(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Se);function re(){ye()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),p}function oe(e){return(e||"").replace(/^#/,"")}function D(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const c=s.indexOf(":"),o=c>-1?s.slice(0,c):s,a=c>-1?s.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(a)}catch{n[o]=a}}return n}function ve(e){if(!e)return null;const t=D();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=D();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==i&&(location.hash=i)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Re(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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=D,window.lnCore.hashGet=ve,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Te(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Te(t);if(!r)return n;const i=new URLSearchParams(r);for(const[l,s]of i.entries())n[l]=s;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Ne,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=$e,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Be,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ke(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ke),(function(){const e="data-ln-websocket-connector",t="lnWebsocketConnector",n="lnConnector";if(window[t]!==void 0)return;const r=1e3,i=3e4;function l(d){const u=d[t];u&&(u.command==="connect"?u._open():u._disconnect())}function s(d){const u=d[t];!u||u.command!=="connect"||(u._drop("url-changed"),u._open())}const c={"data-ln-websocket-connector":{prop:"command",type:"enum",values:["connect","disconnect"],fallback:"connect",effect:l,description:"Connection command set from outside: connect or disconnect"},"data-ln-websocket-connector-url":{prop:"url",read:x,type:"string",fallback:"",effect:s,description:"WebSocket endpoint URL (ws:// or wss://)"}},o=z(c),a={"ln-websocket-connector:request-sync":"sync","ln-websocket-connector:request-query":"query","ln-websocket-connector:request-create":"create","ln-websocket-connector:request-update":"update","ln-websocket-connector:request-delete":"delete","ln-websocket-connector:request-bulk-delete":"bulk-delete"};function h(d,u){return d==="sync"?{since:u.since}:d==="query"?{query:u.query||{}}:d==="create"?{data:u.data,idempotencyKey:u.idempotencyKey}:d==="update"?{id:u.id,data:u.data,expected_version:u.expected_version,idempotencyKey:u.idempotencyKey}:d==="delete"?{id:u.id,idempotencyKey:u.idempotencyKey}:{ids:u.ids,idempotencyKey:u.idempotencyKey}}function f(d){this.dom=d,G(this,d,o),d[t]=this,d[n]=this,this.namespace="ln-websocket-connector",this._socket=null,this._status="disconnected",this._attempt=0,this._timer=null,this._seq=0,this._pending=new Map,this._held=[];const u=this;this._onRequest=function(w){u._request(a[w.type],w.detail||{})};for(const w in a)d.addEventListener(w,this._onRequest);return this.command==="connect"&&this._open(),this}f.prototype._open=function(){if(this._socket||this._timer)return;const d=this,u=this.url;this._attempt++,this._status="connecting",m(this.dom,"ln-websocket-connector:connecting",{url:u,attempt:this._attempt});let w;try{w=new WebSocket(u)}catch(p){this._status="disconnected",this._attempt=0,this._failAll(this._held,p.message),this._held=[],m(this.dom,"ln-websocket-connector:disconnected",{url:u,code:0,reason:p.message,willReconnect:!1});return}this._socket=w,w.onopen=function(){d._status="connected",d._attempt=0,m(d.dom,"ln-websocket-connector:connected",{url:u});const p=d._held;d._held=[];for(let b=0;b<p.length;b++)d._send(p[b])},w.onmessage=function(p){d._receive(p.data)},w.onclose=function(p){d._socket=null,d._status="disconnected",d._failPending("connection closed");const b=d.command==="connect";m(d.dom,"ln-websocket-connector:disconnected",{url:u,code:p.code,reason:p.reason,willReconnect:b}),b&&d._scheduleReconnect()}},f.prototype._scheduleReconnect=function(){const d=this,u=Math.min(r*Math.pow(2,Math.max(0,this._attempt-1)),i);this._timer=setTimeout(function(){d._timer=null,d._open()},u)},f.prototype._drop=function(d){const u=!!(this._socket||this._timer);clearTimeout(this._timer),this._timer=null,this._attempt=0,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,d),this._socket=null),u&&(this._status="disconnected",this._failPending("connection closed"),m(this.dom,"ln-websocket-connector:disconnected",{url:this.url,code:1e3,reason:d,willReconnect:!1}))},f.prototype._disconnect=function(){this._drop("disconnect"),this._failAll(this._held,"disconnected"),this._held=[]},f.prototype._request=function(d,u){const w={ref:String(++this._seq),type:d,detail:u};this._status==="connected"?this._send(w):this.command==="connect"?this._held.push(w):this._fail(w,0,"disconnected",null)},f.prototype._send=function(d){this._pending.set(d.ref,d),this._socket.send(JSON.stringify(Object.assign({ref:d.ref,type:d.type},h(d.type,d.detail))))},f.prototype._receive=function(d){let u;try{u=JSON.parse(d)}catch{console.warn("[ln-websocket-connector] Ignored a frame that is not JSON:",d);return}if(u.ref!==void 0){const w=this._pending.get(String(u.ref));if(!w)return;this._pending.delete(w.ref),u.ok?this._resolve(w,u.content,u.message||null):this._fail(w,u.status||0,u.error,u.data);return}u.type==="changes"&&m(this.dom,"ln-websocket-connector:fetched",{data:{data:u.data||[],deleted:u.deleted||[],synced_at:u.synced_at},since:null,meta:null})},f.prototype._resolve=function(d,u,w){const p=d.detail,b=p.meta||null,y=this.dom;if(d.type==="sync")m(y,"ln-websocket-connector:fetched",{data:u,since:p.since,meta:b});else if(d.type==="query"){const k=p.query||{},C=u||{};m(y,"ln-websocket-connector:fetched",{data:C.data||[],total:C.total,filtered:C.filtered,offset:k.offset,queryGen:k.queryGen,meta:b})}else d.type==="create"?m(y,"ln-websocket-connector:created",{record:u,tempId:p.tempId,message:w,meta:b}):d.type==="update"?m(y,"ln-websocket-connector:updated",{record:u,id:p.id,message:w,meta:b}):d.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:u,id:p.id,message:w,meta:b}):m(y,"ln-websocket-connector:bulk-deleted",{response:u,ids:p.ids,message:w,meta:b})},f.prototype._fail=function(d,u,w,p){const b=d.detail;m(this.dom,"ln-websocket-connector:error",{action:d.type,error:w,status:u,data:p||null,conflictData:u===409&&p||null,since:b.since,id:b.id,ids:b.ids,tempId:b.tempId,meta:b.meta||null})},f.prototype._failAll=function(d,u){for(let w=0;w<d.length;w++)this._fail(d[w],0,u,null)},f.prototype._failPending=function(d){const u=Array.from(this._pending.values());this._pending.clear(),this._failAll(u,d)},f.prototype.destroy=function(){if(this.dom[t]){for(const d in a)this.dom.removeEventListener(d,this._onRequest);clearTimeout(this._timer),this._timer=null,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,"destroy"),this._socket=null),this._pending.clear(),this._held=[],delete this.dom[t],delete this.dom[n]}},ne(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
|
|
1
|
+
(function(){"use strict";function N(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!v(r))return}e.apply(console,t)}}function m(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 A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},l=e.elements,s={};if(n)for(let c=0;c<l.length;c++){const o=l[c];o.name&&o.type==="checkbox"&&!o.disabled&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<l.length;c++){const o=l[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&s[o.name]===1?i[o.name]=o.checked:(i[o.name]||(i[o.name]=[]),o.checked&&i[o.name].push(o.value));else if(o.type==="radio")o.checked&&(i[o.name]=o.value);else if(o.type==="select-multiple"){i[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&i[o.name].push(o.options[a].value)}else if(n&&o.type==="hidden")i[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const a=Number(o.value);i[o.name]=o.value===""||isNaN(a)?null:a}else i[o.name]=o.value}return i}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],i={};for(let l=0;l<n.length;l++){const s=n[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<n.length;l++){const s=n[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const o=t[c];if(s.type==="checkbox"){if(Array.isArray(o))s.checked=o.indexOf(s.value)!==-1;else if(i[s.name]>1){const a=String(o).split(",").map(function(h){return h.trim()});s.checked=a.indexOf(s.value)!==-1}else s.checked=le(o);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(o),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<s.options.length;a++)s.options[a].selected=o.indexOf(s.options[a].value)!==-1;r.push(s)}else s.value=o,s.tagName==="SELECT"&&o!=null&&s.setAttribute("data-ln-value",o),r.push(s)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ie);const M={};function de(e,t){M[e]=t}function ue(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){m(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const q={};function he(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=q[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function j(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const c=r[s],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();t[d]!=null&&c.setAttribute(f,t[d])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const c=l[s],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const h=o[a].trim().split(":");if(h.length!==2)continue;const f=h[0].trim(),d=h[1].trim();d in t&&c.classList.toggle(f,!!t[d])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)j(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function B(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(s,c){return t[c]!==void 0?t[c]:""}))}const r=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],c=s.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&s.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function be(e,t,n,r,i,l){const s={};for(let o=0;o<e.children.length;o++){const a=e.children[o],h=a.getAttribute("data-ln-render-key");h&&(s[h]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],h=String(r(a));let f=s[h];if(f)i(f,a,o);else{const d=he(n,l);if(!d||(B(d,a),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",h),i(f,a,o)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=j,window.lnCore.lnFill=pe,window.lnCore.renderList=be);function S(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function U(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function W(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const r=new Set(e||[]),i=function(l,s){const c=l.getAttribute(s);return c!==null&&r.has(c)?c:t};return E.set(n,i),i}function H(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function P(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Q(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=o=>{i?console.warn(o,i):console.warn(o)};if(s==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${l}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${l}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${l}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(e,t,n){for(const r in n){const[i,l,s]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=V(r.values,r.fallback);break;case"integer":i=U;break;case"float":i=H;break;case"boolean":i=W;break;case"list":i=K;break;case"json":i=P;break;case"string":default:i=S;break}i||(i=S),t[r.prop]=[i,n,r.fallback]}return t}function me(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}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=J,window.lnCore.attrSpec=G,window.lnCore.attrStr=S,window.lnCore.attrInt=U,window.lnCore.attrBool=W,window.lnCore.attrList=K,window.lnCore.attrEnum=V,window.lnCore.attrFloat=H,window.lnCore.attrJson=P);function x(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function z(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(l)&&x(e,s),e.querySelectorAll){const c=e.querySelectorAll(l);for(let o=0;o<c.length;o++)x(c[o],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function X(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=X(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.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 i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[n];s?s(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function ke(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=X(),i=r.byAttr.get(t),l=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&v(s)){const c=r.byDeclaredAttr.get(t),o=s.getAttribute(t);for(let a=0;a<c.length;a++)Q(c[a].spec,o,t,c[a].componentTag,s)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&Y(c,s,t,e.oldValue),r.reactiveWildcard.length&&Y(r.reactiveWildcard,s,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const o=i[c];if(o.handler){o.handler(s,t,e.oldValue);continue}o.onAttributeChange&&s[o.attribute]?o.onAttributeChange(s,t):(z(s,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(s))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ke(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function O(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function Z(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ee(e){const t=O();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=L();if(e.target&&r.length)for(let i=0;i<r.length;i++){const l=r[i],s=l.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;c&&l.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType!==1)continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c],a=o.query;if(a&&(l.matches&&l.matches(a)&&(o.ComponentFn&&x(l,o),o.onInit&&o.onInit(l)),s&&l.querySelectorAll)){const h=l.querySelectorAll(a);for(let f=0;f<h.length;f++)o.ComponentFn&&x(h[f],o),o.onInit&&o.onInit(h[f])}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType!==1||document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let c=0;c<t.length;c++){const o=t[c],a=o.query;if(a&&(l.matches&&l.matches(a)&&Z(l,o),s&&l.querySelectorAll)){const h=l.querySelectorAll(a);for(let f=0;f<h.length;f++)Z(h[f],o)}}}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ee(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const i=n[r];if(i.type==="childList")try{ee(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){O().push(e),e.onSubtreeChange&&e.query&&L().push(e),te()}function ne(e,t,n,r,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,o=i.onInit||null,a=i.onAttrChange||null,h=i.effects||null,f=i.attributes||null,d=f?me(f):h,u=f?new Set(Object.keys(f)):null,w=i.persist||null;function p(I){const g=I||document.body;if(z(g,e,t,n),f&&N())for(const k in f){const Ve=f[k],D=Array.from(g.querySelectorAll("["+k+"]"));g.matches&&g.matches("["+k+"]")&&D.push(g);for(let T=0;T<D.length;T++){const F=D[T];v(F)&&Q(Ve,F.getAttribute(k),k,r,F)}}o&&o(g)}const b=[];if(e.indexOf("[")!==-1){const I=/\[([\w-]+)/g;let g;for(;(g=I.exec(e))!==null;)b.push(g[1])}else b.push(e);_e({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:o,observed:b.concat(l),onAttributeChange:s,onAttrChange:a,effects:d,declared:u,persist:w}),Ae();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,_=i.subtreeQuery||(y?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:c,query:_};O().push(C),c&&_&&L().push(C),te(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ne,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=Se);function re(){ye()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),p}function oe(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,n={},r=oe(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const c=s.indexOf(":"),o=c>-1?s.slice(0,c):s,a=c>-1?s.slice(c+1):"";if(o)try{n[o]=decodeURIComponent(a)}catch{n[o]=a}}return n}function ve(e){if(!e)return null;const t=R();return e in t?t[e]:null}function qe(e,t){if(!e)return;const n=R();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const s=n[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");oe(location.hash)!==i&&(location.hash=i)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 Re(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=ve,window.lnCore.hashSet=qe,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function Te(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=Te(t);if(!r)return n;const i=new URLSearchParams(r);for(const[l,s]of i.entries())n[l]=s;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Ne,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=$e,window.lnCore.querySortEncode=je,window.lnCore.querySortDecode=Be,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ke(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ke),(function(){const e="data-ln-websocket-connector",t="lnWebsocketConnector",n="lnConnector";if(window[t]!==void 0)return;const r=1e3,i=3e4;function l(d){const u=d[t];u&&(u.command==="connect"?u._open():u._disconnect())}function s(d){const u=d[t];!u||u.command!=="connect"||(u._drop("url-changed"),u._open())}const c={"data-ln-websocket-connector":{prop:"command",type:"enum",values:["connect","disconnect"],fallback:"connect",effect:l,description:"Connection command set from outside: connect or disconnect"},"data-ln-websocket-connector-url":{prop:"url",read:S,type:"string",fallback:"",effect:s,description:"WebSocket endpoint URL (ws:// or wss://)"}},o=G(c),a={"ln-websocket-connector:request-sync":"sync","ln-websocket-connector:request-query":"query","ln-websocket-connector:request-create":"create","ln-websocket-connector:request-update":"update","ln-websocket-connector:request-delete":"delete","ln-websocket-connector:request-bulk-delete":"bulk-delete"};function h(d,u){return d==="sync"?{since:u.since}:d==="query"?{query:u.query||{}}:d==="create"?{data:u.data,idempotencyKey:u.idempotencyKey}:d==="update"?{id:u.id,data:u.data,expected_version:u.expected_version,idempotencyKey:u.idempotencyKey}:d==="delete"?{id:u.id,idempotencyKey:u.idempotencyKey}:{ids:u.ids,idempotencyKey:u.idempotencyKey}}function f(d){this.dom=d,J(this,d,o),d[t]=this,d[n]=this,this.namespace="ln-websocket-connector",this._socket=null,this._status="disconnected",this._attempt=0,this._timer=null,this._seq=0,this._pending=new Map,this._held=[];const u=this;this._onRequest=function(w){u._request(a[w.type],w.detail||{})};for(const w in a)d.addEventListener(w,this._onRequest);return this.command==="connect"&&this._open(),this}f.prototype._open=function(){if(this._socket||this._timer)return;const d=this,u=this.url;this._attempt++,this._status="connecting",m(this.dom,"ln-websocket-connector:connecting",{url:u,attempt:this._attempt});let w;try{w=new WebSocket(u)}catch(p){this._status="disconnected",this._attempt=0,this._failAll(this._held,p.message),this._held=[],m(this.dom,"ln-websocket-connector:disconnected",{url:u,code:0,reason:p.message,willReconnect:!1});return}this._socket=w,w.onopen=function(){d._status="connected",d._attempt=0,m(d.dom,"ln-websocket-connector:connected",{url:u});const p=d._held;d._held=[];for(let b=0;b<p.length;b++)d._send(p[b])},w.onmessage=function(p){d._receive(p.data)},w.onclose=function(p){d._socket=null,d._status="disconnected",d._failPending("connection closed");const b=d.command==="connect";m(d.dom,"ln-websocket-connector:disconnected",{url:u,code:p.code,reason:p.reason,willReconnect:b}),b&&d._scheduleReconnect()}},f.prototype._scheduleReconnect=function(){const d=this,u=Math.min(r*Math.pow(2,Math.max(0,this._attempt-1)),i);this._timer=setTimeout(function(){d._timer=null,d._open()},u)},f.prototype._drop=function(d){const u=!!(this._socket||this._timer);clearTimeout(this._timer),this._timer=null,this._attempt=0,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,d),this._socket=null),u&&(this._status="disconnected",this._failPending("connection closed"),m(this.dom,"ln-websocket-connector:disconnected",{url:this.url,code:1e3,reason:d,willReconnect:!1}))},f.prototype._disconnect=function(){this._drop("disconnect"),this._failAll(this._held,"disconnected"),this._held=[]},f.prototype._request=function(d,u){const w={ref:String(++this._seq),type:d,detail:u};this._status==="connected"?this._send(w):this.command==="connect"?this._held.push(w):this._fail(w,0,"disconnected",null)},f.prototype._send=function(d){this._pending.set(d.ref,d),this._socket.send(JSON.stringify(Object.assign({ref:d.ref,type:d.type},h(d.type,d.detail))))},f.prototype._receive=function(d){let u;try{u=JSON.parse(d)}catch{console.warn("[ln-websocket-connector] Ignored a frame that is not JSON:",d);return}if(u.ref!==void 0){const w=this._pending.get(String(u.ref));if(!w)return;this._pending.delete(w.ref),u.ok?this._resolve(w,u.content,u.message||null):this._fail(w,u.status||0,u.error,u.data);return}u.type==="changes"&&m(this.dom,"ln-websocket-connector:fetched",{data:{data:u.data||[],deleted:u.deleted||[],synced_at:u.synced_at},since:null,meta:null})},f.prototype._resolve=function(d,u,w){const p=d.detail,b=p.meta||null,y=this.dom;if(d.type==="sync")m(y,"ln-websocket-connector:fetched",{data:u,since:p.since,meta:b});else if(d.type==="query"){const _=p.query||{},C=u||{};m(y,"ln-websocket-connector:fetched",{data:C.data||[],total:C.total,filtered:C.filtered,offset:_.offset,queryGen:_.queryGen,meta:b})}else d.type==="create"?m(y,"ln-websocket-connector:created",{record:u,tempId:p.tempId,message:w,meta:b}):d.type==="update"?m(y,"ln-websocket-connector:updated",{record:u,id:p.id,message:w,meta:b}):d.type==="delete"?m(y,"ln-websocket-connector:deleted",{response:u,id:p.id,message:w,meta:b}):m(y,"ln-websocket-connector:bulk-deleted",{response:u,ids:p.ids,message:w,meta:b})},f.prototype._fail=function(d,u,w,p){const b=d.detail;m(this.dom,"ln-websocket-connector:error",{action:d.type,error:w,status:u,data:p||null,conflictData:u===409&&p||null,since:b.since,id:b.id,ids:b.ids,tempId:b.tempId,meta:b.meta||null})},f.prototype._failAll=function(d,u){for(let w=0;w<d.length;w++)this._fail(d[w],0,u,null)},f.prototype._failPending=function(d){const u=Array.from(this._pending.values());this._pending.clear(),this._failAll(u,d)},f.prototype.destroy=function(){if(this.dom[t]){for(const d in a)this.dom.removeEventListener(d,this._onRequest);clearTimeout(this._timer),this._timer=null,this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(1e3,"destroy"),this._socket=null),this._pending.clear(),this._held=[],delete this.dom[t],delete this.dom[n]}},ne(e,t,f,"ln-websocket-connector",{attributes:c})})()})();
|
package/package.json
CHANGED
|
@@ -1,85 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@livenetworks/ashlar",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
|
|
5
|
-
"license": "GPL-3.0-or-later",
|
|
6
|
-
"author": "Live Networks",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/livenetworks/ln-ashlar.git"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/livenetworks/ln-ashlar#readme",
|
|
16
|
-
"bugs": "https://github.com/livenetworks/ln-ashlar/issues",
|
|
17
|
-
"keywords": [
|
|
18
|
-
"css",
|
|
19
|
-
"scss",
|
|
20
|
-
"design-system",
|
|
21
|
-
"frontend",
|
|
22
|
-
"components",
|
|
23
|
-
"vanilla-js"
|
|
24
|
-
],
|
|
25
|
-
"main": "./dist/ln-ashlar.js",
|
|
26
|
-
"style": "./dist/ln-ashlar.css",
|
|
27
|
-
"web-types": "./web-types.json",
|
|
28
|
-
"files": [
|
|
29
|
-
"dist/",
|
|
30
|
-
"theme/",
|
|
31
|
-
"components/",
|
|
32
|
-
"ln-ashlar.html-data.json",
|
|
33
|
-
"web-types.json"
|
|
34
|
-
],
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"import": "./dist/ln-ashlar.js",
|
|
38
|
-
"default": "./dist/ln-ashlar.js"
|
|
39
|
-
},
|
|
40
|
-
"./core.css": "./dist/ln-ashlar-core.css",
|
|
41
|
-
"./theme.css": "./dist/ln-ashlar-theme.css",
|
|
42
|
-
"./full.css": "./dist/ln-ashlar.css",
|
|
43
|
-
"./landing.css": "./dist/ln-ashlar-landing.css",
|
|
44
|
-
"./presentation.css": "./dist/ln-ashlar-landing.css",
|
|
45
|
-
"./dev.css": "./dist/ln-ashlar-dev.css",
|
|
46
|
-
"./dev.js": "./dist/ln-ashlar-dev.js",
|
|
47
|
-
"./theme/*": "./theme/*",
|
|
48
|
-
"./components/*": "./components/*"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"test:
|
|
53
|
-
"test:
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"build
|
|
57
|
-
"build:
|
|
58
|
-
"
|
|
59
|
-
"build:
|
|
60
|
-
"
|
|
61
|
-
"build:demo-
|
|
62
|
-
"build:demo-
|
|
63
|
-
"build:demo-
|
|
64
|
-
"build:demo-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"sync:ln-
|
|
68
|
-
"sync:ln-
|
|
69
|
-
"sync:ln-events
|
|
70
|
-
"sync:
|
|
71
|
-
"sync:
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
}
|
|
85
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@livenetworks/ashlar",
|
|
3
|
+
"version": "2.1.13",
|
|
4
|
+
"description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
|
|
5
|
+
"license": "GPL-3.0-or-later",
|
|
6
|
+
"author": "Live Networks",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/livenetworks/ln-ashlar.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/livenetworks/ln-ashlar#readme",
|
|
16
|
+
"bugs": "https://github.com/livenetworks/ln-ashlar/issues",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"css",
|
|
19
|
+
"scss",
|
|
20
|
+
"design-system",
|
|
21
|
+
"frontend",
|
|
22
|
+
"components",
|
|
23
|
+
"vanilla-js"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/ln-ashlar.js",
|
|
26
|
+
"style": "./dist/ln-ashlar.css",
|
|
27
|
+
"web-types": "./web-types.json",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/",
|
|
30
|
+
"theme/",
|
|
31
|
+
"components/",
|
|
32
|
+
"ln-ashlar.html-data.json",
|
|
33
|
+
"web-types.json"
|
|
34
|
+
],
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"import": "./dist/ln-ashlar.js",
|
|
38
|
+
"default": "./dist/ln-ashlar.js"
|
|
39
|
+
},
|
|
40
|
+
"./core.css": "./dist/ln-ashlar-core.css",
|
|
41
|
+
"./theme.css": "./dist/ln-ashlar-theme.css",
|
|
42
|
+
"./full.css": "./dist/ln-ashlar.css",
|
|
43
|
+
"./landing.css": "./dist/ln-ashlar-landing.css",
|
|
44
|
+
"./presentation.css": "./dist/ln-ashlar-landing.css",
|
|
45
|
+
"./dev.css": "./dist/ln-ashlar-dev.css",
|
|
46
|
+
"./dev.js": "./dist/ln-ashlar-dev.js",
|
|
47
|
+
"./theme/*": "./theme/*",
|
|
48
|
+
"./components/*": "./components/*",
|
|
49
|
+
"./tailwind.css": "./dist/ln-ashlar-tailwind.css"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"test": "npm run sync:ln-schemas:check && npm run sync:ln-events:check && npm run sync:css-tokens:check && node --test \"tests/*.test.js\"",
|
|
53
|
+
"test:p0": "node --test tests/p0-data-integrity.test.js",
|
|
54
|
+
"test:headless": "node tests/headless/run-all.mjs",
|
|
55
|
+
"dev": "node scripts/build.mjs --watch",
|
|
56
|
+
"build": "npm run sync:ln-schemas && npm run sync:ln-events && npm run sync:css-tokens && node scripts/build.mjs && npm run build:tailwind && npm run build:dev-css && npm run build:demos",
|
|
57
|
+
"build:tailwind": "node scripts/build-tailwind.mjs",
|
|
58
|
+
"build:demos": "npm run build:demo-index && npm run build:demo-admin && npm run build:demo-docuflow && npm run build:demo-spa && npm run build:demo-landing && npm run build:demo-corporate",
|
|
59
|
+
"build:dev-css": "sass theme/ln-ashlar-dev.scss demo/dist/ln-ashlar-dev.css --no-source-map --style=compressed",
|
|
60
|
+
"generate:brand-assets": "powershell -ExecutionPolicy Bypass -File scripts/generate-brand-assets.ps1 && node scripts/generate-svg-favicon.mjs",
|
|
61
|
+
"build:demo-index": "sass demo/index.scss demo/index.css --no-source-map --style=compressed",
|
|
62
|
+
"build:demo-admin": "sass demo/admin/src/admin.scss demo/admin/dist/admin.css --no-source-map --style=compressed && node -e \"const fs = require('fs'); fs.copyFileSync('demo/admin/src/demo.js', 'demo/admin/dist/demo.js')\" && node demo/admin/src/build-pages.mjs",
|
|
63
|
+
"build:demo-docuflow": "sass demo/docuflow/docuflow.scss demo/docuflow/dist/docuflow.css --no-source-map --style=compressed",
|
|
64
|
+
"build:demo-spa": "node demo/spa/build.mjs",
|
|
65
|
+
"build:demo-landing": "sass demo/landing/landing.scss demo/landing/landing.css --no-source-map --style=compressed",
|
|
66
|
+
"build:demo-corporate": "sass demo/corporate/corporate.scss demo/corporate/corporate.css --no-source-map --style=compressed",
|
|
67
|
+
"sync:ln-schemas": "node scripts/sync-ln-schemas.mjs",
|
|
68
|
+
"sync:ln-schemas:check": "node scripts/sync-ln-schemas.mjs --check",
|
|
69
|
+
"sync:ln-events": "node scripts/sync-ln-events.mjs",
|
|
70
|
+
"sync:ln-events:check": "node scripts/sync-ln-events.mjs --check",
|
|
71
|
+
"sync:ln-events:strict": "node scripts/sync-ln-events.mjs --strict",
|
|
72
|
+
"sync:css-tokens": "node scripts/sync-css-tokens.mjs",
|
|
73
|
+
"sync:css-tokens:check": "node scripts/sync-css-tokens.mjs --check",
|
|
74
|
+
"manifest": "node scripts/extract-manifest.mjs",
|
|
75
|
+
"manifest:file": "node scripts/extract-manifest.mjs --output=docs/manifest.txt",
|
|
76
|
+
"generate:llms": "node scripts/generate-llms.mjs",
|
|
77
|
+
"generate:llms:check": "node scripts/generate-llms.mjs --check",
|
|
78
|
+
"test:visual": "node tests/headless/visual-run.mjs",
|
|
79
|
+
"test:perf": "node tests/headless/perf-run.mjs",
|
|
80
|
+
"test:perf:history": "node tests/headless/perf-run.mjs --history",
|
|
81
|
+
"test:perf:compare": "node tests/headless/perf-run.mjs --compare",
|
|
82
|
+
"test:perf:density": "node tests/headless/perf-density.mjs",
|
|
83
|
+
"test:dual": "node tests/headless/dual-run.mjs"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@tabler/icons": "^3.41.1",
|
|
87
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
88
|
+
"fake-indexeddb": "^6.2.4",
|
|
89
|
+
"flag-icons": "^7.5.0",
|
|
90
|
+
"puppeteer-core": "^25.1.0",
|
|
91
|
+
"sass-embedded": "^1.83.0",
|
|
92
|
+
"tailwindcss": "^4.3.3",
|
|
93
|
+
"vite": "^6.0.0"
|
|
94
|
+
}
|
|
95
|
+
}
|
package/theme/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 🎨 ln-ashlar Theme & CSS Architecture
|
|
2
|
+
|
|
3
|
+
`ln-ashlar` provides a high-performance visual layer with **Dual CSS Engine Support**:
|
|
4
|
+
1. **Ashlar SCSS (Native):** Semantic class-free, design token-driven stylesheet system optimized for minimal CSSOM invalidation and modern W3C standards.
|
|
5
|
+
2. **Tailwind CSS v4:** Utility-first engine compiling into a standalone bundle (`dist/ln-ashlar-tailwind.css`) with comprehensive layout and interaction parity verified across all 67 demo pages.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🏛️ Directory Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
theme/
|
|
13
|
+
├── base/ # Global HTML5 element resets, typography, and defaults
|
|
14
|
+
├── components/ # Layer 2 component styling (card, table, form, modal, nav, etc.)
|
|
15
|
+
├── config/ # Design tokens, density scales, color themes, and mixins
|
|
16
|
+
│ ├── mixins/ # Reusable SCSS mixins for semantic styling
|
|
17
|
+
│ ├── _tokens.scss # Master CSS custom properties (colors, spacing, radius, shadows)
|
|
18
|
+
│ ├── _theme.scss # Theme definitions (Default, Glass, Flat, Minimal)
|
|
19
|
+
│ └── _density.scss # Density scale rebinds (compact, default, spacious)
|
|
20
|
+
├── tailwind/ # Tailwind CSS v4 source definitions
|
|
21
|
+
│ ├── theme.css # Design token mappings to Tailwind v4 @theme directive
|
|
22
|
+
│ ├── components.css # Component utility recipes
|
|
23
|
+
│ └── entry.css # Entrypoint bundle
|
|
24
|
+
├── ln-ashlar.scss # Master bundle (Core + Theme)
|
|
25
|
+
└── ln-ashlar-theme.scss # Theme-only visual design system bundle
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## ⚡ SCSS Performance & Selector Best Practices
|
|
31
|
+
|
|
32
|
+
To prevent browser style invalidation storms during interactive DOM mutations, all SCSS mixins and components adhere to the following rules:
|
|
33
|
+
|
|
34
|
+
1. **Avoid Repeating `:has()` Inside Mixins:**
|
|
35
|
+
- Never embed complex `:has()` selectors inside mixins that are `@include`d across multiple component variants or classes.
|
|
36
|
+
- De-duplicate and hoist container-level `:has()` rules to global component scopes using `:is(...)` (e.g. `:is(.card, .section-card, [class*="card"]) > :is(main, a > main):has(...)`).
|
|
37
|
+
|
|
38
|
+
2. **Prefer Natural Cascade over `:not(:has(...))`:**
|
|
39
|
+
- Negative `:not(:has(...))` selectors force the browser layout engine to traverse ancestor trees repeatedly to prove absence.
|
|
40
|
+
- Use CSS source-order cascade instead:
|
|
41
|
+
```scss
|
|
42
|
+
// ✅ RECOMMENDED: Natural cascade override
|
|
43
|
+
&:hover { border-color: var(--color-accent); }
|
|
44
|
+
&:has(> input:checked) {
|
|
45
|
+
border-color: var(--color-accent);
|
|
46
|
+
color: var(--color-accent);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. **Use Logical Properties for Sizing and Spacing:**
|
|
51
|
+
- Mixins for padding and margin use modern CSS logical properties (`padding-inline`, `padding-block`, `margin-inline`, `margin-block`), reducing generated rules by 50% compared to separate physical properties (`-left`, `-right`, `-top`, `-bottom`).
|
|
52
|
+
|
|
53
|
+
4. **Anchor Pseudo-Elements to Direct Elements:**
|
|
54
|
+
- Apply active indicators (e.g. `::before`) directly to the target element (`a::before`) with `position: relative`, rather than querying parent containers (`li:has(a.active)::before`).
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 💨 Tailwind CSS v4 Engine
|
|
59
|
+
|
|
60
|
+
To compile the Tailwind v4 bundle:
|
|
61
|
+
```sh
|
|
62
|
+
npm run build:tailwind
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The output bundle is generated at:
|
|
66
|
+
- `dist/ln-ashlar-tailwind.css`
|
|
67
|
+
- `demo/admin/dist/admin-tailwind.css`
|
|
68
|
+
- `demo/dist/ln-ashlar-tailwind.css`
|
|
69
|
+
|
|
70
|
+
Consumers can toggle between engines dynamically in the browser or via:
|
|
71
|
+
```javascript
|
|
72
|
+
localStorage.setItem('ln-demo-engine', 'tailwind'); // or 'ashlar'
|
|
73
|
+
```
|