@livenetworks/ashlar 2.1.5 → 2.1.6

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.
@@ -81,8 +81,14 @@ All attributes are dynamically observed. Any runtime changes to these attributes
81
81
  | `data-ln-api-connector` | Selector | Creates the component instance. Optional value serves as name. |
82
82
  | `data-ln-api-base-url` | Connection | The base URL of the API gateway (e.g. `https://api.example.com/v1` or `/api`). |
83
83
  | `data-ln-api-path` | Connection | Resource path endpoint (e.g. `/documents`). |
84
+ | `data-ln-api-endpoint` | Connection | Alias for `data-ln-api-path`. |
84
85
  | `data-ln-api-headers` | Credentials | JSON-formatted string of request headers (e.g. `{"Authorization": "Bearer tok_123"}`). |
85
- | `data-ln-api-connector-query-debounce="ms"` | Connection | Debounce delay in milliseconds for `request-query` events. Default `300`. Set to `0` to disable. Mutations (create/update/delete) are never debounced. |
86
+ | `data-ln-api-param-offset` | Parameters | Query parameter name for pagination offset (default: `'offset'`). |
87
+ | `data-ln-api-param-limit` | Parameters | Query parameter name for pagination page size (default: `'limit'`). |
88
+ | `data-ln-api-param-search` | Parameters | Query parameter name for text search filter (default: `'search'`). |
89
+ | `data-ln-api-param-sort-field` | Parameters | Query parameter name for sort field (default: `'sort_by'`). |
90
+ | `data-ln-api-param-sort-dir` | Parameters | Query parameter name for sort direction (default: `'sort_dir'`). |
91
+ | `data-ln-api-connector-query-debounce="ms"` | Connection | Debounce delay in milliseconds for `request-query` events. Default `200` ms. Set to `0` to disable. Mutations (create/update/delete) are never debounced. |
86
92
 
87
93
  ---
88
94
 
@@ -1 +1 @@
1
- (function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!q(o))return}e.apply(console,t)}}function b(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 x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,l={},c=e.elements,a={};if(r)for(let d=0;d<c.length;d++){const i=c[d];i.name&&i.type==="checkbox"&&!i.disabled&&(a[i.name]=(a[i.name]||0)+1)}for(let d=0;d<c.length;d++){const i=c[d];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")r&&a[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let n=0;n<i.options.length;n++)i.options[n].selected&&l[i.name].push(i.options[n].value)}else if(r&&i.type==="hidden")l[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const n=Number(i.value);l[i.name]=i.value===""||isNaN(n)?null:n}else l[i.name]=i.value}return l}function ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const r=e.elements,o=[],l={};for(let c=0;c<r.length;c++){const a=r[c];a.name&&a.type==="checkbox"&&(l[a.name]=(l[a.name]||0)+1)}for(let c=0;c<r.length;c++){const a=r[c];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const d=a.getAttribute("data-ln-fill-as")||a.name;if(!d||!(d in t))continue;const i=t[d];if(a.type==="checkbox"){if(Array.isArray(i))a.checked=i.indexOf(a.value)!==-1;else if(l[a.name]>1){const n=String(i).split(",").map(function(f){return f.trim()});a.checked=n.indexOf(a.value)!==-1}else a.checked=ce(i);o.push(a)}else if(a.type==="radio")a.checked=a.value===String(i),o.push(a);else if(a.type==="select-multiple"){if(Array.isArray(i))for(let n=0;n<a.options.length;n++)a.options[n].selected=i.indexOf(a.options[n].value)!==-1;o.push(a)}else a.value=i,a.tagName==="SELECT"&&i!=null&&a.setAttribute("data-ln-value",i),o.push(a)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ae);function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(r){return console.error(`[${t}] Invalid headers JSON:`,r),{}}}const M={};function fe(e,t){M[e]=t}function he(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){b(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function we(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=pe);const L={};function be(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=L[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let a=0;a<r.length;a++){const d=r[a],i=d.getAttribute("data-ln-field");t[i]!=null&&(d.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<o.length;a++){const d=o[a],i=d.getAttribute("data-ln-attr").split(",");for(let n=0;n<i.length;n++){const f=i[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();t[u]!=null&&d.setAttribute(s,t[u])}}const l=e.querySelectorAll("[data-ln-show]");for(let a=0;a<l.length;a++){const d=l[a],i=d.getAttribute("data-ln-show");i in t&&d.classList.toggle("hidden",!t[i])}const c=e.querySelectorAll("[data-ln-class]");for(let a=0;a<c.length;a++){const d=c[a],i=d.getAttribute("data-ln-class").split(",");for(let n=0;n<i.length;n++){const f=i[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();u in t&&d.classList.toggle(s,!!t[u])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)H(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 W(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,d){return t[d]!==void 0?t[d]:""}))}const o=function(c,a){return t[a]!==void 0?t[a]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const a=l[c],d=a.attributes;for(let i=0;i<d.length;i++){const n=d[i];n.value.indexOf("{{")!==-1&&a.setAttribute(n.name,n.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ye(e,t,r,o,l,c){const a={};for(let i=0;i<e.children.length;i++){const n=e.children[i],f=n.getAttribute("data-ln-render-key");f&&(a[f]=n)}const d=document.createDocumentFragment();for(let i=0;i<t.length;i++){const n=t[i],f=String(o(n));let s=a[f];if(s)l(s,n,i);else{const u=be(r,c);if(!u||(W(u,n),s=u.firstElementChild,!s))continue;s.setAttribute("data-ln-render-key",f),l(s,n,i)}d.appendChild(s)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=H,window.lnCore.lnFill=ge,window.lnCore.renderList=ye);function C(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function Q(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function J(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const O=new Map;function V(e,t){const r=(e?e.join("|"):"")+"::"+t;if(O.has(r))return O.get(r);const o=new Set(e||[]),l=function(c,a){const d=c.getAttribute(a);return d!==null&&o.has(d)?d:t};return O.set(r,l),l}function G(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function z(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function X(e,t,r,o,l){if(!e||t===null)return!0;const c=o||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const d=i=>{l?console.warn(i,l):console.warn(i)};if(a==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(d(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const i=e.values||[];return i.includes(t)?!0:(d(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return d(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(d(`[${c}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(d(`[${c}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(d(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(i){return d(`[${c}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Y(e,t,r){for(const o in r){const[l,c,a]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,c,a)},enumerable:!0,configurable:!0})}return e}function Z(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=V(o.values,o.fallback);break;case"integer":l=Q;break;case"float":l=G;break;case"boolean":l=J;break;case"list":l=K;break;case"json":l=z;break;case"string":default:l=C;break}l||(l=C),t[o.prop]=[l,r,o.fallback]}return t}function Ce(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 _e(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=Y,window.lnCore.attrSpec=Z,window.lnCore.attrStr=C,window.lnCore.attrInt=Q,window.lnCore.attrBool=J,window.lnCore.attrList=K,window.lnCore.attrEnum=V,window.lnCore.attrFloat=G,window.lnCore.attrJson=z);function v(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function P(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&v(e,a),e.querySelectorAll){const d=e.querySelectorAll(c);for(let i=0;i<d.length;i++)v(d[i],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=ee(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=_e(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,r,o){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const a=c.effects&&c.effects[r];a?a(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function Ee(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=ee(),l=o.byAttr.get(t),c=U()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const a=e.target;if(e.oldValue!==a.getAttribute(t)){if(c&&q(a)){const d=o.byDeclaredAttr.get(t),i=a.getAttribute(t);for(let n=0;n<d.length;n++)X(d[n].spec,i,t,d[n].componentTag,a)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,a,{oldValue:e.oldValue,newValue:a.getAttribute(t)}),r){const d=o.byReactive.get(t);d&&te(d,a,t,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,a,t,e.oldValue)}if(l)for(let d=0;d<l.length;d++){const i=l[d];if(i.handler){i.handler(a,t,e.oldValue);continue}i.onAttributeChange&&a[i.attribute]?i.onAttributeChange(a,t):(P(a,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(a))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ee(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function I(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 ne(e){const t=T();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=D();if(e.target&&o.length)for(let l=0;l<o.length;l++){const c=o[l],a=c.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;d&&c.onSubtreeChange(d,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const i=t[d];if(i.selector&&i.attribute&&i.ComponentFn){if(!a)c.matches&&c.matches(i.query)&&v(c,i);else if(c.matches&&c.matches(i.query)&&v(c,i),c.querySelectorAll){const n=c.querySelectorAll(i.query);for(let f=0;f<n.length;f++)v(n[f],i)}}i.onInit&&i.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){if(document.contains(c))continue;const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const i=t[d],n=i.query;if(n){if(!a)c.matches&&c.matches(n)&&I(c,i);else if(c.matches&&c.matches(n)&&I(c,i),c.querySelectorAll){const f=c.querySelectorAll(n);for(let s=0;s<f.length;s++)I(f[s],i)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{ne(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(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 l=r[o];if(l.type==="childList")try{ne(l)}catch(c){console.error("[ln-core] lifecycle handler failed",l.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){T().push(e),e.onSubtreeChange&&e.query&&D().push(e),re()}function oe(e,t,r,o,l={}){const c=l.extraAttributes||[],a=l.onAttributeChange||null,d=l.onSubtreeChange||null,i=l.onInit||null,n=l.onAttrChange||null,f=l.effects||null,s=l.attributes||null,u=s?Ce(s):f,h=s?new Set(Object.keys(s)):null,p=l.persist||null;function w(g){const m=g||document.body;if(P(m,e,t,r),s&&U())for(const E in s){const Be=s[E],R=Array.from(m.querySelectorAll("["+E+"]"));m.matches&&m.matches("["+E+"]")&&R.push(m);for(let $=0;$<R.length;$++){const N=R[$];q(N)&&X(Be,N.getAttribute(E),E,o,N)}}i&&i(m)}const y=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let m;for(;(m=g.exec(e))!==null;)y.push(m[1])}else y.push(e);ke({selector:e,attribute:t,componentTag:o,attributes:s,ComponentFn:r,onInit:i,observed:y.concat(c),onAttributeChange:a,onAttrChange:n,effects:u,declared:h,persist:p}),xe();const j=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=l.subtreeQuery||(j?e:"["+e+"]"),A={selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:d,query:k};T().push(A),d&&k&&D().push(A),re(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Se);function S(){Ae()>0?ve(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),w}function ie(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,r={},o=ie(t);if(!o)return r;const l=o.split("&");for(let c=0;c<l.length;c++){const a=l[c];if(!a)continue;const d=a.indexOf(":"),i=d>-1?a.slice(0,d):a,n=d>-1?a.slice(d+1):"";if(i)try{r[i]=decodeURIComponent(n)}catch{r[i]=n}}return r}function Le(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=F();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const a=r[c];return a===""?c:c+":"+encodeURIComponent(a)}).join("&");ie(location.hash)!==l&&(location.hash=l)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(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 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 je(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Re);function $e(){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=$e);const Ne={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function _(...e){return e.filter(t=>t!=null&&t!=="").map((t,r)=>{const o=String(t);return r===0?o.replace(/\/+$/,""):o.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function Ue(e,t){if(!e||typeof e!="object")return"";const r=Object.assign({},Ne);if(t&&typeof t=="object")for(const l in t)t[l]!==void 0&&t[l]!==null&&t[l]!==""&&(r[l]=t[l]);const o=new URLSearchParams;return e.search&&o.append(r.search,e.search),e.offset!=null&&o.append(r.offset,e.offset),e.limit!=null&&o.append(r.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(o.append(r.sortField,e.sort.field),o.append(r.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(l=>{const c=e.filters[l];Array.isArray(c)&&c.length>0&&o.append(l,c.join(","))}),o.toString()}function Me(e,t,r){let o=_(e,t);return r&&(o+=(o.indexOf("?")!==-1?"&":"?")+r),o}function le(e){const t=e&&e.content!==void 0?e.content:e,r=e&&e.message?e.message:null;return{record:t,message:r}}(function(){const e="data-ln-api-connector",t="lnApiConnector",r="lnConnector";if(window[t]!==void 0)return;function o(n){const f=n[t];f&&f.refreshConfig()}const l={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:C,type:"string",fallback:"",effect:o,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:C,type:"string",fallback:"",effect:o,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{prop:"path",read:C,type:"string",fallback:"",effect:o,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:C,type:"json",fallback:null,effect:o,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:o,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:o,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:o,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:o,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:o,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:o,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},c=Z(l);function a(n){return n.ok?n.status===204?null:n.json():n.json().catch(()=>null).then(f=>{const s=new Error("HTTP "+n.status+": "+n.statusText);throw s.status=n.status,s.data=f,s})}function d(n){return this.dom=n,Y(this,n,c),n[t]=this,n[r]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,i(this),this}d.prototype.refreshConfig=function(){const n=this.dom;this.credentials="same-origin",this.headers=ue(this.rawHeaders);const f={},s=n.getAttribute("data-ln-api-param-offset");s&&(f.offset=s);const u=n.getAttribute("data-ln-api-param-limit");u&&(f.limit=u);const h=n.getAttribute("data-ln-api-param-search");h&&(f.search=h);const p=n.getAttribute("data-ln-api-param-sort-field");p&&(f.sortField=p);const w=n.getAttribute("data-ln-api-param-sort-dir");w&&(f.sortDir=w),this.paramKeys=f;const y=n.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=y!==null?+y:300,b(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},d.prototype._reqHeaders=function(n){const f=Object.assign({},this.headers);return!f.Accept&&!f.accept&&(f.Accept="application/json"),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]="application/json"),n&&(f["X-Idempotency-Key"]=n),f},d.prototype.cancel=function(n){return n&&this._inflight.has(n)?(this._inflight.get(n).abort(),this._inflight.delete(n),!0):!1},d.prototype.fetchDelta=function(n,f){const s=this;let u=_(s.baseUrl,s.path);n!=null&&n!==""&&(u+=(u.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(n));const h=f||"sync";s._inflight.has(h)&&s._inflight.get(h).abort();const p=new AbortController;return s._inflight.set(h,p),window.fetch(u,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:p.signal}).then(a).finally(function(){s._inflight.get(h)===p&&s._inflight.delete(h)})},d.prototype.query=function(n,f){const s=this,u=Ue(n,s.paramKeys),h=Me(s.baseUrl,s.path,u),p=f||"query";s._inflight.has(p)&&s._inflight.get(p).abort();const w=new AbortController;return s._inflight.set(p,w),window.fetch(h,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:w.signal}).then(a).finally(function(){s._inflight.get(p)===w&&s._inflight.delete(p)})},d.prototype.create=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path),{method:"POST",headers:u._reqHeaders(s),credentials:u.credentials,body:JSON.stringify(n)}).then(a)},d.prototype.update=function(n,f,s,u,h){const p=this;s!=null&&(f=Object.assign({},f,{expected_version:s}));const w=u?_(p.baseUrl,u):_(p.baseUrl,p.path,n);return window.fetch(w,{method:"PUT",headers:p._reqHeaders(h),credentials:p.credentials,body:JSON.stringify(f)}).then(a)},d.prototype.delete=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path,n),{method:"DELETE",headers:u._reqHeaders(s),credentials:u.credentials}).then(a)},d.prototype.bulkDelete=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path,"bulk-delete"),{method:"DELETE",headers:u._reqHeaders(s),credentials:u.credentials,body:JSON.stringify({ids:n})}).then(a)};function i(n){n._handlers={sync:function(f){const s=f.detail||{},u=s.meta&&s.meta.targetEl?s.meta.targetEl:null;n.fetchDelta(s.since,u).then(function(h){b(n.dom,"ln-api-connector:fetched",{data:h,since:s.since,meta:s.meta||null})}).catch(function(h){h&&h.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"sync",error:h.message,status:h.status||0,data:h.data||null,since:s.since,meta:s.meta||null})})},query:function(f){const s=f.detail||{},u=s.query||s,h=s.meta&&s.meta.targetEl?s.meta.targetEl:null,p=h||"query",w=n.queryDebounce;function y(k,A,S){n.query(A,S).then(function(g){const m=g||{};b(n.dom,"ln-api-connector:fetched",{data:m.data||(Array.isArray(m)?m:[]),total:m.total,filtered:m.filtered,offset:A.offset,queryGen:A.queryGen,meta:k.meta||null})}).catch(function(g){g&&g.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"query",error:g.message,status:g.status||0,data:g.data||null,meta:k.meta||null})})}if(w===0){y(s,u,h);return}n._queryTimers.has(p)&&clearTimeout(n._queryTimers.get(p));const j=setTimeout(function(){n._queryTimers.delete(p),y(s,u,h)},w);n._queryTimers.set(p,j)},cancel:function(f){const s=f.detail||{},u=s.meta&&s.meta.targetEl?s.meta.targetEl:s.targetEl||s.key;u&&n.cancel(u)},create:function(f){const s=f.detail||{};n.create(s.data,s.url,s.idempotencyKey).then(function(u){const h=le(u);b(n.dom,"ln-api-connector:created",{record:h.record,tempId:s.tempId,message:h.message,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"create",error:u.message,status:u.status||0,data:u.data||null,tempId:s.tempId,meta:s.meta||null})})},update:function(f){const s=f.detail||{};n.update(s.id,s.data,s.expected_version,s.url,s.idempotencyKey).then(function(u){const h=le(u);b(n.dom,"ln-api-connector:updated",{record:h.record,id:s.id,message:h.message,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"update",error:u.message,status:u.status||0,data:u.data||null,id:s.id,conflictData:u.status===409?u.data:null,meta:s.meta||null})})},delete:function(f){const s=f.detail||{};n.delete(s.id,s.url,s.idempotencyKey).then(function(u){const h=u&&u.message?u.message:null;b(n.dom,"ln-api-connector:deleted",{response:u,id:s.id,message:h,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"delete",error:u.message,status:u.status||0,data:u.data||null,id:s.id,meta:s.meta||null})})},bulkDelete:function(f){const s=f.detail||{};n.bulkDelete(s.ids,s.url,s.idempotencyKey).then(function(u){const h=u&&u.message?u.message:null;b(n.dom,"ln-api-connector:bulk-deleted",{response:u,ids:s.ids,message:h,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"bulk-delete",error:u.message,status:u.status||0,data:u.data||null,ids:s.ids,meta:s.meta||null})})}},n.dom.addEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.addEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.addEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.addEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.addEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.addEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.addEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete)}d.prototype.destroy=function(){if(!this.dom[t])return;const n=this;n._inflight&&(n._inflight.forEach(function(f){f.abort()}),n._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(f){f&&clearTimeout(f)}),this._queryTimers.clear()),this._handlers&&(n.dom.removeEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.removeEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.removeEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.removeEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.removeEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.removeEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.removeEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete),n._handlers=null),delete this.dom[t],delete this.dom[r]},oe(e,t,d,"ln-api-connector",{attributes:l})})()})();
1
+ (function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!q(o))return}e.apply(console,t)}}function b(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 x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function se(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,l={},c=e.elements,a={};if(r)for(let d=0;d<c.length;d++){const i=c[d];i.name&&i.type==="checkbox"&&!i.disabled&&(a[i.name]=(a[i.name]||0)+1)}for(let d=0;d<c.length;d++){const i=c[d];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")r&&a[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let n=0;n<i.options.length;n++)i.options[n].selected&&l[i.name].push(i.options[n].value)}else if(r&&i.type==="hidden")l[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const n=Number(i.value);l[i.name]=i.value===""||isNaN(n)?null:n}else l[i.name]=i.value}return l}function ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const r=e.elements,o=[],l={};for(let c=0;c<r.length;c++){const a=r[c];a.name&&a.type==="checkbox"&&(l[a.name]=(l[a.name]||0)+1)}for(let c=0;c<r.length;c++){const a=r[c];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const d=a.getAttribute("data-ln-fill-as")||a.name;if(!d||!(d in t))continue;const i=t[d];if(a.type==="checkbox"){if(Array.isArray(i))a.checked=i.indexOf(a.value)!==-1;else if(l[a.name]>1){const n=String(i).split(",").map(function(f){return f.trim()});a.checked=n.indexOf(a.value)!==-1}else a.checked=ce(i);o.push(a)}else if(a.type==="radio")a.checked=a.value===String(i),o.push(a);else if(a.type==="select-multiple"){if(Array.isArray(i))for(let n=0;n<a.options.length;n++)a.options[n].selected=i.indexOf(a.options[n].value)!==-1;o.push(a)}else a.value=i,a.tagName==="SELECT"&&i!=null&&a.setAttribute("data-ln-value",i),o.push(a)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=se,window.lnCore.resolveFormMethod=ae);function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(r){return console.error(`[${t}] Invalid headers JSON:`,r),{}}}const M={};function fe(e,t){M[e]=t}function he(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function pe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){b(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function we(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];B[r]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=we,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=pe);const L={};function be(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=L[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let a=0;a<r.length;a++){const d=r[a],i=d.getAttribute("data-ln-field");t[i]!=null&&(d.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let a=0;a<o.length;a++){const d=o[a],i=d.getAttribute("data-ln-attr").split(",");for(let n=0;n<i.length;n++){const f=i[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();t[u]!=null&&d.setAttribute(s,t[u])}}const l=e.querySelectorAll("[data-ln-show]");for(let a=0;a<l.length;a++){const d=l[a],i=d.getAttribute("data-ln-show");i in t&&d.classList.toggle("hidden",!t[i])}const c=e.querySelectorAll("[data-ln-class]");for(let a=0;a<c.length;a++){const d=c[a],i=d.getAttribute("data-ln-class").split(",");for(let n=0;n<i.length;n++){const f=i[n].trim().split(":");if(f.length!==2)continue;const s=f[0].trim(),u=f[1].trim();u in t&&d.classList.toggle(s,!!t[u])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)H(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 W(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,d){return t[d]!==void 0?t[d]:""}))}const o=function(c,a){return t[a]!==void 0?t[a]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const a=l[c],d=a.attributes;for(let i=0;i<d.length;i++){const n=d[i];n.value.indexOf("{{")!==-1&&a.setAttribute(n.name,n.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ye(e,t,r,o,l,c){const a={};for(let i=0;i<e.children.length;i++){const n=e.children[i],f=n.getAttribute("data-ln-render-key");f&&(a[f]=n)}const d=document.createDocumentFragment();for(let i=0;i<t.length;i++){const n=t[i],f=String(o(n));let s=a[f];if(s)l(s,n,i);else{const u=be(r,c);if(!u||(W(u,n),s=u.firstElementChild,!s))continue;s.setAttribute("data-ln-render-key",f),l(s,n,i)}d.appendChild(s)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=H,window.lnCore.lnFill=ge,window.lnCore.renderList=ye);function C(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function Q(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function J(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const O=new Map;function V(e,t){const r=(e?e.join("|"):"")+"::"+t;if(O.has(r))return O.get(r);const o=new Set(e||[]),l=function(c,a){const d=c.getAttribute(a);return d!==null&&o.has(d)?d:t};return O.set(r,l),l}function G(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function z(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function X(e,t,r,o,l){if(!e||t===null)return!0;const c=o||"ln-component",a=e.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||t===""&&e.fallback!==void 0)return!0;const d=i=>{l?console.warn(i,l):console.warn(i)};if(a==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(d(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const i=e.values||[];return i.includes(t)?!0:(d(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(t))return d(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(d(`[${c}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(d(`[${c}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(a==="float")return isNaN(Number(t))?(d(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(t),!0}catch(i){return d(`[${c}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Y(e,t,r){for(const o in r){const[l,c,a]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,c,a)},enumerable:!0,configurable:!0})}return e}function Z(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=V(o.values,o.fallback);break;case"integer":l=Q;break;case"float":l=G;break;case"boolean":l=J;break;case"list":l=K;break;case"json":l=z;break;case"string":default:l=C;break}l||(l=C),t[o.prop]=[l,r,o.fallback]}return t}function Ce(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 _e(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=Y,window.lnCore.attrSpec=Z,window.lnCore.attrStr=C,window.lnCore.attrInt=Q,window.lnCore.attrBool=J,window.lnCore.attrList=K,window.lnCore.attrEnum=V,window.lnCore.attrFloat=G,window.lnCore.attrJson=z);function v(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function P(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",a={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&v(e,a),e.querySelectorAll){const d=e.querySelectorAll(c);for(let i=0;i<d.length;i++)v(d[i],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=ee(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=_e(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,r,o){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const a=c.effects&&c.effects[r];a?a(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function Ee(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=ee(),l=o.byAttr.get(t),c=U()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const a=e.target;if(e.oldValue!==a.getAttribute(t)){if(c&&q(a)){const d=o.byDeclaredAttr.get(t),i=a.getAttribute(t);for(let n=0;n<d.length;n++)X(d[n].spec,i,t,d[n].componentTag,a)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,a,{oldValue:e.oldValue,newValue:a.getAttribute(t)}),r){const d=o.byReactive.get(t);d&&te(d,a,t,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,a,t,e.oldValue)}if(l)for(let d=0;d<l.length;d++){const i=l[d];if(i.handler){i.handler(a,t,e.oldValue);continue}i.onAttributeChange&&a[i.attribute]?i.onAttributeChange(a,t):(P(a,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(a))}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ee(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function I(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 ne(e){const t=T();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=D();if(e.target&&o.length)for(let l=0;l<o.length;l++){const c=o[l],a=c.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;d&&c.onSubtreeChange(d,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const i=t[d];if(i.selector&&i.attribute&&i.ComponentFn){if(!a)c.matches&&c.matches(i.query)&&v(c,i);else if(c.matches&&c.matches(i.query)&&v(c,i),c.querySelectorAll){const n=c.querySelectorAll(i.query);for(let f=0;f<n.length;f++)v(n[f],i)}}i.onInit&&i.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){if(document.contains(c))continue;const a=!!(c.firstElementChild||c.children&&c.children.length);for(let d=0;d<t.length;d++){const i=t[d],n=i.query;if(n){if(!a)c.matches&&c.matches(n)&&I(c,i);else if(c.matches&&c.matches(n)&&I(c,i),c.querySelectorAll){const f=c.querySelectorAll(n);for(let s=0;s<f.length;s++)I(f[s],i)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{ne(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(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 l=r[o];if(l.type==="childList")try{ne(l)}catch(c){console.error("[ln-core] lifecycle handler failed",l.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){T().push(e),e.onSubtreeChange&&e.query&&D().push(e),re()}function oe(e,t,r,o,l={}){const c=l.extraAttributes||[],a=l.onAttributeChange||null,d=l.onSubtreeChange||null,i=l.onInit||null,n=l.onAttrChange||null,f=l.effects||null,s=l.attributes||null,u=s?Ce(s):f,h=s?new Set(Object.keys(s)):null,p=l.persist||null;function w(g){const m=g||document.body;if(P(m,e,t,r),s&&U())for(const E in s){const Be=s[E],R=Array.from(m.querySelectorAll("["+E+"]"));m.matches&&m.matches("["+E+"]")&&R.push(m);for(let $=0;$<R.length;$++){const N=R[$];q(N)&&X(Be,N.getAttribute(E),E,o,N)}}i&&i(m)}const y=[];if(e.indexOf("[")!==-1){const g=/\[([\w-]+)/g;let m;for(;(m=g.exec(e))!==null;)y.push(m[1])}else y.push(e);ke({selector:e,attribute:t,componentTag:o,attributes:s,ComponentFn:r,onInit:i,observed:y.concat(c),onAttributeChange:a,onAttrChange:n,effects:u,declared:h,persist:p}),xe();const j=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=l.subtreeQuery||(j?e:"["+e+"]"),A={selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:d,query:k};T().push(A),d&&k&&D().push(A),re(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Se);function S(){Ae()>0?ve(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S(),w}function ie(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,r={},o=ie(t);if(!o)return r;const l=o.split("&");for(let c=0;c<l.length;c++){const a=l[c];if(!a)continue;const d=a.indexOf(":"),i=d>-1?a.slice(0,d):a,n=d>-1?a.slice(d+1):"";if(i)try{r[i]=decodeURIComponent(n)}catch{r[i]=n}}return r}function Le(e){if(!e)return null;const t=F();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const r=F();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const a=r[c];return a===""?c:c+":"+encodeURIComponent(a)}).join("&");ie(location.hash)!==l&&(location.hash=l)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(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 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 je(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Fe,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Re);function $e(){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=$e);const Ne={offset:"offset",limit:"limit",search:"search",sortField:"sort_field",sortDir:"sort_dir"};function _(...e){return e.filter(t=>t!=null&&t!=="").map((t,r)=>{const o=String(t);return r===0?o.replace(/\/+$/,""):o.replace(/^\/+/,"").replace(/\/+$/,"")}).filter(Boolean).join("/")}function Ue(e,t){if(!e||typeof e!="object")return"";const r=Object.assign({},Ne);if(t&&typeof t=="object")for(const l in t)t[l]!==void 0&&t[l]!==null&&t[l]!==""&&(r[l]=t[l]);const o=new URLSearchParams;return e.search&&o.append(r.search,e.search),e.offset!=null&&o.append(r.offset,e.offset),e.limit!=null&&o.append(r.limit,e.limit),e.sort&&e.sort.field&&e.sort.direction&&(o.append(r.sortField,e.sort.field),o.append(r.sortDir,e.sort.direction)),e.filters&&typeof e.filters=="object"&&Object.keys(e.filters).forEach(l=>{const c=e.filters[l];Array.isArray(c)&&c.length>0&&o.append(l,c.join(","))}),o.toString()}function Me(e,t,r){let o=_(e,t);return r&&(o+=(o.indexOf("?")!==-1?"&":"?")+r),o}function le(e){const t=e&&e.content!==void 0?e.content:e,r=e&&e.message?e.message:null;return{record:t,message:r}}(function(){const e="data-ln-api-connector",t="lnApiConnector",r="lnConnector";if(window[t]!==void 0)return;function o(n){const f=n[t];f&&f.refreshConfig()}const l={"data-ln-api-connector":{type:"marker",description:"Mounts API connector bridging REST backend and ln-ashlar data coordinators"},"data-ln-api-base-url":{prop:"baseUrl",read:C,type:"string",fallback:"",effect:o,description:"Base URL endpoint for API requests"},"data-ln-api-path":{prop:"path",read:function(n){return n.getAttribute("data-ln-api-path")||n.getAttribute("data-ln-api-endpoint")||""},type:"string",fallback:"",effect:o,description:"Resource path appended to base URL"},"data-ln-api-endpoint":{read:function(n){return n.getAttribute("data-ln-api-path")||n.getAttribute("data-ln-api-endpoint")||""},type:"string",fallback:"",effect:o,description:"Alias for data-ln-api-path"},"data-ln-api-headers":{prop:"rawHeaders",read:C,type:"json",fallback:null,effect:o,description:"Custom HTTP headers in JSON format or semicolon-separated pairs"},"data-ln-api-param-offset":{effect:o,type:"string",fallback:"offset",description:"Query parameter name for pagination offset"},"data-ln-api-param-limit":{effect:o,type:"string",fallback:"limit",description:"Query parameter name for pagination page size"},"data-ln-api-param-search":{effect:o,type:"string",fallback:"search",description:"Query parameter name for text search filter"},"data-ln-api-param-sort-field":{effect:o,type:"string",fallback:"sort_by",description:"Query parameter name for sort field"},"data-ln-api-param-sort-dir":{effect:o,type:"string",fallback:"sort_dir",description:"Query parameter name for sort direction"},"data-ln-api-connector-query-debounce":{effect:o,type:"integer",fallback:200,min:0,description:"Debounce delay in milliseconds before dispatching query requests"}},c=Z(l);function a(n){return n.ok?n.status===204?null:n.json():n.json().catch(()=>null).then(f=>{const s=new Error("HTTP "+n.status+": "+n.statusText);throw s.status=n.status,s.data=f,s})}function d(n){return this.dom=n,Y(this,n,c),n[t]=this,n[r]=this,this.namespace="ln-api-connector",this._inflight=new Map,this._queryTimers=new Map,this.refreshConfig(),this._handlers=null,i(this),this}d.prototype.refreshConfig=function(){const n=this.dom;this.credentials="same-origin",this.headers=ue(this.rawHeaders);const f={},s=n.getAttribute("data-ln-api-param-offset");s&&(f.offset=s);const u=n.getAttribute("data-ln-api-param-limit");u&&(f.limit=u);const h=n.getAttribute("data-ln-api-param-search");h&&(f.search=h);const p=n.getAttribute("data-ln-api-param-sort-field");p&&(f.sortField=p);const w=n.getAttribute("data-ln-api-param-sort-dir");w&&(f.sortDir=w),this.paramKeys=f;const y=n.getAttribute("data-ln-api-connector-query-debounce");this.queryDebounce=y!==null?+y:300,b(this.dom,"ln-api-connector:config-changed",{baseUrl:this.baseUrl,path:this.path,headers:this.headers,paramKeys:this.paramKeys})},d.prototype._reqHeaders=function(n){const f=Object.assign({},this.headers);return!f.Accept&&!f.accept&&(f.Accept="application/json"),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]="application/json"),n&&(f["X-Idempotency-Key"]=n),f},d.prototype.cancel=function(n){return n&&this._inflight.has(n)?(this._inflight.get(n).abort(),this._inflight.delete(n),!0):!1},d.prototype.fetchDelta=function(n,f){const s=this;let u=_(s.baseUrl,s.path);n!=null&&n!==""&&(u+=(u.indexOf("?")!==-1?"&":"?")+"since="+encodeURIComponent(n));const h=f||"sync";s._inflight.has(h)&&s._inflight.get(h).abort();const p=new AbortController;return s._inflight.set(h,p),window.fetch(u,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:p.signal}).then(a).finally(function(){s._inflight.get(h)===p&&s._inflight.delete(h)})},d.prototype.query=function(n,f){const s=this,u=Ue(n,s.paramKeys),h=Me(s.baseUrl,s.path,u),p=f||"query";s._inflight.has(p)&&s._inflight.get(p).abort();const w=new AbortController;return s._inflight.set(p,w),window.fetch(h,{method:"GET",headers:s._reqHeaders(),credentials:s.credentials,signal:w.signal}).then(a).finally(function(){s._inflight.get(p)===w&&s._inflight.delete(p)})},d.prototype.create=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path),{method:"POST",headers:u._reqHeaders(s),credentials:u.credentials,body:JSON.stringify(n)}).then(a)},d.prototype.update=function(n,f,s,u,h){const p=this;s!=null&&(f=Object.assign({},f,{expected_version:s}));const w=u?_(p.baseUrl,u):_(p.baseUrl,p.path,n);return window.fetch(w,{method:"PUT",headers:p._reqHeaders(h),credentials:p.credentials,body:JSON.stringify(f)}).then(a)},d.prototype.delete=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path,n),{method:"DELETE",headers:u._reqHeaders(s),credentials:u.credentials}).then(a)},d.prototype.bulkDelete=function(n,f,s){const u=this;return window.fetch(_(u.baseUrl,f||u.path,"bulk-delete"),{method:"DELETE",headers:u._reqHeaders(s),credentials:u.credentials,body:JSON.stringify({ids:n})}).then(a)};function i(n){n._handlers={sync:function(f){const s=f.detail||{},u=s.meta&&s.meta.targetEl?s.meta.targetEl:null;n.fetchDelta(s.since,u).then(function(h){b(n.dom,"ln-api-connector:fetched",{data:h,since:s.since,meta:s.meta||null})}).catch(function(h){h&&h.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"sync",error:h.message,status:h.status||0,data:h.data||null,since:s.since,meta:s.meta||null})})},query:function(f){const s=f.detail||{},u=s.query||s,h=s.meta&&s.meta.targetEl?s.meta.targetEl:null,p=h||"query",w=n.queryDebounce;function y(k,A,S){n.query(A,S).then(function(g){const m=g||{};b(n.dom,"ln-api-connector:fetched",{data:m.data||(Array.isArray(m)?m:[]),total:m.total,filtered:m.filtered,offset:A.offset,queryGen:A.queryGen,meta:k.meta||null})}).catch(function(g){g&&g.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"query",error:g.message,status:g.status||0,data:g.data||null,meta:k.meta||null})})}if(w===0){y(s,u,h);return}n._queryTimers.has(p)&&clearTimeout(n._queryTimers.get(p));const j=setTimeout(function(){n._queryTimers.delete(p),y(s,u,h)},w);n._queryTimers.set(p,j)},cancel:function(f){const s=f.detail||{},u=s.meta&&s.meta.targetEl?s.meta.targetEl:s.targetEl||s.key;u&&n.cancel(u)},create:function(f){const s=f.detail||{};n.create(s.data,s.url,s.idempotencyKey).then(function(u){const h=le(u);b(n.dom,"ln-api-connector:created",{record:h.record,tempId:s.tempId,message:h.message,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"create",error:u.message,status:u.status||0,data:u.data||null,tempId:s.tempId,meta:s.meta||null})})},update:function(f){const s=f.detail||{};n.update(s.id,s.data,s.expected_version,s.url,s.idempotencyKey).then(function(u){const h=le(u);b(n.dom,"ln-api-connector:updated",{record:h.record,id:s.id,message:h.message,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"update",error:u.message,status:u.status||0,data:u.data||null,id:s.id,conflictData:u.status===409?u.data:null,meta:s.meta||null})})},delete:function(f){const s=f.detail||{};n.delete(s.id,s.url,s.idempotencyKey).then(function(u){const h=u&&u.message?u.message:null;b(n.dom,"ln-api-connector:deleted",{response:u,id:s.id,message:h,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"delete",error:u.message,status:u.status||0,data:u.data||null,id:s.id,meta:s.meta||null})})},bulkDelete:function(f){const s=f.detail||{};n.bulkDelete(s.ids,s.url,s.idempotencyKey).then(function(u){const h=u&&u.message?u.message:null;b(n.dom,"ln-api-connector:bulk-deleted",{response:u,ids:s.ids,message:h,meta:s.meta||null})}).catch(function(u){u&&u.name==="AbortError"||b(n.dom,"ln-api-connector:error",{action:"bulk-delete",error:u.message,status:u.status||0,data:u.data||null,ids:s.ids,meta:s.meta||null})})}},n.dom.addEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.addEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.addEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.addEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.addEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.addEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.addEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete)}d.prototype.destroy=function(){if(!this.dom[t])return;const n=this;n._inflight&&(n._inflight.forEach(function(f){f.abort()}),n._inflight.clear()),this._queryTimers&&(this._queryTimers.forEach(function(f){f&&clearTimeout(f)}),this._queryTimers.clear()),this._handlers&&(n.dom.removeEventListener("ln-api-connector:request-sync",n._handlers.sync),n.dom.removeEventListener("ln-api-connector:request-query",n._handlers.query),n.dom.removeEventListener("ln-api-connector:request-cancel",n._handlers.cancel),n.dom.removeEventListener("ln-api-connector:request-create",n._handlers.create),n.dom.removeEventListener("ln-api-connector:request-update",n._handlers.update),n.dom.removeEventListener("ln-api-connector:request-delete",n._handlers.delete),n.dom.removeEventListener("ln-api-connector:request-bulk-delete",n._handlers.bulkDelete),n._handlers=null),delete this.dom[t],delete this.dom[r]},oe(e,t,d,"ln-api-connector",{attributes:l})})()})();
@@ -14,11 +14,15 @@ import { buildQueryParams, buildQueryUrl, joinUrl, unwrapEnvelope } from './conn
14
14
  instance.refreshConfig();
15
15
  }
16
16
 
17
+ function _readPath(el) {
18
+ return el.getAttribute('data-ln-api-path') || el.getAttribute('data-ln-api-endpoint') || '';
19
+ }
20
+
17
21
  const ATTRIBUTES = {
18
22
  'data-ln-api-connector': { type: 'marker', description: 'Mounts API connector bridging REST backend and ln-ashlar data coordinators' },
19
23
  'data-ln-api-base-url': { prop: 'baseUrl', read: attrStr, type: 'string', fallback: '', effect: _syncAttribute, description: 'Base URL endpoint for API requests' },
20
- 'data-ln-api-path': { prop: 'path', read: attrStr, type: 'string', fallback: '', effect: _syncAttribute, description: 'Resource path appended to base URL' },
21
- 'data-ln-api-endpoint': { prop: 'path', read: attrStr, type: 'string', fallback: '', effect: _syncAttribute, description: 'Alias for data-ln-api-path' },
24
+ 'data-ln-api-path': { prop: 'path', read: _readPath, type: 'string', fallback: '', effect: _syncAttribute, description: 'Resource path appended to base URL' },
25
+ 'data-ln-api-endpoint': { read: _readPath, type: 'string', fallback: '', effect: _syncAttribute, description: 'Alias for data-ln-api-path' },
22
26
  'data-ln-api-headers': { prop: 'rawHeaders', read: attrStr, type: 'json', fallback: null, effect: _syncAttribute, description: 'Custom HTTP headers in JSON format or semicolon-separated pairs' },
23
27
  'data-ln-api-param-offset': { effect: _syncAttribute, type: 'string', fallback: 'offset', description: 'Query parameter name for pagination offset' },
24
28
  'data-ln-api-param-limit': { effect: _syncAttribute, type: 'string', fallback: 'limit', description: 'Query parameter name for pagination page size' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livenetworks/ashlar",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Live Networks",