@symbo.ls/element 3.14.798 → 3.14.800
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/CHANGELOG.md +70 -0
- package/dist/cjs/src/attributeFirst.js +1 -1
- package/dist/cjs/src/bridge.js +1 -0
- package/dist/cjs/src/cache.js +1 -1
- package/dist/cjs/src/create.js +5 -5
- package/dist/cjs/src/cssLonghands.js +1 -1
- package/dist/cjs/src/delegate.js +1 -1
- package/dist/cjs/src/dispose.js +1 -1
- package/dist/cjs/src/extends.js +1 -1
- package/dist/cjs/src/index.js +1 -1
- package/dist/cjs/src/inertOutside.js +1 -0
- package/dist/cjs/src/registry.js +1 -1
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/attributeFirst.js +1 -1
- package/dist/esm/src/bridge.js +1 -0
- package/dist/esm/src/cache.js +1 -1
- package/dist/esm/src/create.js +5 -5
- package/dist/esm/src/cssLonghands.js +1 -1
- package/dist/esm/src/delegate.js +1 -1
- package/dist/esm/src/dispose.js +1 -1
- package/dist/esm/src/extends.js +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/inertOutside.js +1 -0
- package/dist/esm/src/registry.js +1 -1
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +8 -8
package/dist/esm/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{createStore as
|
|
2
|
-
`+
|
|
1
|
+
import{createStore as Qt,createScopeStore as $s,isStore as Y}from"@symbo.ls/signal";import{createEffect as j,getObserver as ko,setObserver as Nt}from"@symbo.ls/signal";import{cacheNode as Xt,detectTag as jo,adoptHydrationNode as Is}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as Us}from"./registry.js";import{registerEvent as Hs,registerGlobalEvent as Vs,globalEventKeyInfo as Bs}from"./delegate.js";import{mountBridge as Gs}from"./bridge.js";import{applyExtends as Ks,openMergeLayer as Ws}from"./extends.js";import{addMethods as zs}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as ft}from"./devRuntime.js";import{mountBudgetExhausted as Eo,openMountBudget as Po,closeMountBudget as Oo,enqueueMountWork as To}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as I,isPolyglotWritableKey as Ys,markPolyglotSeeded as qs}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{runPluginHook as q}from"@symbo.ls/utils/function.js";import{applyStateMethods as xt}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as U,DEFAULT_CSS_PROPERTIES_LIST as V,pushStaticCssPass as Lo,popStaticCssPass as Do,resolveStyleBlockTokens as Zs}from"css-in-props";import{css as wt,wrapHoverRule as Mo}from"@symbo.ls/css";import{pushConfig as L,popConfig as D}from"@symbo.ls/scratch";import{checkAttributeByTagName as St,applyAttrTransforms as Qs,ATTR_TRANSFORMS as Jt,camelToAttr as Ct,serializeAttrValue as K,isEnumeratedTrueFalseAttr as at,extractConditionalAttrs as Xs}from"attrs-in-props";import{resolveElementIdEngine as Js}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as $t,CSS_SHORTHAND_LONGHANDS as ms,cssShorthandStatesLonghand as Ro}from"./cssLonghands.js";import{isAttributeFirst as No,isCssProp as st}from"./attributeFirst.js";import{VERSION as tn}from"./version.js";const Fo=Js({uniqId:1,scopedStyleId:0},tn),vt=[],nt=new Set;let mt=!1,$o=0,ut=null,kt=null;function dt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Io(){return typeof document<"u"&&document.visibilityState==="hidden"}const on=250,sn=1e3;function nn(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Io())?!0:dt()-$o>=sn}function en(){if(mt=!0,$o=dt(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,0);ut=t?()=>t(o):null;return}if(Io()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,on);ut=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(to);ut=t?()=>t(o):null}}function It(){if(mt){if(!nn())return;const t=ut;if(ut=null,t)try{t()}catch{}}en()}const Uo=300,Ho=15e4;function to(){if(mt=!1,ut=null,kt=null,nt.size&&Wn(),!vt.length)return;const t=vt.splice(0,vt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const e=s.__ref||(s.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=dt());const r=dt()-e.__mountFirstAttemptAt;e.__mountAttempts<=Uo&&r<Ho?(vt.push(s),It()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&Gs(s),typeof s.onMounted=="function"&&R("Mounted",s,s.__ref?.__mountOptions||{})}}}function oo(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Dt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,vt.push(t),It())}function Vo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&q("contentUpdate",t,o);const s=t.context?.designSystem;s&&L(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(e){if(t.context?.plugins?.length&&q("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{s&&D()}}function Z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function rn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function cn(t){return t.toLowerCase()}function so(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function jt(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=jt(r,i):s[e]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Bo(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function J(t,o,s,e={},r){const i=ko();if(i){Nt(null);try{return J(t,o,s,e,r)}finally{Nt(i)}}if(t==null||t===!1)return null;const a=An(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),n=Object.create(null);n.key=s||f||`_${Fo.uniqId++}`,n.parent=o||null,n.context=t.context||o?.context||e.context||{},n.context.__create||(n.context.__create=J);const c=n.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||n,path:o?.__ref?.path?[...o.__ref.path,n.key]:[n.key],origin:t};a&&(c.__runtimeSource=a);const l=t;if(t=Go(n,t,s,f,o,e),n.if!=null){let d;if(typeof n.if=="function")try{d=n.if(n,n.state,n.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=n.key||n.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=n.if;c.__if=!!d}if(c.__if)typeof n.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[n.key]=n);const d=un(t,s,n.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:e}),typeof n.if=="function"&&Jo(n,c,n.if),n}n.tag||(n.tag=jo(n)),R("Init",n,e);const u=n.node=Is(n)||Xt(n);if(!u)return n;if(n.tag==="fragment"){const h=(n.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}R("AttachNode",n,e),u.setAttribute&&n.key&&u.setAttribute("data-key",n.key),o&&(o[n.key]=n,o.__ref?.__children&&(o.__ref.__children.includes(n.key)||o.__ref.__children.push(n.key))),u.setAttribute&&n.context?.scopeSelector&&n.context.scopeSelector!==":root"&&n.context.key&&n.key===n.context.key&&u.setAttribute("data-smbls-app",n.context.key),n.id&&u.setAttribute&&(u.id=n.id),Os(n,e),Qo(n),fo(n),xs(n),_o(n),Es(n),te(n);try{Ts(n,e)}catch(d){if(typeof console<"u"&&console.error){const h=n.__ref?.path?.join(".")||n.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
|
|
2
|
+
`+d.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if($t(n,!0),fs(n,o,r),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const h=n.context?.designSystem;h&&M(h);try{const _=n.html(n,n.state,n.context);_!=null&&typeof _!="function"&&(n.node.innerHTML=_)}catch{}finally{h&&N()}}if(F("Create",n,e),F("Complete",n,e),F("Render",n,e),F("RenderRouter",n,e),qt(n,e),typeof n.onFrame=="function"){const h=n.onFrame,_=n.context?.designSystem,c=()=>{if(n.node){if(n.node.isConnected){_&&M(_);try{h(n,n.state,n.context)}catch(u){console.error("[DOMQL] onFrame error:",u)}finally{_&&N()}}requestAnimationFrame(c)}};requestAnimationFrame(c)}return n}function Oo(t,o,s,e,r,i){if(s&&!o.extends&&!o.extend){const u=s.indexOf("_"),l=s.indexOf(".");let g=u>0?u:-1;if(l>0&&(g<0||l<g)&&(g=l),g>0){const b=s.substring(0,g),A=t.context?.components;A&&(A[b]||A["smbls."+b])?o={...o,extends:b}:A&&nt()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}As(t,o,i);const a=new Set(["childProps","attr","style","scope","data"]),f=t.props&&typeof t.props=="object"?t.props:null;for(const u in o){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){e&&(t.key=e);continue}const l=o[u],g=t[u],b=g&&l&&typeof g=="object"&&typeof l=="object"&&!Array.isArray(g)&&!Array.isArray(l)&&typeof g!="function"&&typeof l!="function";b&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?t[u]=bt(g,l):b&&a.has(u)?t[u]={...g,...l}:b&&Zt(u)?t[u]=bt(g,l):t[u]=l}function n(u){for(const l in u){const g=u[l],b=t[l],A=b&&g&&typeof b=="object"&&typeof g=="object"&&!Array.isArray(b)&&!Array.isArray(g)&&typeof b!="function"&&typeof g!="function";A&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?t[l]=bt(b,g):A&&a.has(l)?t[l]={...b,...g}:A&&Zt(l)?t[l]=bt(b,g):t[l]=g}}f&&n(f),o.props&&typeof o.props=="object"&&n(o.props),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const d=t.scope&&typeof t.scope=="object"?t.scope:null,y=r?.scope,p=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,h=y||p||null;if(o.scope!==void 0||d){const u={};d&&Object.assign(u,d),o.scope!==void 0&&Object.assign(u,o.scope),t.scope=hs(u,h)}else h&&(t.scope=h);o.if!==void 0&&(t.if=o.if);const _=t.__ref,c=Ks(t,_&&_.__runtimeSource);return _&&(_.__declaredArrays=c||void 0),xs(t),Ns(t,r,o),o}const Ds=new Set(["key","parent","context","__ref"]);function Rs(t,o){for(const r of Object.keys(t))Ds.has(r)||delete t[r];const s=lo();s&&jt(null);let e=o.definition;if(!e.extends&&!e.extend&&typeof o.key=="string"){const r=t.context?.components||{},i=r[o.key]||r["smbls."+o.key];i&&(e={...e,extends:i})}try{Oo(t,e,o.key,o.ownKey,t.parent,o.options)}finally{s&&jt(s)}}function Ms(t,o,s){const e=s||{},r=f=>!!(e[f]||e["smbls."+f]),i=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const f of a){if(typeof f!="string")continue;const n=f.includes(">")?f.split(">")[0].trim():f;r(n)||i.push(n)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const n=o.indexOf("_"),d=o.indexOf(".");n>0&&(f=n),d>0&&(f<0||d<f)&&(f=d);const y=f>0?o.substring(0,f):o;r(y)||i.push(y)}return i}function Ns(t,o,s){const e=!o,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,i=e&&r&&t.context?.state,a=s.state!==void 0&&!i?s.state:t.state&&!Q(t.state)?t.state:void 0;if(a==null){if(o?.state)t.state=o.state,ut(t,t.state);else if(t.context?.state){const f=t.context.state,n={...f},d=t.context?.polyglot;if(d?.translations){const y=t.context,p=f.lang||d.defaultLang||"en",h=new Set,_=(l,g)=>{h.has(l)||ws(y,l,n)&&(n[l]=g,h.add(l),Ss(y,l,g))},c=d.translations[p];if(c&&typeof c=="object")for(const l in c)_(l,c[l]);const u=new Set(d.languages||[]);for(const l in d.translations)u.has(l)||_(l,d.translations[l])}t.state=Q(n)?n:Ht(n),t.state.__element=t,t.state.root=t.state,ut(t,t.state),Et.promoteActiveRootState?.(f,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),ut(t,t.state);return}if(typeof a=="string"){if(t.state=Lo(a,o),t.state&&typeof t.state=="object"&&!Q(t.state)){const f=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:f,enumerable:!1,configurable:!0,writable:!0})}ut(t,t.state);return}if(typeof a=="function"){const f=a(t,o?.state);t.state=Q(f)?f:Ht(f||{})}else Q(a)?t.state=a:t.state=Ht({...a});t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,ut(t,t.state),Et.promoteActiveRootState?.(a,t.state)}function Qt(t,o){if(!o)return t;const s=o.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Lo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Qt(o.state,r):o.state??{}}if(t.startsWith("~/")){const r=o.state?.root||o.state,i=t.slice(2);return i?Qt(r,i):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Qt(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=o.context?.polyglot;if(e?.translations){const r=o.state?.root?.lang||e.defaultLang||"en",i=e.translations[r];if(i?.[t]!==void 0)return i[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const Fs=new Set(["s","state","ctx","context"]);function $s(t){try{const s=(typeof Et.getFunctionSource=="function"?Et.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Is(t){if(typeof t!="function"||t.length!==2)return!1;const o=$s(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!Fs.has(s)}function Us(t){const o=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||K.has(f))continue;const n=f.charCodeAt(0);n>=65&&n<=90||Z(f)||D[f]||R&&R.has(f)||lt(s,f)||(nt()&&Is(t[f])&&console.warn(`[smbls] custom prop "${f}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:f,fn:t[f]}))}for(let a=0;a<r.length;a++){const{prop:f,fn:n}=r[a];o.__exec[f]=n,Object.defineProperty(t,f,{get(){e&&M(e);try{return n(t,t.state,t.context)}catch{return}finally{e&&N()}},set(d){delete o.__exec[f],Object.defineProperty(t,f,{value:d,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Vs(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const e=o[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...e){return Vs(t,o),s.apply(this,e)}}function At(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function k(t,o){return()=>t.path.join(".")+"::"+o}const Do=new Set;function O(t,o,s){if(!nt())return;const e=k(t,o)();Do.has(e)||(Do.add(e),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Ro=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Bs=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Ro.lastIndex=0;let e;for(;(e=Ro.exec(s))!==null;)e[2].includes("{{")&&o.add(e[2])},Gs=(t,o)=>!Z(t)&&!yt(o,t),Mo=(t,o,s,e,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Gs(t,e)&&Bs(o,s)},Xt=new WeakMap,xt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),wt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?tt(t,o):t},St=(t,o)=>t&&o?tt(t,o):t||o||null,No=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&xt(s,o)},it=(t,o)=>No(t,o)?wt(t.__ref.__runtimeSource[o]):null,Ct=(t,o)=>(o&&t&&typeof t=="object"&&Xt.set(t,o),t),Hs=t=>{if(!t||typeof t!="object")return;const o=Xt.get(t);return o&&Xt.delete(t),o},Jt=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let e=0;e<t.length;e++)Jt(t[e],o,s);return}if(!t.__ref)for(const e of Object.keys(t)){if(e==="state")continue;const r=Object.getOwnPropertyDescriptor(t,e);r&&"value"in r&&Jt(r.value,o,s)}}},Ks=(t,o)=>{let s=null;for(const e of Object.keys(t)){if(K.has(e)||o&&xt(o,e))continue;const r=Object.getOwnPropertyDescriptor(t,e),i=r&&r.value;if(!Array.isArray(i))continue;const a=new Set;Jt(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},Fo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const e=s.__ref&&s.__ref.__declaredArrays,r=e&&e.get(o);if(!r)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of r)i.__authoredTemplates.add(a);return}},Ws=["attr","aria","data","metadata"],zs=t=>{if(Ws.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Ys=(t,o)=>{const s=new Set,e=t.tag||"div";for(const r of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,r),a=i&&i.value,f=!!o&&xt(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!zs(r))continue;const n=f?o[r]:null,d=n&&typeof n=="object"?n:null;for(const y in a){const p=f&&(!d||xt(d,y));Mo(y,a[y],s,e,p)}continue}Mo(r,a,s,e,f)}return s};function $o(t,o){const s=t.__ref,e=!!(o&&o.skipIfEffect),r=Ys(t,s.__runtimeSource);if(s.__authoredTemplates)for(const n of r)s.__authoredTemplates.add(n);else s.__authoredTemplates=r;if(Us(t),typeof t.text=="function"){const n=t.text,d=T(t,t.textDeps,n),y=v(()=>{if(!s.contentManaged)try{let p=d(t,t.state,t.context);t.node&&p!=null&&typeof p!="function"&&typeof p!="object"&&(typeof p=="string"&&p.includes("{{")&&(p=I.call(t,p,t.state)),Ot(t,p))}catch(p){O(s,"text",p)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(y),s.__exec.text=n}else if(typeof t.text=="string"&&t.text.includes("{{")){const n=t.text,d=v(()=>{if(s.contentManaged)return;const y=I.call(t,n,t.state);y!=null&&(t.text=y),t.node&&Ot(t,y??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(d),s.__exec.text=n}const i=t.tag||"div";for(const n of Object.keys(t))if(typeof t[n]=="function"&&!K.has(n)&&!Z(n)&&!s.__exec[n]&&!So(i,n)){if(D[n]){const d=t[n],y=T(t,t[n+"Deps"],d),p=n;let h,_=null,c=null,u;const l=v(()=>{const g=t.context?.designSystem;g&&M(g);try{const b=y(t,t.state,t.context);bo();let A;try{A=D[p](b,t,t.state,t.context)}finally{Ao()}if(Array.isArray(A)){const S={};for(const w of A)if(w)for(const C in w)S[C]=w[C];A=S}const x=p==="show"||p==="hide";if(A&&t.node&&qs(A)){const S=Lt(A);if(S===null||S!==u){u=S;const w=dt(A,null,t.context?.cssPrefix),C=w?w.split(" ").filter(Boolean):null;if(t.node.classList){if(c)for(const j of c)t.node.classList.remove(j);if(C&&C.length)for(const j of C)t.node.classList.add(j);c=C}}h=void 0,_=null}else if(A&&t.node){if(c){for(const w of c)t.node.classList.remove(w);c=null,u=void 0}const S=Lt(A);if(S===null||S!==h||!Mt(t.node,_)){h=S;const w=Ho(t,A);_=Dt(t.node,w)}}else t.node&&x&&(h=void 0,_=null,t.node.style.display="")}finally{g&&N()}},{depth:s.path.length,label:k(s,p)});s.__effects.push(l),s.__exec[n]=d}else if(R&&R.has(n)){const d=t[n],y=T(t,t[n+"Deps"],d),p=n;let h,_=null;const c=v(()=>{const u=t.context?.designSystem;u&&M(u);try{const l=y(t,t.state,t.context);if(t.node)if(l!=null){const g=p+":"+String(l);if(g!==h||!Mt(t.node,_)){h=g;const b={[p]:l},A=Ho(t,b);_=Dt(t.node,A)}}else h=void 0,_=null,t.node.style[p]=""}finally{u&&N()}},{depth:s.path.length,label:k(s,p)});s.__effects.push(c),s.__exec[n]=d}}if(typeof t.html=="function"){const n=t.html,d=T(t,t.htmlDeps,n),y=v(()=>{const p=t.context?.designSystem;p&&M(p);try{const h=d(t,t.state,t.context);t.node&&h!=null&&typeof h!="function"&&(t.node.innerHTML=h)}finally{p&&N()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(y),s.__exec.html=n}if(typeof t.value=="function"){const n=t.value,d=T(t,t.valueDeps,n),y=v(()=>{try{let p=d(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=I.call(t,p,t.state)),Vo(t,p)}catch(p){O(s,"value",p)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(y),s.__exec.value=n}else if(typeof t.value=="string"&&t.value.includes("{{")){const n=t.value,d=v(()=>{try{Vo(t,I.call(t,n,t.state))}catch(y){O(s,"value",y)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(d),s.__exec.value=n}if(typeof t.style=="function"){const n=t.style,d=T(t,t.styleDeps,n);let y,p=null;const h=v(()=>{const _=d(t,t.state,t.context),c=Lt(_);(c===null||c!==y||!Mt(t.node,p))&&(y=c,Zs(t.node,p,_),m(t.node,_),p=Dt(t.node,_))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(h),s.__exec.style=n}else if(t.style&&typeof t.style=="object")for(const n in t.style){const d=t.style[n];if(typeof d!="function")continue;const y=T(t,At(t.styleDeps,n),d);let p,h=null;const _=v(()=>{try{const c=y(t,t.state,t.context);if(t.node){const u=n+":"+String(c);if(u!==p||!Mt(t.node,h)){p=u;const l={[n]:c};m(t.node,l),h=Dt(t.node,l)}}}catch(c){O(s,"style."+n,c)}},{depth:s.path.length,label:k(s,"style."+n)});s.__effects.push(_)}if(t.attr&&typeof t.attr=="object"){for(const n in t.attr)if(typeof t.attr[n]=="function"){const d=T(t,At(t.attrDeps,n),t.attr[n]),y=n,p=v(()=>{try{let h=d(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=I.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!ht(y)?t.node.removeAttribute(y):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(y,W(y,h)))}catch(h){O(s,"attr."+y,h)}},{depth:s.path.length,label:k(s,"attr."+y)});p._attrName=y.toLowerCase(),s.__effects.push(p)}else if(typeof t.attr[n]=="string"&&t.attr[n].includes("{{")){const d=t.attr[n],y=n,p=v(()=>{try{const h=I.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,W(y,h??""))}catch(h){O(s,"attr."+y,h)}},{depth:s.path.length,label:k(s,"attr."+y)});p._attrName=y.toLowerCase(),s.__effects.push(p)}}if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const d=t.aria[n];if(typeof d=="string"&&d.includes("{{")){const _=d,c="aria-"+n.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=v(()=>{try{const l=I.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(c,W(c,l??""))}catch(l){O(s,"aria."+n,l)}},{depth:s.path.length,label:k(s,"aria."+n)});u._attrName=c,s.__effects.push(u);continue}if(typeof d!="function")continue;const y=T(t,At(t.ariaDeps,n),t.aria[n]),p="aria-"+n.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=v(()=>{try{const _=y(t,t.state,t.context);if(!t.node?.setAttribute)return;_==null?t.node.removeAttribute(p):typeof _!="function"&&typeof _!="object"&&t.node.setAttribute(p,W(p,_))}catch(_){O(s,"aria."+n,_)}},{depth:s.path.length,label:k(s,"aria."+n)});h._attrName=p,s.__effects.push(h)}if(t.data&&typeof t.data=="object")for(const n in t.data){const d=t.data[n];if(typeof d=="string"&&d.includes("{{")){const c=d,u="data-"+n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),l=v(()=>{try{const g=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,g??"")}catch(g){O(s,"data."+n,g)}},{depth:s.path.length,label:k(s,"data."+n)});l._attrName=u,s.__effects.push(l);continue}if(typeof d!="function")continue;const y=T(t,At(t.dataDeps,n),t.data[n]),h="data-"+n.replace(/[A-Z]/g,c=>"-"+c.toLowerCase()),_=v(()=>{try{const c=y(t,t.state,t.context);if(!t.node?.setAttribute)return;c==null||c===!1?t.node.removeAttribute(h):typeof c!="function"&&typeof c!="object"&&t.node.setAttribute(h,c===!0?"":c)}catch(c){O(s,"data."+n,c)}},{depth:s.path.length,label:k(s,"data."+n)});_._attrName=h,s.__effects.push(_)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const n in a){if(typeof a[n]!="function")continue;const d=T(t,At(t.classDeps,n),a[n]),y=v(()=>{try{const p=d(t,t.state,t.context);if(!t.node?.classList)return;typeof p=="string"?t.node.classList.add(p):p?t.node.classList.add(n):t.node.classList.remove(n)}catch(p){O(s,"class."+n,p)}},{depth:s.path.length,label:k(s,"class."+n)});s.__effects.push(y)}!e&&typeof t.if=="function"&&Uo(t,s,t.if);for(const n of Object.keys(t)){if(K.has(n)||typeof t[n]!="function")continue;const d=n.charCodeAt(0);if(d>=65&&d<=90||Z(n))continue;const y=t[n];s.__exec[n]=y;const p=t.tag||"div";if(lt(p,n)&&!yt(p,n)){const h=pt(n)||n,_=T(t,t[n+"Deps"],y),c=v(()=>{try{let u=_(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),t.node?.setAttribute&&(u==null||u===!1&&!ht(h)?t.node.removeAttribute(h):typeof u!="function"&&typeof u!="object"&&(h==="src"&&"src"in t.node?t.node.src=u:t.node.setAttribute(h,W(h,u))))}catch(u){O(s,n,u)}},{depth:s.path.length,label:k(s,n)});c._attrName=h.toLowerCase(),s.__effects.push(c)}}const f=t.tag||"div";for(const n of Object.keys(t)){if(K.has(n))continue;const d=t[n];if(typeof d!="string"||!d.includes("{{"))continue;const y=n.charCodeAt(0);if(y>=65&&y<=90||Z(n)||yt(f,n)||Wt[n]||!lt(f,n))continue;const p=pt(n)||n,h=v(()=>{try{const _=I.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,W(p,_??""))}catch(_){O(s,n,_)}},{depth:s.path.length,label:k(s,n)});h._attrName=p.toLowerCase(),s.__effects.push(h)}if(on(t),rn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const n=t.onStateUpdate,d=t.stateDeps;let y=!1,p=[];const h=v(()=>{const _=[];for(let g=0;g<d.length;g++){const b=d[g];try{_[g]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{_[g]=void 0}}if(!y){y=!0,p=_;return}let c=_.length!==p.length;for(let g=0;!c&&g<_.length;g++)_[g]!==p[g]&&(c=!0);const u=p;if(p=_,!c)return;const l=t.context?.designSystem;l&&M(l);try{n(t,t.state,t.context,{prev:u,next:_})}catch(g){if(t.context?.plugins?.length&&q("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{l&&N()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(h)}en(t)}function Io(t){const o=t.parent,s=o?.node;if(!s||!t.node){fs(t,t.parent);return}let e=null;const r=Object.keys(o),i=r.indexOf(t.key);for(let a=i+1;a<r.length;a++){const f=o[r[a]];if(f?.node?.parentNode===s){e=f.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Uo(t,o,s){let e=T(t,t.ifDeps,s);const r=v(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const n=t.context?.components||{};i.names.some(d=>n[d]||n["smbls."+d])&&(o.__ifLateMerge=null,Rs(t,i),e=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=e(t,t.state,t.context)}catch(n){if(a=!1,o.__ifError=n,typeof console<"u"&&console.warn){const d=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${d} \u2014 treating as false:`,n?.message||n)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=Kt(t)),t.node&&(t.node.ref=t),Io(t),mt(t),F("Render",t,{}),qt(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=po(t)),F("Init",t,{}),t.node||(t.node=Kt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const d=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(d),o.__fragmentAnchor=d}F("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),is(t,{}),$o(t,{skipIfEffect:!0}),mt(t),mo(t),es(t),cs(t,{}),Io(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),qt(t,{})}},{depth:o.path.length,label:k(o,"if")});o.__effects.push(r)}function Ot(t,o){const s=t.node;if(!s)return;const e=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let i=r?r.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==e&&(i.nodeValue=e):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(i,s.firstChild)):(s.textContent=e,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=i||null)}function Vo(t,o){const s=t.node;if(!s||!("value"in s))return;const e=o==null?"":String(o);if(s.value===e)return;const r=typeof document<"u"&&document.activeElement===s,i=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=e,r&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function mt(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ot(t,t.text),Jo(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}m(o,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!ht(s)||o.setAttribute&&o.setAttribute(s,W(s,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||o.dataset&&(o.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&o.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&o.classList.add(typeof r=="string"?r:e)}}}}function Lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function qs(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Dt(t,o){if(!t||!t.style||!o)return null;const s=t.style,e=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=Rt(r);e.push(a,to(s,a),Bo(s,a))}return e}function to(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function Bo(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Rt(t){return Nt(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Zs(t,o,s){if(!t||!t.style||!o||!o.length)return;const e=t.style,r=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||r.add(Rt(i));for(let i=0;i<o.length;i+=3){const a=o[i];r.has(a)||to(e,a)===o[i+1]&&typeof e.removeProperty=="function"&&e.removeProperty(a)}}function Mt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let e=0;e<o.length;e+=3)if(to(s,o[e])!==o[e+1]||Bo(s,o[e])!==o[e+2])return!1;return!0}const Nt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function Qs(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(Rt(s)));return o}function Xs(t,o,s,e){const r=t.__ref;if(!r)return;let i=null;if(s)for(const a of s){if(e&&e.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const n=Rt(a);wo[n]&&(i||(i={}),i[n]=f)}r.__declaredLonghands=i}function Go(t,o){const s=t.__ref,e=s&&s.__declaredLonghands;if(!e||!o)return null;let r=null;for(const i in e){if(o.has(i))continue;const a=wo[i];let f=!1;for(let n=0;n<a.length;n++)if(o.has(a[n])){f=!0;break}f&&(r||(r={}),r[i]=e[i])}return r}function Ho(t,o){const s=t.node;m(s,o);const e=Qs(o);if(!e)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of e)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(e);const i=Go(t,e);return i?(m(s,i),Object.assign({},o,i)):o}function Js(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=Go(t,o.__inlineCssKeys);s&&m(t.node,s)}function m(t,o){if(!t||!o||!t.style)return;let s=null;for(const e in o){const r=o[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const i=String(r),a=Nt(e)?e:e.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),f=i.trim(),n=/\s*!important\s*$/.test(f),d=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,d,n?"important":"")}catch{}}}s&&ms(t,s)}function ms(t,o){const s=`_ds${Co.scopedStyleId++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let i="";for(const a in o){const f="."+s,n=a.replace(/&/g,f).split(",").map(y=>{const p=y.trim();return p.includes(f)?p:f+p}).join(", "),d=o[a];if(typeof d=="object"){let y="",p="";for(const h in d){const _=d[h];if(typeof _=="object"){const c=h.includes("&")?n.split(", ").map(l=>h.replace(/&/g,l)).join(", "):n.split(", ").map(l=>`${l} ${h}`).join(", ");let u="";for(const l in _)u+=`${l.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${_[l]};`;p+=xo(`${c} { ${u} }`,c)+`
|
|
5
|
-
`}else
|
|
6
|
-
`),p&&(i+=p)}}i&&(r.textContent+=i)}const Ko=new Set;function Wo(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function tn(t,o,s){const e=Wo(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(Wo(r)===e)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";Ko.has(i)||(Ko.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function on(t){const o=t.subscribeTo,s=typeof o=="function";let e=o;if(s)try{e=o(t,t.state,t.context)}catch{e=null}if(s&&nt()&&tn(t,o,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let i=0;i<e.length;i++){const a=e[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),n=f[0],d=f.slice(1),y={value:!1},p=v(()=>{const h=t.state&&(Q(t.state)?t.state.root:null);if(!h||!Q(h))return;let _=h;_=_[n];for(let u=0;u<d.length&&!(_==null||typeof _!="object");u++)if(Q(_))_=_[d[u]];else break;if(!y.value)return;let c=!1;if(typeof t.onBeforeUpdate=="function"){const u=t.context?.designSystem;u&&M(u);try{if(yn(r)){const l=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});l&&typeof l.then=="function"?l.then(()=>It(r,!1),g=>{It(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}):(It(r,!1),l===!1&&(c=!0))}}catch(l){It(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}finally{u&&N()}}if(!c&&t.node&&r.__effects)for(let u=0;u<r.__effects.length;u++){const l=r.__effects[u];l&&l!==p&&!l._disposed&&!l._isSubscribeToEffect&&typeof l._execute=="function"&&l._execute()}if(!c&&typeof t.onUpdate=="function"){const u=t.context?.designSystem;u&&M(u);try{t.onUpdate(t,t.state,t.context)}catch(l){t.context?.plugins?.length&&q("error",t,{hook:"onUpdate",error:l})||console.error("[DOMQL] subscribeTo onUpdate error:",l)}finally{u&&N()}}},{depth:r.path.length,label:k(r,"subscribeTo("+a+")")});y.value=!0,p._isSubscribeToEffect=!0,r.__effects.push(p)}}function oo(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function so(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const zo=new Set;function sn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",e=s+"::"+t;zo.has(e)||(zo.add(e),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function ct(t,o,s,e){const r={},i=new Set,a=(f,n,d)=>{const y=d?new Set(Object.keys(r)):null;if(D[f]){const p=D[f](n,o,o.state,o.context);if(p){const h=Array.isArray(p)?p:[p];for(const _ of h)_&&Object.assign(r,_)}}else r[f]=n;if(d)for(const p in r)y.has(p)||i.add(p)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let n=t[f];if(typeof n=="function"&&(n=n(o,o.state,o.context)),n==null||typeof n=="function")continue;if(typeof n=="object"&&!Array.isArray(n)){if(f==="style"){for(const _ in n){let c=n[_];if(typeof c=="function"&&(c=c(o,o.state,o.context)),c==null||typeof c=="function")continue;const u=typeof o[_]=="function"&&(D[_]||R&&R.has(_))||!!(e&&e.has(_));a(_,c,u)}continue}if(oo(f,o)){const _=ct(n,o,!1,e);Object.keys(_).length&&(r[`[data-theme="${f.slice(1)}"] &`]=_);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){nt()&&sn(f,o);continue}const p=so(f,o),h=ct(n,o,!1,e);Object.keys(h).length&&(r[p]=h);continue}const d=typeof o[f]=="function"&&(D[f]||R&&R.has(f)),y=!!(e&&e.has(f));a(f,n,d||y)}if(s)for(const f in r)i.add(f);for(const f of i){const n=r[f];typeof n=="string"&&!n.includes("!important")&&(r[f]=n+" !important")}return r}const Ft=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Yo(t,o){for(const s in o){const e=o[s];t[s]=Ft(e)?Yo(Ft(t[s])?t[s]:{},e):e}return t}function nn(t,o){if(!Ft(o))return;let s;for(const e of t.split(" ")){const r=e?o[e]:null;Ft(r)&&(s=Yo(s||{},r))}return s}function no(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&no(t[s],o+1))return!0}return!1}function qo(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(oo(t,s)){const i=ct(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const e=so(t,s),r=ct(o,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function en(t){const o=t.__ref;for(const s of Object.keys(t)){if(!Zt(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!no(e))continue;let r=null,i;const a=v(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&M(f);let n,d=!1;try{const y=qo(s,e,t),p=y?Lt(y.block)+"::"+y.cssProp:null;if(p!==null&&p===i)d=!0;else if(i=p,y){const h=dt({[y.cssProp]:y.block},null,t.context?.cssPrefix);n=h?h.split(" ").filter(Boolean):null}else n=null}finally{f&&N()}if(!(d||!t.node.classList)){if(r)for(const y of r)t.node.classList.remove(y);if(n&&n.length)for(const y of n)t.node.classList.add(y);r=n}},{depth:o.path.length,label:k(o,"cssBlock("+s+")")});o.__effects.push(a)}}function rn(t){const o=t.__ref;o.__conditionalRunners=[];const s=new Map;for(const e of Object.keys(t)){const r=e.charAt(0);if(r!=="."&&r!=="!")continue;const i=e.slice(1);if(!i)continue;if(/[:@\s>~+[\]]/.test(i)){if(typeof console<"u"&&console.warn){const c=i.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${c}: { '${i.slice(c.length)}': {...} }\`.`)}continue}const a=t[e];if(!a||typeof a!="object")continue;const f=r==="!",n={lastMatch:!1,appliedKeys:null,appliedClasses:null},d=new Set;for(const c in a){if(!Object.prototype.hasOwnProperty.call(a,c))continue;const u=c.charAt(0),l=a[c];(u===":"||u==="@"||u==="&"||u==="[")&&l&&typeof l=="object"&&!Array.isArray(l)||d.add(c)}const y=()=>{let c;const u=t[i];if(u===void 0){const b=!!t.state&&i in t.state,A=t.state?t.state[i]:void 0;if(b||A!==void 0)c=A;else{const x=t.context?.cases?.[i];if(x===void 0)return;try{c=typeof x=="function"?x.call(t,t):x}catch(S){c=!1,o.__conditionalError=S,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,S?.message||S)}}}else if(typeof u=="function")try{c=u(t,t.state,t.context)}catch(b){c=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else c=u;const l=f?!c:!!c;if(!t.node||l===n.lastMatch)return;n.lastMatch=l;const g=t.context?.designSystem;g&&M(g);try{if(l){const b={},A={};let x=!1;for(const w in a){if(!Object.prototype.hasOwnProperty.call(a,w))continue;const C=a[w],j=w.charAt(0);if((j===":"||j==="@"||j==="&"||j==="[")&&C&&typeof C=="object"&&!Array.isArray(C)){if(oo(w,t)){const G=ct(C,t,!1,d);Object.keys(G).length&&(A[`[data-theme="${w.slice(1)}"] &`]=G,x=!0)}else{const G=so(w,t),ot=ct(C,t,!1,d);Object.keys(ot).length&&(A[G]=ot,x=!0)}continue}const z=typeof C=="function"?C(t,t.state,t.context):C;if(z!=null)if(D[w]){const G=D[w](z,t,t.state,t.context);if(G){const ot=Array.isArray(G)?G:[G];for(const $ of ot)$&&Object.assign(b,$)}}else(R&&R.has(w)||Nt(w))&&(b[w]=z)}const S=Object.keys(b);if(S.length){m(t.node,b);for(const w of S)s.set(w,e);n.appliedKeys=S}else n.appliedKeys=null;if(x){const w=dt(A,null,t.context?.cssPrefix,{state:!0}),C=w?w.split(" ").filter(Boolean):[];if(C.length&&t.node.classList){for(const j of C)t.node.classList.add(j);n.appliedClasses=C}else n.appliedClasses=null}else if(n.appliedClasses){for(const w of n.appliedClasses)t.node.classList.remove(w);n.appliedClasses=null}}else{if(n.appliedKeys){for(const b of n.appliedKeys)s.get(b)===e&&(Nt(b)?t.node.style.removeProperty(b):t.node.style[b]="",s.delete(b));n.appliedKeys=null}if(n.appliedClasses){for(const b of n.appliedClasses)t.node.classList.remove(b);n.appliedClasses=null}}}finally{g&&N()}};o.__conditionalRunners.push(y);const p=T(t,t[i+"Deps"],y),h=v(p,{depth:o.path.length,label:k(o,"conditional("+e+")")}),_=o.__exec&&o.__exec[i]||t[i];h._sources.size===0&&typeof _=="function"&&nt()&&console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${i}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(h)}}const eo=new WeakSet;function cn(t){const o=t.ownerDocument;!o||eo.has(o)||(eo.add(o),queueMicrotask(()=>{eo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const ro=new WeakSet;let Zo=!1;function Qo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function io(t,o){const s={...t};for(const e in o){const r=o[e],i=s[e];s[e]=r&&typeof r=="object"&&i&&typeof i=="object"?io(i,r):r}return s}function Xo(t,o){const s={};for(const e in t){const r=t[e];if(r&&typeof r=="object"){const i=Xo(r,o);Object.keys(i).length&&(s[e]=i)}else o.has(e)||(s[e]=r)}return s}function Jo(t){const{node:o}=t;if(!o)return;if(Zo||(Zo=!0,dt({display:"none"})),ro.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}ro.add(t);const s=t.context?.designSystem;s&&M(s),bo();try{const e={};let r=!1,i=[],a=null,f=null,n=null;const d=(c,u)=>{if(u&&typeof u=="object"&&Qo(c)){f||(f={});const l=f[c];l&&(u=io(l,u)),f[c]=u}else(u===null||typeof u!="object")&&(n||(n=new Set),n.add(c));e[c]=u};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&D.theme){const c=D.theme(t.theme,t,t.state,t.context);if(c){const u=l=>{for(const g in l){const b=l[g];b&&typeof b=="object"&&Qo(g)&&(a||(a={}),a[g]=b),e[g]=b}};if(Array.isArray(c))for(const l of c)l&&u(l);else u(c);r=!0}}const y=(c,u)=>{if(D[c]){const l=D[c](u,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const g of l)if(g)for(const b in g)d(b,g[b])}else for(const g in l)d(g,l[g]);r=!0}}else if(R&&R.has(c))u!=null&&typeof u!="object"&&(d(c,u),r=!0);else if(c.charCodeAt(0)===45)u!=null&&typeof u!="object"&&(d(c,u),r=!0);else if((c.charAt(0)==="&"||c.charAt(0)==="@"||c.charAt(0)===":"||c.charAt(0)==="[")&&u&&typeof u=="object"&&!Array.isArray(u)){if(no(u))return;const l=qo(c,u,t);l&&(d(l.cssProp,l.block),r=!0)}};if(typeof t.class=="string"){const c=nn(t.class,t.context?.designSystem?.class);if(c)for(const u in c)y(u,c[u])}const p=n?new Set(n):null,h=t.tag||"div";for(const c of Object.keys(t)){if(typeof t[c]=="function"||K.has(c)||c==="theme")continue;const u=c.charCodeAt(0);u>=65&&u<=90||Z(c)||So(h,c)||y(c,t[c])}if(a)for(const c in a){let u=n?Xo(a[c],n):a[c];f&&f[c]&&(u=io(u,f[c])),Object.keys(u).length?e[c]=u:delete e[c]}if(Xs(t,e,n,p),r){e.display&&String(e.display).includes("!important")&&(o.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const c=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof c=="string"&&c!==""&&e.display&&e.display!==c&&(e.display=c);const u=dt(e,null,t.context?.cssPrefix);if(i=u?u.split(" ").filter(Boolean):[],u&&o.classList){const l=i;let g=!1;for(const b of l)o.classList.add(b),g||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(g=!0);g&&cn(o)}}const _=t.__ref;if(_){const c=_.__staticCssClasses;if(c&&o.classList){const u=new Set(i);for(const l of c)u.has(l)||o.classList.remove(l)}_.__staticCssClasses=i}Js(t)}finally{Ao(),s&&N(),ro.delete(t)}}const Bn=t=>!!D[t]||!!(R&&R.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Gn(t){t&&t.node&&Jo(t)}function mo(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const i=t.aria[r];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,W(a,i))}const s=Cs(t);for(const r in s){const i=s[r];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(r,i===!0?"":i)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||K.has(r)||r==="on"||s[r]!==void 0)continue;const i=r.charCodeAt(0);if(!(i>=65&&i<=90)&&!Z(r)&&!yt(e,r)&<(e,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!Wt[r])continue;a=I.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!ht(pt(r)||r))continue;const f=pt(r)||r;o.setAttribute(f,W(f,a))}}}function Hn(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const e=o.charCodeAt(0);if(e>=65&&e<=90||Z(o))return;const r=t.tag||"div";if(yt(r,o)||!lt(r,o))return;const i=pt(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let n=!1;if(f)for(let p=0;p<f.length;p++){const h=f[p];h&&h._attrName===a&&!h._disposed&&typeof h._execute=="function"&&(n=!0,h._execute())}if(n)return;let d=t[o];const y=Wt[o];if(y&&d!=null){const p=y(t);p!==void 0&&(d=p)}typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),d==null||d===!1&&!ht(i)?s.removeAttribute(i):typeof d!="function"&&typeof d!="object"&&s.setAttribute(i,W(i,d))}function fn(t,o){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}os(r),J.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),ss(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){kt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,ts(t,r);return}r.awaitingLayout=!1;const a=s.style.height;s.style.height="0px";const f=s.scrollHeight;if(!(f>0)){s.style.height=a;return}const n=dn(s),d=n!=null&&f>n;s.style.height=(d?n:f)+"px",ss(s,r,d),r.lastMeasure=f,r.lastWidth=s.clientWidth,ts(t,r)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}os(r),J.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,un(t,r));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==r.appliedMax&&(i==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,r.appliedMax=i),r.resize()}function kt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),J.add(t),Pt())}function an(){const t=Array.from(J);J.clear();for(let o=0;o<t.length;o++){const s=t[o],e=s.node,r=s.__ref?.__autoGrow;if(!(!e||!r||!r.active)){if(!e.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=rt()),r.attachAttempts+=1,r.attachAttempts<=jo&&rt()-r.firstAttemptAt<Eo&&(J.add(s),Pt());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function ts(t,o){if(o.watch)return;const s=t.node;if(!s)return;const e=s.ownerDocument&&s.ownerDocument.defaultView,r=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,kt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,kt(t,!0))};let a;try{a=new r(i),a.observe(s)}catch{return}o.watch=a}function os(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function un(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,e=s&&s.fonts&&s.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{o.active&&t.node&&kt(t,!0)},()=>{})}function dn(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;let s;try{s=o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{s=null}if(!s)return null;const e=y=>typeof y=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(y)?parseFloat(y):null,r=e(s.maxHeight);if(r==null||!(r>0))return null;const i=(e(s.paddingTop)||0)+(e(s.paddingBottom)||0),a=(e(s.borderTopWidth)||0)+(e(s.borderBottomWidth)||0),f=s.boxSizing==="border-box"?r-a:r+i,n=e(s.lineHeight);if(!(n>0))return f;const d=Math.floor((f-i)/n+1e-6);return d>=1?d*n+i:f}function ss(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const ns=["srcObject","muted"],ln=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function pn(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let e=0;e<ns.length;e++){const r=ns[e],i=t[r];if(i===void 0||!(r in o))continue;const a=f=>{const n=ln(r,f);if(o[r]!==n)try{o[r]=n}catch(d){O(s,r,d)}};if(typeof i=="function"){const f=T(t,t[r+"Deps"],i),n=v(()=>{try{a(f(t,t.state,t.context))}catch(d){O(s,r,d)}},{depth:s.path.length,label:k(s,r)});s.__effects.push(n),s.__exec[r]=i}else a(i);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function es(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?T(t,t.autoGrowDeps,e):null,i=v(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===e&&r?r:a)(t,t.state,t.context)}catch{f=null}fn(t,f)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),r&&(s.__exec.autoGrow=e)}const rs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function is(t,o){for(const s of Object.keys(t)){if(!Z(s)||rs.has(s))continue;const e=bs(s);if(e){gs(e,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const a=r;r=function(n){return t.call(a,n)}}if(typeof r!="function")continue;const i=Os(s);ys.has(i)||_s(Ls(i),t,r)}hn(t)}function hn(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let e=!1;for(const h of rs){const _=t[h];typeof _=="function"&&(s[h]=_,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,n=0,d=!1;const y=h=>{const _=h.touches&&h.touches[0]||h.changedTouches&&h.changedTouches[0];_&&(a=_.clientX,f=_.clientY,n=Date.now(),d=!0)},p=h=>{if(!d)return;d=!1;const _=h.changedTouches&&h.changedTouches[0]||h.touches&&h.touches[0];if(!_)return;const c=_.clientX-a,u=_.clientY-f,l=Date.now()-n;if(l>i)return;const g=Math.abs(c),b=Math.abs(u);if(Math.max(g,b)<r)return;let A;if(g>b*1.2)A=c<0?"left":"right";else if(b>g*1.2)A=u<0?"up":"down";else return;const x="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),S=s[x],w=s.onSwipe;S&&S.call(t,h,t,t.state,t.context),w&&w.call(t,{direction:A,dx:c,dy:u,dt:l,event:h},t,t.state,t.context)};o.addEventListener("touchstart",y,{passive:!0}),o.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",y)}catch{}try{o.removeEventListener("touchend",p)}catch{}})}function tt(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=tt(r,i):s[e]=i}return s}function co(t,o,s,e,r){if(!o||!t.node)return;const i=t.childExtends,a=it(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",n=t.context?.document||globalThis.document,d=f?null:n?.createDocumentFragment();if(!f&&!d)return;const y=t.childProps,p=t.childrenAs,h=b=>{let A=o[b];const x=A;(typeof A=="string"||typeof A=="number")&&(A={text:A});let S=y;if(typeof y=="function")try{S=y(t,A)}catch{S=null}let w=typeof y=="function"?wt(S):a;if(r&&p!=="state"&&(w=St(w,wt(x))),p==="state"){let j=x;(typeof x=="string"||typeof x=="number")&&(j={value:x,text:x}),A=S?{...S,state:j}:{state:j}}else S&&(A=tt(S,A));if(i&&!A.ignoreChildExtends)if(A.extends){const j=Array.isArray(A.extends)?A.extends:[A.extends],z=Array.isArray(i)?i:[i];A={...A,extends:[...z,...j]}}else A={...A,extends:i};const C=To(A?.key,x,b);try{return X(Ct(A,w),t,C,s)}catch(j){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (initial render, skipping this row):`,j?.message||j)}return null}},_=t.__ref;if(!(e===!0&&!f&&!!_&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let b=0;b<o.length;b++){const A=h(b);!f&&A?.node&&d.appendChild(A.node)}return f||t.node.appendChild(d),!0}const u=_.__childrenChunkGen=(_.__childrenChunkGen||0)+1;yo();let l=null;const g=b=>{if(_.__disposed||_.__childrenChunkGen!==u){l&&l.parentNode&&l.remove();return}for(let A=b;A<o.length;A++){const x=h(A);if(x?.node&&(l?t.node.insertBefore(x.node,l):d.appendChild(x.node)),A+1<o.length&&ho()){l||(l=n.createComment("smbls-mount"),d.appendChild(l),t.node.appendChild(d));const S=A+1;go(()=>g(S));return}}l?(l.remove(),t.node.tagName==="SELECT"&&$t(t,!0)):t.node.appendChild(d)};return g(0),_o(),!0}if(typeof o=="string"){const f=Lo(o,t);if(Array.isArray(f))return co(t,f,s,e,!0)}if(typeof o=="object")for(const f in o){if(K.has(f))continue;let n=o[f];if(n==null||n===!1)continue;const d=r?St(a,wt(n)):a;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=tt(t.childProps,n)),i&&!n.ignoreChildExtends)if(n.extends){const y=Array.isArray(n.extends)?n.extends:[n.extends],p=Array.isArray(i)?i:[i];n={...n,extends:[...p,...y]}}else n={...n,extends:i};X(Ct(n,d),t,f,s)}}function $t(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,i=r&&r.__exec&&r.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let y;if(a)try{y=i(t,t.state,t.context)}catch{return}else y=t.value,typeof y=="string"&&y.includes("{{")&&(y=I.call(t,y,t.state));const p=y==null?"":String(y);s.value!==p&&(s.value=p);return}const n=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!n)return;let d=-1;for(let y=0;y<e.length;y++)e[y].defaultSelected&&(d=y);d>=0&&s.selectedIndex!==d&&(s.selectedIndex=d)}function cs(t,o){let{children:s,content:e}=t;const r=t.childExtends,i=typeof s=="function"||No(t,"children");if(typeof s=="function"){const c=s;try{s=c(t,t.state,t.context)}catch(A){if(s=void 0,typeof console<"u"&&console.error){const x=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${x} (initial run, treating as empty):`,A?.message||A)}}Fo(t,s),t.children=s;const u=t.__ref;let l=!1;const g=T(t,t.childrenDeps,c),b=v(()=>{const A=l;l=!0;let x;try{x=g(t,t.state,t.context)}catch($){if(typeof console<"u"&&console.error){const V=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${V}${A?"":" (initial tracking run)"}:`,$?.message||$)}return}if(!A||x===t.children)return;Fo(t,x),t.children=x,u.__childrenChunkGen!=null&&u.__childrenChunkGen++;const S=typeof t.onContentUpdate=="function",w=S?[]:null,C=S?[]:null,j=S?[]:null;if(Array.isArray(x)&&t.childrenAs==="state"){const $=t.childProps,V=[],ao=new Map;for(let E=0;E<x.length;E++){const B=x[E];let P=$;if(typeof $=="function")try{P=$(t,B)}catch{P=null}const Y=To(P&&P.key,B,E);V.push(Y),ao.set(Y,{rawChild:B,childProps:P})}const as=new Set(V),us=u.__children.slice();for(const E of us)if(!as.has(E)){const B=t[E];B?.remove&&B.remove(),delete t[E],C&&C.push(E)}const ft=t.childExtends,vt=t.tag==="fragment",ds=t.context?.document||globalThis.document,at=vt?null:ds?.createDocumentFragment(),Ut=new Set;for(const E of V){const B=ao.get(E),P=B.rawChild,Y=t[E];if(Y&&Y.state){if(P&&typeof P=="object"){const L=Y.state,st=L.$replace||L.replace,uo=L.$update||L.update;try{if(typeof st=="function")st.call(L,P);else if(typeof uo=="function"){for(const U in L)if(!(U==="__element"||U==="root"||U==="parent"||U==="update")&&!Object.prototype.hasOwnProperty.call(P,U))try{L[U]=void 0}catch{}uo.call(L,P)}else for(const U in P)L[U]=P[U]}catch(U){if(typeof console<"u"&&console.error){const ps=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${ps} (reconcile, keeping its previous data for this pass):`,U?.message||U)}}}j&&j.push(E);continue}let Vt=P;(typeof P=="string"||typeof P=="number")&&(Vt={value:P,text:P});const Bt=B.childProps;let H=Bt?{...Bt,state:Vt}:{state:Vt};const ls=typeof $=="function"?wt(Bt):it(t,"childProps");if(ft&&!H.ignoreChildExtends)if(H.extends){const L=Array.isArray(H.extends)?H.extends:[H.extends],st=Array.isArray(ft)?ft:[ft];H={...H,extends:[...st,...L]}}else H={...H,extends:ft};let Gt;try{Gt=X(Ct(H,ls),t,E,o)}catch(L){if(typeof console<"u"&&console.error){const st=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${st} (reconcile, skipping this row):`,L?.message||L)}Ut.add(E);continue}!vt&&Gt?.node&&at&&at.appendChild(Gt.node),w&&w.push(E)}if(!vt&&at&&at.childNodes.length&&t.node&&t.node.appendChild(at),!vt&&t.node){let E=null;for(const B of V){const P=t[B]?.node;if(!P)continue;const Y=E?E.nextSibling:t.node.firstChild;P!==Y&&t.node.insertBefore(P,Y),E=P}}u.__children=Ut.size?V.filter(E=>!Ut.has(E)):V,S&&(w.length||C.length)&&Po(t,{added:w,removed:C,kept:j}),$t(t,!1);return}const ot=S?[...u.__children]:null;for(const $ of[...u.__children]){const V=t[$];V?.remove&&V.remove(),delete t[$]}u.__children=[],co(t,x,o,!1,!0),$t(t,!1),S&&Po(t,{added:[...u.__children],removed:ot,kept:[]})},{depth:u.path.length,label:k(u,"children")});u.__effects.push(b)}const a=co(t,s,o,!0,i);if(e!=null&&!(e&&e.__ref)){let c=e;if(typeof c=="string"||typeof c=="number"?c={text:c}:typeof c!="object"&&(c={}),t.childProps&&(c=tt(t.childProps,c)),r&&!c.ignoreChildExtends)if(c.extends){const l=Array.isArray(c.extends)?c.extends:[c.extends],g=Array.isArray(r)?r:[r];c={...c,extends:[...g,...l]}}else c={...c,extends:r};const u=St(it(t,"childProps"),it(t,"content"));X(Ct(c,u),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},n=t.__ref&&t.__ref.__runtimeSource,d=n?{}:null;{const c=Object.keys(t);for(let u=0;u<c.length;u++){const l=c[u];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;const g=l.slice(0,-7);if(!g||g.charCodeAt(0)<65||g.charCodeAt(0)>90)continue;const b={extends:t[l]};delete t[l];for(let A=u+1;A<c.length;A++){const x=c[A],S=x.charCodeAt(0);if(S>=65&&S<=90||K.has(x)||typeof t[x]=="function"&&(x.startsWith("on")||x.startsWith(".")))break;const w=t[x];w!==void 0&&(b[x]=w,delete t[x],d&&xt(n,x)&&(d[g]||(d[g]={}),d[g][x]=n[x]))}t[g]&&typeof t[g]=="object"?t[g]={...b,...t[g]}:t[g]=b}}const y=o?.mountYield===!0||t.yieldChildren===!0,p=Object.keys(t),h=c=>{if(K.has(c)||typeof t[c]!="object"||t[c]===null)return;const u=c.charCodeAt(0);if(u<65||u>90)return;let l=t[c];if(l.__ref)return;if(!l.extends&&!l.extend){const b=f[c]||f[`smbls.${c}`];b&&(l={...l,extends:b})}if(t.childProps&&(l=tt(t.childProps,l)),r&&!l.ignoreChildExtends)if(l.extends){const b=Array.isArray(l.extends)?l.extends:[l.extends],A=Array.isArray(r)?r:[r];l={...l,extends:[...A,...b]}}else l={...l,extends:r};const g=n?St(it(t,"childProps"),St(d[c]||null,it(t,c))):null;X(Ct(l,g),t,c,o)};if(!y){for(const c of p)h(c);return}yo();const _=c=>{for(let u=c;u<p.length;u++)if(h(p[u]),u+1<p.length&&ho()){const l=u+1;go(()=>_(l));return}};_(0),_o()}function fs(t,o,s){const{node:e}=t;if(!e)return;e.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const a=r.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const f=s.node.nextSibling;a.insertBefore(e,f||r)}else a.insertBefore(e,r);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(e,a):i.appendChild(e)}else i.appendChild(e)}const fo=3;function yn(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=fo?!1:(t.__inBeforeUpdate=!0,!0)}function It(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===fo&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${fo}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function F(t,o,s){const e=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&q(e,o,s);const r="on"+t,i=o[r];if(typeof i=="function"){const n=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(n){if(o.__ref[n])return!0;o.__ref[n]=!0}const d=o.context?.designSystem;d&&M(d);let y=!!n;try{const p=i(o,o.state,o.context,s);if(p&&typeof p.then=="function"){const h=o.__ref;return p.catch(_=>{o.context?.plugins?.length&&q("error",o,{hook:r,error:_})||console.error(`[DOMQL] Lifecycle "${r}" error:`,_)}).finally(()=>{n&&h&&(h[n]=!1)}),y=!1,!0}if(p===!1)return!1}catch(p){if(o.context?.plugins?.length&&q("error",o,{hook:r,error:p})||console.error(`[DOMQL] Lifecycle "${r}" error:`,p),o.context?.strictMode)throw p}finally{d&&N(),y&&o.__ref&&(o.__ref[n]=!1)}}return!0}var Kn=X;export{fo as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,yn as acquireBeforeUpdateGuard,X as create,Kn as default,Yt as flushMounts,Bn as isStaticCssProp,Gn as recompileStaticCss,Hn as reconcileAttrProp,It as releaseBeforeUpdateGuard,Ot as writeElementText};
|
|
4
|
+
`):"")}}if(Kt(n,!0),Ls(n,o,r),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const d=n.context?.designSystem;d&&L(d);try{const h=n.html(n,n.state,n.context);h!=null&&typeof h!="function"&&(n.node.innerHTML=h)}catch{}finally{d&&D()}}if(R("Create",n,e),R("Complete",n,e),R("Render",n,e),R("RenderRouter",n,e),oo(n,e),typeof n.onFrame=="function"){const d=n.onFrame,h=n.context?.designSystem,y=()=>{if(n.node){if(n.node.isConnected){h&&L(h);try{d(n,n.state,n.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&D()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return n}function Go(t,o,s,e,r,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&ft()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${_}" but neither "${_}" nor "smbls.${_}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),Ks(t,o,i);const a=Ws(t),f=a?a.rank:0,n=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){e&&(t.key=e);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=jt(p,w):_&&n.has(b)?t[b]={...p,...w}:_&&so(b)?t[b]=jt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=jt(_,p):x&&n.has(w)?t[w]={..._,...p}:x&&so(w)?t[w]=jt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const u=t.scope&&typeof t.scope=="object"?t.scope:null,d=r?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=$s(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=xn(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),zs(t),dn(t,r,o,i),o}const fn=new Set(["key","parent","context","__ref"]);function an(t,o){for(const r of Object.keys(t))fn.has(r)||delete t[r];const s=ko();s&&Nt(null);let e=o.definition;if(!e.extends&&!e.extend&&typeof o.key=="string"){const r=t.context?.components||{},i=r[o.key]||r["smbls."+o.key];i&&(e={...e,extends:i})}try{Go(t,e,o.key,o.ownKey,t.parent,o.options)}finally{s&&Nt(s)}}function un(t,o,s){const e=s||{},r=f=>!!(e[f]||e["smbls."+f]),i=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const f of a){if(typeof f!="string")continue;const n=f.includes(">")?f.split(">")[0].trim():f;r(n)||i.push(n)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const n=o.indexOf("_"),c=o.indexOf(".");n>0&&(f=n),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;r(l)||i.push(l)}return i}function no(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const e=t.state;t.state=o;try{R("StateInit",t,s)}finally{t.state=e}}function dn(t,o,s,e){const r=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!Y(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,xt(t,t.state);else if(t.context?.state){const n=t.context.state,c={...n},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=n.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||Ys(u,b,c)&&(c[b]=w,h.add(b),qs(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}Y(c)||no(t,c,e),t.state=Y(c)?c:Qt(c),t.state.__element=t,t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(n,t.state),R("StateCreated",t,e)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),xt(t,t.state);return}if(typeof f=="string"){if(t.state=Ko(f,o),t.state&&typeof t.state=="object"&&!Y(t.state)){const n=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:n,enumerable:!1,configurable:!0,writable:!0})}xt(t,t.state),R("StateCreated",t,e);return}if(typeof f=="function"){const n=f(t,o?.state);if(Y(n))t.state=n;else{const c=n||{};no(t,c,e),t.state=Qt(c)}}else if(Y(f))t.state=f;else{const n={...f};no(t,n,e),t.state=Qt(n)}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(f,t.state),R("StateCreated",t,e)}function eo(t,o){if(!o)return t;const s=o.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Ko(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?eo(o.state,r):o.state??{}}if(t.startsWith("~/")){const r=o.state?.root||o.state,i=t.slice(2);return i?eo(r,i):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=eo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=o.context?.polyglot;if(e?.translations){const r=o.state?.root?.lang||e.defaultLang||"en",i=e.translations[r];if(i?.[t]!==void 0)return i[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const ln=new Set(["s","state","ctx","context"]);function pn(t){try{const s=(typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function hn(t){if(typeof t!="function"||t.length!==2)return!1;const o=pn(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!ln.has(s)}function yn(t){const o=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||G.has(f))continue;const n=f.charCodeAt(0);n>=65&&n<=90||Z(f)||U[f]||V&&V.has(f)||n!==45&&(St(s,f)||(ft()&&hn(t[f])&&console.warn(`[smbls] custom prop "${f}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:f,fn:t[f]})))}for(let a=0;a<r.length;a++){const{prop:f,fn:n}=r[a];o.__exec[f]=n,Object.defineProperty(t,f,{get(){e&&L(e);try{return n(t,t.state,t.context)}catch{return}finally{e&&D()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function _n(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const e=o[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...e){return _n(t,o),s.apply(this,e)}}function lt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function k(t,o){return()=>t.path.join(".")+"::"+o}const Wo=new Set;function M(t,o,s){if(!ft())return;const e=k(t,o)();Wo.has(e)||(Wo.add(e),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const zo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,gn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;zo.lastIndex=0;let e;for(;(e=zo.exec(s))!==null;)e[2].includes("{{")&&o.add(e[2])},bn=(t,o)=>!Z(t)&&!st(o,t),ro=(t,o,s,e,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&bn(t,e)&&gn(o,s)},io=new WeakMap,Et=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Pt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?it(t,o):t},Ot=(t,o)=>t&&o?it(t,o):t||o||null,Yo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&Et(s,o)},pt=(t,o)=>Yo(t,o)?Pt(t.__ref.__runtimeSource[o]):null,Tt=(t,o)=>(o&&t&&typeof t=="object"&&io.set(t,o),t),An=t=>{if(!t||typeof t!="object")return;const o=io.get(t);return o&&io.delete(t),o},co=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let e=0;e<t.length;e++)co(t[e],o,s);return}if(!t.__ref)for(const e of Object.keys(t)){if(e==="state")continue;const r=Object.getOwnPropertyDescriptor(t,e);r&&"value"in r&&co(r.value,o,s)}}},xn=(t,o)=>{let s=null;for(const e of Object.keys(t)){if(G.has(e)||o&&Et(o,e))continue;const r=Object.getOwnPropertyDescriptor(t,e),i=r&&r.value;if(!Array.isArray(i))continue;const a=new Set;co(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},qo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const e=s.__ref&&s.__ref.__declaredArrays,r=e&&e.get(o);if(!r)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of r)i.__authoredTemplates.add(a);return}},Zo=["attr","aria","data","metadata"],wn=t=>{if(Zo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Sn=(t,o)=>{const s=new Set,e=t.tag||"div";for(const r of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,r),a=i&&i.value,f=!!o&&Et(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!wn(r))continue;const n=f?o[r]:null,c=n&&typeof n=="object"?n:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||Et(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&Zo.includes(u)){for(const y in h)ro(y,h[y],s,e,d);continue}ro(u,h,s,e,d)}continue}ro(r,a,s,e,f)}return s};function Qo(t,o){const s=t.__ref,e=!!(o&&o.skipIfEffect),r=Sn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const n of r)s.__authoredTemplates.add(n);else s.__authoredTemplates=r;if(yn(t),typeof t.text=="function"){const n=t.text,c=T(t,t.textDeps,n),l=j(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),Ht(t,u))}catch(u){M(s,"text",u)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(l),s.__exec.text=n}else if(typeof t.text=="string"&&t.text.includes("{{")){const n=t.text,c=j(()=>{if(s.contentManaged)return;const l=I.call(t,n,t.state);l!=null&&(t.text=l),t.node&&Ht(t,l??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=n}const i=t.tag||"div";for(const n of Object.keys(t))if(typeof t[n]=="function"&&!G.has(n)&&!Z(n)&&!s.__exec[n]&&!No(i,n)){if(U[n]){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null,y=null,A;const g=j(()=>{const b=t.context?.designSystem;b&&L(b);try{const w=l(t,t.state,t.context);Lo();let p;try{p=U[u](w,t,t.state,t.context)}finally{Do()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const v in S)x[v]=S[v];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&Cn(p)){const x=Lt(p);if(x===null||x!==A){A=x;const S=wt(p,null,t.context?.cssPrefix),v=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const C of y)t.node.classList.remove(C);if(v&&v.length)for(const C of v)t.node.classList.add(C);y=v}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Lt(p);if(x===null||x!==d||!yt(t.node,h)){d=x;const S=es(t,p);h=ht(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(g),s.__exec[n]=c}else if(V&&V.has(n)){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null;const y=j(()=>{const A=t.context?.designSystem;A&&L(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!yt(t.node,h)){d=b;const w={[u]:g},p=es(t,w);h=ht(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(y),s.__exec[n]=c}else if(n.charCodeAt(0)===45){const c=t[n];ss(t,n,c,t[n+"Deps"],n),s.__exec[n]=c}}if(vn(t),typeof t.html=="function"){const n=t.html,c=T(t,t.htmlDeps,n),l=j(()=>{const u=t.context?.designSystem;u&&L(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&D()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(l),s.__exec.html=n}if(typeof t.value=="function"){const n=t.value,c=T(t,t.valueDeps,n),l=j(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),mo(t,u)}catch(u){M(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(l),s.__exec.value=n}else if(typeof t.value=="string"&&t.value.includes("{{")){const n=t.value,c=j(()=>{try{mo(t,I.call(t,n,t.state))}catch(l){M(s,"value",l)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=n}if(typeof t.style=="function"){const n=t.style,c=T(t,t.styleDeps,n);let l,u=null;const d=j(()=>{const h=lo(t,c(t,t.state,t.context)),y=Lt(h);(y===null||y!==l||!yt(t.node,u))&&(l=y,Vt(t.node,u,h),X(t.node,h),u=ht(t.node,h))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=n}else if(t.style&&typeof t.style=="object")for(const n in t.style){const c=t.style[n];if(typeof c!="function")continue;const l=T(t,lt(t.styleDeps,n),c);let u,d=null;const h=j(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=n+":"+String(y);if(A!==u||!yt(t.node,d)){u=A;const g=lo(t,{[n]:y});Vt(t.node,d,Object.assign({},g,{[n]:""})),X(t.node,g),d=ht(t.node,g)}}}catch(y){M(s,"style."+n,y)}},{depth:s.path.length,label:k(s,"style."+n)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const n in t.attr)if(typeof t.attr[n]=="function"){const c=T(t,lt(t.attrDeps,n),t.attr[n]),l=n,u=j(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!at(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,K(l,d)))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[n]=="string"&&t.attr[n].includes("{{")){const c=t.attr[n],l=n,u=j(()=>{try{const d=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,d??""))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=j(()=>{try{const g=I.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,K(y,g??""))}catch(g){M(s,"aria."+n,g)}},{depth:s.path.length,label:k(s,"aria."+n)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=T(t,lt(t.ariaDeps,n),t.aria[n]),u="aria-"+n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=j(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,K(u,h))}catch(h){M(s,"aria."+n,h)}},{depth:s.path.length,label:k(s,"aria."+n)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+n.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=j(()=>{try{const b=I.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){M(s,"data."+n,b)}},{depth:s.path.length,label:k(s,"data."+n)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=T(t,lt(t.dataDeps,n),t.data[n]),d="data-"+n.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=j(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){M(s,"data."+n,y)}},{depth:s.path.length,label:k(s,"data."+n)});h._attrName=d,s.__effects.push(h)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const n in a){if(typeof a[n]!="function")continue;const c=T(t,lt(t.classDeps,n),a[n]),l=j(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(n):t.node.classList.remove(n)}catch(u){M(s,"class."+n,u)}},{depth:s.path.length,label:k(s,"class."+n)});s.__effects.push(l)}!e&&typeof t.if=="function"&&Jo(t,s,t.if);for(const n of Object.keys(t)){if(G.has(n)||typeof t[n]!="function")continue;const c=n.charCodeAt(0);if(c>=65&&c<=90||Z(n))continue;const l=t[n];s.__exec[n]=l;const u=t.tag||"div";if(St(u,n)&&!st(u,n)){const d=Ct(n)||n,h=T(t,t[n+"Deps"],l),y=j(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=I.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!at(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,K(d,A))))}catch(A){M(s,n,A)}},{depth:s.path.length,label:k(s,n)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const n of Object.keys(t)){if(G.has(n))continue;const c=t[n];if(typeof c!="string"||!c.includes("{{"))continue;const l=n.charCodeAt(0);if(l>=65&&l<=90||Z(n)||st(f,n)||Jt[n]||!St(f,n))continue;const u=Ct(n)||n,d=j(()=>{try{const h=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,h??""))}catch(h){M(s,n,h)}},{depth:s.path.length,label:k(s,n)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(Ln(t),Hn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const n=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=j(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&L(g);try{n(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&q("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&D()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Nn(t)}function Xo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ls(t,t.parent);return}let e=null;const r=Object.keys(o),i=r.indexOf(t.key);for(let a=i+1;a<r.length;a++){const f=o[r[a]];if(f?.node?.parentNode===s){e=f.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Jo(t,o,s){let e=T(t,t.ifDeps,s);const r=j(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const n=t.context?.components||{};i.names.some(c=>n[c]||n["smbls."+c])&&(o.__ifLateMerge=null,an(t,i),e=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=e(t,t.state,t.context)}catch(n){if(a=!1,o.__ifError=n,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,n?.message||n)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=Xt(t)),t.node&&(t.node.ref=t),Xo(t),fo(t),_o(t),R("Render",t,{}),oo(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=jo(t)),R("Init",t,{}),t.node||(t.node=Xt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}R("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Os(t,{}),Qo(t,{skipIfEffect:!0}),fo(t),xs(t),_o(t),Es(t),Ts(t,{}),Xo(t),R("Create",t,{}),R("Complete",t,{}),R("Render",t,{}),R("RenderRouter",t,{}),oo(t,{})}},{depth:o.path.length,label:k(o,"if")});o.__effects.push(r)}function Ht(t,o){const s=t.node;if(!s)return;const e=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let i=r?r.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==e&&(i.nodeValue=e):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(i,s.firstChild)):(s.textContent=e,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=i||null)}function mo(t,o){const s=t.node;if(!s||!("value"in s))return;const e=o==null?"":String(o);if(s.value===e)return;const r=typeof document<"u"&&document.activeElement===s,i=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=e,r&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function fo(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ht(t,t.text),As(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}X(o,lo(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!at(s)||o.setAttribute&&o.setAttribute(s,K(s,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||o.dataset&&(o.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&o.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&o.classList.add(typeof r=="string"?r:e)}}}}function Lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Cn(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function ht(t,o){if(!t||!t.style||!o)return null;const s=t.style,e=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=Q(r);e.push(a,ao(s,a),ts(s,a))}return e}function ao(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function ts(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Q(t){return et(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Vt(t,o,s){if(!t||!t.style||!o||!o.length)return;const e=t.style,r=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||r.add(Q(i));for(let i=0;i<o.length;i+=3){const a=o[i];r.has(a)||ao(e,a)===o[i+1]&&typeof e.removeProperty=="function"&&e.removeProperty(a)}}function yt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let e=0;e<o.length;e+=3)if(ao(s,o[e])!==o[e+1]||ts(s,o[e])!==o[e+2])return!1;return!0}const et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,os=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Bt=t=>et(t)?t:"--"+t;function Gt(t,o){if(!m(t))return null;let s=null;for(const e of Object.keys(t)){if(!e)continue;let r=t[e];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}os(r)&&(s||(s={}),s[Bt(e)]=r)}return s}function ss(t,o,s,e,r){const i=t.__ref,a=T(t,e,s);let f,n=null;const c=j(()=>{const l=t.context?.designSystem;l&&L(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!os(u)){Vt(d,n,null),f=void 0,n=null;return}const h=String(u);if(h!==f||!yt(d,n)){f=h;const y={[o]:u};X(d,y),n=ht(d,y)}}catch(u){M(i,r,u)}finally{l&&D()}},{depth:i.path.length,label:k(i,r)});i.__effects.push(c)}function vn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){kn(t,s),o.__exec.vars=s;return}if(m(s))for(const e of Object.keys(s)){const r=s[e];!e||typeof r!="function"||ss(t,Bt(e),r,lt(t.varsDeps,e),"vars."+e)}}function kn(t,o){const s=t.__ref,e=T(t,t.varsDeps,o);let r,i=null;const a=j(()=>{const f=t.context?.designSystem;f&&L(f);try{const n=Gt(e(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Lt(n);(l===null||l!==r||!yt(c,i))&&(r=l,Vt(c,i,n),n&&X(c,n),i=n?ht(c,n):null,s.__varsInline=n?new Set(Object.keys(n)):null)}catch(n){M(s,"vars",n)}finally{f&&D()}},{depth:s.path.length,label:k(s,"vars")});s.__effects.push(a)}function uo(t,o){if(typeof t[o]=="function"&&(st(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!et(o))return!1;const s=t.vars;if(typeof s=="function"){const e=t.__ref&&t.__ref.__varsInline;return!!(e&&e.has(o))}if(!m(s))return!1;for(const e of Object.keys(s))if(typeof s[e]=="function"&&Bt(e)===o)return!0;return!1}function jn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(Q(s)));return o}function En(t,o,s,e){const r=t.__ref;if(!r)return;let i=null;if(s)for(const a of s){if(e&&e.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const n=Q(a);$t[n]&&(i||(i={}),i[n]=f)}r.__declaredLonghands=i}function ns(t,o){const s=t.__ref,e=s&&s.__declaredLonghands;if(!e||!o)return null;let r=null;for(const i in e){if(o.has(i))continue;const a=$t[i];let f=!1;for(let n=0;n<a.length;n++)if(o.has(a[n])){f=!0;break}f&&(r||(r={}),r[i]=e[i])}return r}function es(t,o){const s=t.node;X(s,o);const e=jn(o);if(!e)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of e)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(e);const i=ns(t,e);return i?(X(s,i),Object.assign({},o,i)):o}function Pn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ns(t,o.__inlineCssKeys);s&&X(t.node,s)}function lo(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&L(s);try{return Zs(o,t)}catch{return o}finally{s&&D()}}function X(t,o){if(!t||!o||!t.style)return;let s=null;for(const e in o){const r=o[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const i=String(r),a=et(e)?e:e.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),n=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,n?"important":"")}catch{}}}s&&On(t,s)}function On(t,o){const s=`_ds${Fo.scopedStyleId++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let i="";for(const a in o){const f="."+s,n=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?n.split(", ").map(g=>d.replace(/&/g,g)).join(", "):n.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${Q(g)}: ${h[g]};`;u+=Mo(`${y} { ${A} }`,y)+`
|
|
5
|
+
`}else l+=`${Q(d)}: ${h};`}l&&(i+=Mo(`${n} { ${l} }`,n)+`
|
|
6
|
+
`),u&&(i+=u)}}i&&(r.textContent+=i)}const rs=new Set;function is(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function Tn(t,o,s){const e=is(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(is(r)===e)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";rs.has(i)||(rs.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Ln(t){const o=t.subscribeTo,s=typeof o=="function";let e=o;if(s)try{e=o(t,t.state,t.context)}catch{e=null}if(s&&ft()&&Tn(t,o,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let i=0;i<e.length;i++){const a=e[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),n=f[0],c=f.slice(1),l={value:!1},u=j(()=>{const d=t.state&&(Y(t.state)?t.state.root:null);if(!d||!Y(d))return;let h=d;h=h[n];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if(Y(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{if(se(r)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Wt(r,!1),b=>{Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Wt(r,!1),g===!1&&(y=!0))}}catch(g){Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&D()}}if(!y&&t.node&&r.__effects)for(let A=0;A<r.__effects.length;A++){const g=r.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&q("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&D()}}},{depth:r.path.length,label:k(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function po(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function ho(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const cs=new Set;function Dn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",e=s+"::"+t;cs.has(e)||(cs.add(e),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}const fs=new Map;function Mn(t){let o=fs.get(t);if(o)return o;o=[];const s=e=>{if(e)for(const r of e)o.push(r.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s($t[t]),s(ms[t]),fs.set(t,o),o}function as(t,o,s){if(uo(t,o)||s&&s.has(o))return!0;const e=Mn(Q(o));for(let r=0;r<e.length;r++){const i=e[r];if(uo(t,i)||s&&s.has(i))return!0}return!1}function _t(t,o,s,e){const r={},i=new Set,a=(f,n,c)=>{const l=c?new Set(Object.keys(r)):null;if(U[f]){const u=U[f](n,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[f]=n;if(c)for(const u in r)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let n=t[f];if(typeof n=="function"&&(n=n(o,o.state,o.context)),!(n==null||typeof n=="function")){if(typeof n=="object"&&!Array.isArray(n)){if(f==="style"){for(const u in n){let d=n[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,as(o,u,e))}continue}if(f==="vars"){const u=Gt(n,o);if(u)for(const d in u)a(d,u[d],uo(o,d)||!!(e&&e.has(d)));continue}if(po(f,o)){const u=_t(n,o,!1,e);Object.keys(u).length&&(r[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){ft()&&Dn(f,o);continue}const c=ho(f,o),l=_t(n,o,!1,e);Object.keys(l).length&&(r[c]=l);continue}a(f,n,as(o,f,e))}}if(s)for(const f in r)i.add(f);for(const f of i){const n=r[f];typeof n=="string"&&!n.includes("!important")&&(r[f]=n+" !important")}return r}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function us(t,o){for(const s in o){const e=o[s];t[s]=m(e)?us(m(t[s])?t[s]:{},e):e}return t}function Rn(t,o){if(!m(o))return;let s;for(const e of t.split(" ")){const r=e?o[e]:null;m(r)&&(s=us(s||{},r))}return s}function yo(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&yo(t[s],o+1))return!0}return!1}function ds(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(po(t,s)){const i=_t(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const e=ho(t,s),r=_t(o,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Nn(t){const o=t.__ref;for(const s of Object.keys(t)){if(!so(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!yo(e))continue;let r=null,i;const a=j(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&L(f);let n,c=!1;try{const l=ds(s,e,t),u=l?Lt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=wt({[l.cssProp]:l.block},null,t.context?.cssPrefix);n=d?d.split(" ").filter(Boolean):null}else n=null}finally{f&&D()}if(!(c||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(n&&n.length)for(const l of n)t.node.classList.add(l);r=n}},{depth:o.path.length,label:k(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Fn=()=>!0,$n=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!U[t]||!!(V&&V.has(t))||et(t)||t==="vars"};function In(t,o,s){const e={};let r=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&($n(f,s[f])||G.has(f))?e[f]=!0:r=!0);if(!r)return null;const i=Xs({[o]:s},t.tag||"div",e,Fn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function ls(t,o,s,e,r,i){const a=t.node;let f=null;const n=c=>{(f||(f=[])).push(c)};for(const c in e){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=e[c](t)}catch(y){M(t.__ref,"conditional("+s+")."+c,y),u&&n(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){n(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&ps(a,o,c);continue}const h=d===!1&&!at(c)?null:String(K(c,d));n(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}r.appliedAttrs=f}function ps(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const e=o.base.get(s);e==null?t.removeAttribute(s):t.setAttribute(s,e)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Un(t,o,s,e){const r=e.appliedAttrs;if(e.appliedAttrs=null,!!r)for(const i of r)o.owners.get(i)===s&&ps(t.node,o,i)}function _o(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const e of o.owners.keys()){const r=o.written.get(e),i=s.getAttribute(e);i!==r&&(o.base.set(e,i),r==null?s.removeAttribute(e):s.setAttribute(e,r))}}function Hn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const e=new Map;for(const r of Object.keys(t)){const i=r.charAt(0);if(i!=="."&&i!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[r];if(!f||typeof f!="object")continue;const n=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=In(t,r,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&m(w)){for(const p of Object.keys(w))p&&u.add(Bt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(v){g=!1,o.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=n?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&L(p);try{ls(t,s,r,l,c,!1)}finally{p&&D()}}return}c.lastMatch=w,p&&L(p);try{if(w){const _={},x={};let S=!1;for(const C in f){if(!Object.prototype.hasOwnProperty.call(f,C))continue;const N=f[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&N&&typeof N=="object"&&!Array.isArray(N)){if(po(C,t)){const P=_t(N,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=ho(C,t),F=_t(N,t,!1,u);Object.keys(F).length&&(x[P]=F,S=!0)}continue}const ot=typeof N=="function"?N(t,t.state,t.context):N;if(ot!=null){if(U[C]){const P=U[C](ot,t,t.state,t.context);if(P){const F=Array.isArray(P)?P:[P];for(const gt of F)gt&&Object.assign(_,gt)}}else if(V&&V.has(C))_[C]=ot;else if(et(C))_[C]=ot;else if(C==="vars"){const P=Gt(ot,t);P&&Object.assign(_,P)}}}const v=Object.keys(_);if(v.length){X(t.node,_);for(const C of v)e.set(C,r);c.appliedKeys=v}else c.appliedKeys=null;if(S){const C=wt(x,null,t.context?.cssPrefix,{state:!0}),N=C?C.split(" ").filter(Boolean):[];if(N.length&&t.node.classList){for(const tt of N)t.node.classList.add(tt);c.appliedClasses=N}else c.appliedClasses=null}else if(c.appliedClasses){for(const C of c.appliedClasses)t.node.classList.remove(C);c.appliedClasses=null}l&&t.node.setAttribute&&ls(t,s,r,l,c,!0)}else{if(c.appliedAttrs&&Un(t,s,r,c),c.appliedKeys){for(const _ of c.appliedKeys)e.get(_)===r&&(et(_)?t.node.style.removeProperty(_):t.node.style[_]="",e.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&D()}};o.__conditionalRunners.push(d);const h=T(t,t[a+"Deps"],d),y=j(h,{depth:o.path.length,label:k(o,"conditional("+r+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&ft()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(y)}}const go=new WeakSet,hs=new WeakSet,ys=new WeakSet;function Vn(t){if(ys.has(t))return!1;if(!hs.has(t)){hs.add(t);const o=t.defaultView,s=()=>{ys.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function Bn(t){const o=t.ownerDocument;!o||go.has(o)||Vn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const bo=new WeakSet;let _s=!1;function gs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ao(t,o){const s={...t};for(const e in o){const r=o[e],i=s[e];s[e]=r&&typeof r=="object"&&i&&typeof i=="object"?Ao(i,r):r}return s}function bs(t,o){const s={};for(const e in t){const r=t[e];if(r&&typeof r=="object"){const i=bs(r,o);Object.keys(i).length&&(s[e]=i)}else o.has(e)||(s[e]=r)}return s}function Gn(t,o,s){let e=null;for(const[r,i]of o){const a=Q(r),f=$t[a];if(f)for(let n=0;n<f.length;n++){const c=f[n].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[n]),d=l!==void 0&&l>i&&Ro(f[n],t[c],a),h=!d&&u!==void 0&&u>i&&Ro(f[n],void 0,a);if(d||h){d&&delete t[r],e||(e=new Set),e.add(r);break}}}return e}function As(t){const{node:o}=t;if(!o)return;if(_s||(_s=!0,wt({display:"none"})),bo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}bo.add(t);const s=t.context?.designSystem;s&&L(s),Lo();try{const e={};let r=!1,i=[],a=null,f=null,n=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&gs(p)){f||(f={});const x=f[p];x&&(_=Ao(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(n||(n=new Set),n.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));e[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&U.theme){const p=U.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const v=x[S];v&&typeof v=="object"&&gs(S)&&(a||(a={}),a[S]=v),e[S]=v}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);r=!0}}const y=(p,_)=>{if(p==="vars"){const x=Gt(_);if(x){for(const S in x)h(S,x[S]);r=!0}return}if(U[p]){const x=U[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const v in S)h(v,S[v])}else for(const S in x)h(S,x[S]);r=!0}}else if(V&&V.has(p))_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yo(_))return;const x=ds(p,_,t);x&&(h(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const p=Rn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=n?new Set(n):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&st(g,p)&&(d||(d=new Map),d.set(Q(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(G.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Z(p)||No(g,p)||y(p,t[p])}l=void 0;const b=u?Gn(e,u,d):null;if(a)for(const p in a){let _=n?bs(a[p],n):a[p];f&&f[p]&&(_=Ao(_,f[p])),Object.keys(_).length?e[p]=_:delete e[p]}if(En(t,e,n,b?new Set([...A||[],...b]):A),r){e.display&&String(e.display).includes("!important")&&(o.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&e.display&&e.display!==p&&(e.display=p);const _=wt(e,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const v of x)o.classList.add(v),S||(v.charCodeAt(0)===95&&v.charCodeAt(1)===99||v.charCodeAt(0)===95&&v.indexOf("_c",1)!==-1)&&(S=!0);S&&Bn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}Pn(t)}finally{Do(),s&&D(),bo.delete(t)}}const Oe=t=>!!U[t]||!!(V&&V.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Te(t){t&&t.node&&As(t)}function xs(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const i=t.aria[r];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,K(a,i))}const s=Qs(t);for(const r in s){const i=s[r];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(r,i===!0?"":i)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const i=r.charCodeAt(0);if(!(i>=65&&i<=90)&&!Z(r)&&!st(e,r)&&St(e,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!Jt[r])continue;a=I.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!at(Ct(r)||r))continue;const f=Ct(r)||r;o.setAttribute(f,K(f,a))}}}function Le(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const e=o.charCodeAt(0);if(e>=65&&e<=90||Z(o))return;const r=t.tag||"div";if(st(r,o)||!St(r,o))return;const i=Ct(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let n=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(n=!0,d._execute())}if(n)return;let c=t[o];const l=Jt[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=I.call(t,c,t.state)),c==null||c===!1&&!at(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,K(i,c))}function Kn(t,o){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),ks(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Dt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,ws(t,r);return}r.awaitingLayout=!1;const a=Yn(s),f=qn(a),n=s.style.height;s.style.height="0px",f&&wo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=n,f&&wo(s);return}const l=Zn(s,a),u=l!=null&&c<l?l:c,d=Jn(a),h=d!=null&&u>d;s.style.height=Xn(h?d:u,a)+"px",f&&wo(s),ks(s,r,h),r.lastMeasure=c,r.lastWidth=s.clientWidth,ws(t,r)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,zn(t,r));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==r.appliedMax&&(i==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,r.appliedMax=i),r.resize()}function Dt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),It())}function Wn(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],e=s.node,r=s.__ref?.__autoGrow;if(!(!e||!r||!r.active)){if(!e.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=dt()),r.attachAttempts+=1,r.attachAttempts<=Uo&&dt()-r.firstAttemptAt<Ho&&(nt.add(s),It());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function ws(t,o){if(o.watch)return;const s=t.node;if(!s)return;const e=s.ownerDocument&&s.ownerDocument.defaultView,r=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Dt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Dt(t,!0))};let a;try{a=new r(i),a.observe(s)}catch{return}o.watch=a}function Ss(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function zn(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,e=s&&s.fonts&&s.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{o.active&&t.node&&Dt(t,!0)},()=>{})}function Yn(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const rt=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,xo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Cs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function qn(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let e=0;e<o.length;e++){const r=o[e].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[e%s.length])>0)return!0}return!1}function wo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const e=o[s];if(e&&e.transitionProperty==="height")try{e.cancel()}catch{}}}function Zn(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const e=rt(o.lineHeight)||Qn(t,o);return e>0?s*e+xo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],vs=new WeakMap;function Qn(t,o){const s=t.ownerDocument,e=s&&(s.body||s.documentElement);if(!e||!s.createElement)return null;let r=vs.get(s);r||(r=new Map,vs.set(s,r));const i=Mt.map(c=>o[c]||"").join("|");if(r.has(i))return r.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Mt.length;c++)o[Mt[c]]&&(f[Mt[c]]=o[Mt[c]]);let n=0;try{e.appendChild(a),n=a.clientHeight}catch{n=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return n>0?(r.set(i,n),n):null}function Xn(t,o){return o?o.boxSizing==="border-box"?t+Cs(o):o.boxSizing==="content-box"?Math.max(0,t-xo(o)):t:t}function Jn(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=xo(t),e=Cs(t),r=t.boxSizing==="border-box"?o-e:o+s,i=rt(t.lineHeight);if(!(i>0))return r;const a=Math.floor((r-s)/i+1e-6);return a>=1?a*i+s:r}function ks(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const js=["srcObject","muted"],mn=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function te(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let e=0;e<js.length;e++){const r=js[e],i=t[r];if(i===void 0||!(r in o))continue;const a=f=>{const n=mn(r,f);if(o[r]!==n)try{o[r]=n}catch(c){M(s,r,c)}};if(typeof i=="function"){const f=T(t,t[r+"Deps"],i),n=j(()=>{try{a(f(t,t.state,t.context))}catch(c){M(s,r,c)}},{depth:s.path.length,label:k(s,r)});s.__effects.push(n),s.__exec[r]=i}else a(i);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Es(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?T(t,t.autoGrowDeps,e):null,i=j(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===e&&r?r:a)(t,t.state,t.context)}catch{f=null}Kn(t,f)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),r&&(s.__exec.autoGrow=e)}const Ps=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Os(t,o){for(const s of Object.keys(t)){if(!Z(s)||Ps.has(s))continue;const e=Bs(s);if(e){Vs(e,t,t[s]);continue}let r=t[s],i=null;if(r&&typeof r=="object"&&!Array.isArray(r)&&(i=r,r=i.handler),typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const f=r;r=function(c){return t.call(f,c)}}if(typeof r!="function")continue;const a=rn(s);Us.has(a)||Hs(cn(a),t,r,i)}oe(t)}function oe(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let e=!1;for(const d of Ps){const h=t[d];typeof h=="function"&&(s[d]=h,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,n=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,n=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-n;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<r)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=it(r,i):s[e]=i}return s}function So(t,o,s,e,r){if(!o||!t.node)return;const i=t.childExtends,a=pt(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",n=t.context?.document||globalThis.document,c=f?null:n?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Pt(x):a;if(r&&u!=="state"&&(S=Ot(S,Pt(_))),u==="state"){let C=_;(typeof _=="string"||typeof _=="number")&&(C={value:_,text:_}),p=x?{...x,state:C}:{state:C}}else x&&(p=it(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],N=Array.isArray(i)?i:[i];p={...p,extends:[...N,...C]}}else p={...p,extends:i};const v=Bo(p?.key,_,w);try{return J(Tt(p,S),t,v,s)}catch(C){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${N} (initial render, skipping this row):`,C?.message||C)}return null}},h=t.__ref;if(!(e===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;Po();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&Eo()){g||(g=n.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;To(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Kt(t,!0)):t.node.appendChild(c)};return b(0),Oo(),!0}if(typeof o=="string"){const f=Ko(o,t);if(Array.isArray(f))return So(t,f,s,e,!0)}if(typeof o=="object")for(const f in o){if(G.has(f))continue;let n=o[f];if(n==null||n===!1)continue;const c=r?Ot(a,Pt(n)):a;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=it(t.childProps,n)),i&&!n.ignoreChildExtends)if(n.extends){const l=Array.isArray(n.extends)?n.extends:[n.extends],u=Array.isArray(i)?i:[i];n={...n,extends:[...u,...l]}}else n={...n,extends:i};J(Tt(n,c),t,f,s)}}function Kt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,i=r&&r.__exec&&r.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=I.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const n=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!n)return;let c=-1;for(let l=0;l<e.length;l++)e[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function Ts(t,o){let{children:s,content:e}=t;const r=t.childExtends,i=typeof s=="function"||Yo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}qo(t,s),t.children=s;const A=t.__ref;let g=!1;const b=T(t,t.childrenDeps,y),w=j(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${p?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!p||_===t.children)return;qo(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const P=t.childProps,F=[],gt=new Map;for(let E=0;E<_.length;E++){const B=_[E];let O=P;if(typeof P=="function")try{O=P(t,B)}catch{O=null}const z=Bo(O&&O.key,B,E);F.push(z),gt.set(z,{rawChild:B,childProps:O})}const Ds=new Set(F),Ms=A.__children.slice();for(const E of Ms)if(!Ds.has(E)){const B=t[E];B?.remove&&B.remove(),delete t[E],v&&v.push(E)}const bt=t.childExtends,Rt=t.tag==="fragment",Rs=t.context?.document||globalThis.document,At=Rt?null:Rs?.createDocumentFragment(),zt=new Set;for(const E of F){const B=gt.get(E),O=B.rawChild,z=t[E];if(z&&z.state){if(O&&typeof O=="object"){const $=z.state,ct=$.$replace||$.replace,vo=$.$update||$.update;try{if(typeof ct=="function")ct.call($,O);else if(typeof vo=="function"){for(const H in $)if(!(H==="__element"||H==="root"||H==="parent"||H==="update")&&!Object.prototype.hasOwnProperty.call(O,H))try{$[H]=void 0}catch{}vo.call($,O)}else for(const H in O)$[H]=O[H]}catch(H){if(typeof console<"u"&&console.error){const Fs=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Fs} (reconcile, keeping its previous data for this pass):`,H?.message||H)}}}C&&C.push(E);continue}let Yt=O;(typeof O=="string"||typeof O=="number")&&(Yt={value:O,text:O});const qt=B.childProps;let W=qt?{...qt,state:Yt}:{state:Yt};const Ns=typeof P=="function"?Pt(qt):pt(t,"childProps");if(bt&&!W.ignoreChildExtends)if(W.extends){const $=Array.isArray(W.extends)?W.extends:[W.extends],ct=Array.isArray(bt)?bt:[bt];W={...W,extends:[...ct,...$]}}else W={...W,extends:bt};let Zt;try{Zt=J(Tt(W,Ns),t,E,o)}catch($){if(typeof console<"u"&&console.error){const ct=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${ct} (reconcile, skipping this row):`,$?.message||$)}zt.add(E);continue}!Rt&&Zt?.node&&At&&At.appendChild(Zt.node),S&&S.push(E)}if(!Rt&&At&&At.childNodes.length&&t.node&&t.node.appendChild(At),!Rt&&t.node){let E=null;for(const B of F){const O=t[B]?.node;if(!O)continue;const z=E?E.nextSibling:t.node.firstChild;O!==z&&t.node.insertBefore(O,z),E=O}}A.__children=zt.size?F.filter(E=>!zt.has(E)):F,x&&(S.length||v.length)&&Vo(t,{added:S,removed:v,kept:C}),Kt(t,!1);return}const ot=x?[...A.__children]:null;for(const P of[...A.__children]){const F=t[P];F?.remove&&F.remove(),delete t[P]}A.__children=[],So(t,_,o,!1,!0),Kt(t,!1),x&&Vo(t,{added:[...A.__children],removed:ot,kept:[]})},{depth:A.path.length,label:k(A,"children")});A.__effects.push(w)}const a=So(t,s,o,!0,i);if(e!=null&&!(e&&e.__ref)){let y=e;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=it(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(r)?r:[r];y={...y,extends:[...b,...g]}}else y={...y,extends:r};const A=Ot(pt(t,"childProps"),pt(t,"content"));J(Tt(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},n=t.__ref&&t.__ref.__runtimeSource,c=n?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||G.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&Et(n,_)&&(c[b]||(c[b]={}),c[b][_]=n[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(G.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=it(t.childProps,g)),r&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(r)?r:[r];g={...g,extends:[...p,...w]}}else g={...g,extends:r};const b=n?Ot(pt(t,"childProps"),Ot(c[y]||null,pt(t,y))):null;J(Tt(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}Po();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&Eo()){const g=A+1;To(()=>h(g));return}};h(0),Oo()}function Ls(t,o,s){const{node:e}=t;if(!e)return;e.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const a=r.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const f=s.node.nextSibling;a.insertBefore(e,f||r)}else a.insertBefore(e,r);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(e,a):i.appendChild(e)}else i.appendChild(e)}const Co=3;function se(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Co?!1:(t.__inBeforeUpdate=!0,!0)}function Wt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Co&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Co}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function R(t,o,s){const e=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&q(e,o,s);const r="on"+t,i=o[r];if(typeof i=="function"){const n=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(n){if(o.__ref[n])return!0;o.__ref[n]=!0}const c=o.context?.designSystem;c&&L(c);let l=!!n;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&q("error",o,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{n&&d&&(d[n]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&q("error",o,{hook:r,error:u})||console.error(`[DOMQL] Lifecycle "${r}" error:`,u),o.context?.strictMode)throw u}finally{c&&D(),l&&o.__ref&&(o.__ref[n]=!1)}}return!0}var De=J;export{Co as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,se as acquireBeforeUpdateGuard,J as create,De as default,to as flushMounts,Oe as isStaticCssProp,Te as recompileStaticCss,Le as reconcileAttrProp,Wt as releaseBeforeUpdateGuard,lo as resolveStyleBlock,Ht as writeElementText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import*as s from"@symbo.ls/css";if(!s.CSS_SHORTHAND_LONGHANDS||!s.CSS_LONGHAND_SHORTHANDS)throw new Error("@symbo.ls/element: the installed @symbo.ls/css does not export CSS_SHORTHAND_LONGHANDS / CSS_LONGHAND_SHORTHANDS (the CSS shorthand family table, packages/css/src/cssLonghands.js). This element needs the @symbo.ls/css published in the same release \u2014 update @symbo.ls/css.");const S=s.CSS_SHORTHAND_LONGHANDS,e=s.CSS_LONGHAND_SHORTHANDS,t=s.cssShorthandStatesLonghand||(()=>!1);export{e as CSS_LONGHAND_SHORTHANDS,S as CSS_SHORTHAND_LONGHANDS,t as cssShorthandStatesLonghand};
|
package/dist/esm/src/delegate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DELEGATED_EVENTS as
|
|
1
|
+
import{DELEGATED_EVENTS as C,LIFECYCLE_EVENTS as A,PASSIVE_EVENTS as d,NON_BUBBLING_EVENTS as T}from"./registry.js";import{isLoudDevRuntime as V}from"./devRuntime.js";import{pushConfig as I,popConfig as h}from"@symbo.ls/scratch";const p=new WeakMap,Q={passive:!0},R={passive:!0,capture:!0},y=(e,t)=>d.has(e)?t?R:Q:t||!1;function w(e){let t=p.get(e);return t||(t={handlers:new Map,installed:new Set},p.set(e,t)),t}function x(e,t){const n=w(t);if(n.installed.has(e))return;n.installed.add(e);const r=e==="focus"||e==="blur"||e==="focusin"||e==="focusout"||e==="mouseenter"||e==="mouseleave"||e==="pointerenter"||e==="pointerleave",o=e==="mouseenter"||e==="mouseleave"||e==="pointerenter"||e==="pointerleave";t.addEventListener(e,i=>{if(o){const u=i.target,c=n.handlers.get(e),l=c&&u?c.get(u):null;if(!l||i.relatedTarget&&typeof u.contains=="function"&&u.contains(i.relatedTarget))return;l(i);return}let s=i.target;for(;s&&s!==t;){const u=n.handlers.get(e);if(u){const c=u.get(s);if(c&&(c(i),i.cancelBubble))return}s=s.parentNode}},y(e,r))}function B(e,t,n,r){r||(r=t.ownerDocument?.documentElement||t.getRootNode());const o=w(r);x(e,r),o.handlers.has(e)||o.handlers.set(e,new WeakMap),o.handlers.get(e).set(t,n)}function O(e,t,n){n||(n=t.ownerDocument?.documentElement||t.getRootNode());const r=p.get(n);if(!r)return;const o=r.handlers.get(e);o&&o.delete(t)}function q(e){return C.has(e)&&!A.has(e)}function v(e,t){const{context:n}=e,r=n?.designSystem;return o=>{r&&I(r);try{const i=t.call(e,o,e,e.state,n);if(i&&typeof i.then=="function"){i.catch(s=>{e.error=s,console.error("[DOMQL] Async event error:",s)}).finally(()=>{r&&h()});return}}catch(i){if(e.error=i,console.error("[DOMQL] Event error:",i),n?.strictMode)throw i}r&&h()}}const L=e=>!!e&&(e.capture===!0||typeof e.passive=="boolean"||e.once===!0);function G(e,t){return L(t)?{capture:t.capture===!0,passive:typeof t.passive=="boolean"?t.passive:d.has(e),once:t.once===!0}:y(e,!1)}function P(e,t,n){return r=>{let o=r.target;if(o&&o.nodeType!==1&&(o=o.parentElement),!o||typeof o.closest!="function")return;let i;try{i=o.closest(t)}catch{return}i&&e.contains(i)&&n(r)}}function Z(e,t,n,r){const{node:o,context:i}=t;if(!o)return;let s=v(t,n);const u=r&&typeof r.selector=="string"&&r.selector;u&&(s=P(o,u,s));const l=!T.has(e)&&q(e)&&!L(r),a=l?null:G(e,r);if(l){const f=i?.rootNode||o.ownerDocument?.documentElement;B(e,o,s,f)}else o.addEventListener(e,s,a);t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{if(l){const f=i?.rootNode||o.ownerDocument?.documentElement;O(e,o,f)}else o.removeEventListener(e,s,a)})}const g=[["onDocument","document"],["onWindow","window"],["onVisualViewport","visualViewport"],["onMediaQuery","mediaQuery"]];function J(e){if(typeof e!="string")return null;for(let t=0;t<g.length;t++){const n=g[t][0];if(e.length<=n.length||!e.startsWith(n))continue;const r=e.charCodeAt(n.length);if(!(r<65||r>90))return{target:g[t][1],eventName:e.slice(n.length).toLowerCase()}}return null}const W=/^[A-Za-z_$][\w$]*$/;function $(e,t,n){let r=t,o=!1,i,s=!1,u=null;if(t&&typeof t=="object"&&typeof t!="function"&&(r=t.handler,o=!!t.capture,s=!!t.once,typeof t.passive=="boolean"&&(i=t.passive),typeof t.query=="string"&&(u=t.query)),typeof r=="string"&&W.test(r)){const c=r;r=function(a){return e.call(c,a)}}return typeof r!="function"?null:(i===void 0&&(i=d.has(n)),{handler:r,capture:o,passive:i,once:s,query:u})}function U(e,t,n){const r=e.node?.ownerDocument||e.context?.document||(typeof document<"u"?document:null);if(!r||typeof r.addEventListener!="function")return null;if(t==="document")return r;const o=r.defaultView||(typeof window<"u"?window:null);if(!o)return null;if(t==="window")return typeof o.addEventListener=="function"?o:null;if(t==="visualViewport"){const i=o.visualViewport;return i&&typeof i.addEventListener=="function"?i:null}if(t==="mediaQuery"){const i=n&&n.query;if(typeof i!="string"||!i.trim()||typeof o.matchMedia!="function")return null;try{return o.matchMedia(i)||null}catch{return null}}return null}const E=/^@media\s+/i,F=/^[@[.#&:>*~+]/,b=new Set;function m(e,t){!V()||b.has(e)||(b.add(e),console.warn(`[smbls] onMediaQueryChange: "${e}" ${t} \u2014 no listener is registered.`))}function H(e,t){if(typeof t!="string")return null;const n=t.trim();if(!n)return null;const r=e.context?.designSystem?.media,o=s=>{const u=r&&typeof r=="object"?r[s]:void 0;return typeof u=="string"&&u.trim()?u.trim():null};let i=n;if(n.charCodeAt(0)===64&&!E.test(n)){if(i=o(n.slice(1)),!i)return m(n,"is not a key of designSystem.media"),null}else i=o(n)||n;return E.test(i)?i.replace(E,"").trim()||null:F.test(i)?(m(n,`names "${i}", which is not a media query`),null):i}function K(e,t,n,r){try{return e.addEventListener(t,n,r),!0}catch{return typeof e.addListener=="function"?(e.addListener(n),!0):!1}}function D(e,t,n,r){try{e.removeEventListener(t,n,r)}catch{typeof e.removeListener=="function"&&e.removeListener(n)}}function j(e){const t=e.node;if(!t)return!1;const n=t.nodeType===11?e.__ref?.__fragmentAnchor:t;return n?n.isConnected!==!1:!1}function N(e,t,n){if(t.__ref){if(Array.isArray(n)){if(e.target!=="mediaQuery")return;for(let o=0;o<n.length;o++)M(e,t,n[o]);return}M(e,t,n)}}function M(e,t,n){const r=t.__ref,o=$(t,n,e.eventName);if(!o||e.target==="mediaQuery"&&e.eventName!=="change"||e.target==="mediaQuery"&&(o.query=H(t,o.query),!o.query))return;const i=U(t,e.target,o);if(!i)return;const s=e.target+":"+(o.query?o.query+":":"")+e.eventName+":"+(o.capture?1:0);if(r.__globalEvents&&r.__globalEvents.has(s))return;const u=v(t,o.handler),c=e.target==="window"&&e.eventName==="load";let l=!1;const a=S=>{if(j(t)){if(c){if(l)return;l=!0}u(S)}},f={capture:o.capture,passive:o.passive,once:o.once};if(!K(i,e.eventName,a,f))return;r.__globalEvents||(r.__globalEvents=new Map);const _={target:i,eventName:e.eventName,listener:a,options:f};r.__globalEvents.set(s,_),r.__eventCleanup||(r.__eventCleanup=[]),r.__eventCleanup.push(()=>{D(i,e.eventName,a,f),r.__globalEvents&&r.__globalEvents.delete(s)}),c&&Y(t,s,_,()=>l)}function Y(e,t,n,r){const o=n.target.document;!o||o.readyState!=="complete"||queueMicrotask(()=>{const i=e.__ref;if(r()||!i||!i.__globalEvents||i.__globalEvents.get(t)!==n)return;const s=n.target,u=typeof s.Event=="function"?s.Event:typeof Event=="function"?Event:null;u&&(n.listener(new u("load")),n.options.once&&r()&&D(s,"load",n.listener,n.options))})}export{B as addDelegatedEvent,J as globalEventKeyInfo,q as isDelegatable,Z as registerEvent,N as registerGlobalEvent,O as removeDelegatedEvent};
|
package/dist/esm/src/dispose.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getObserver as c,setObserver as s}from"@symbo.ls/signal";function t(r){if(!r)return;const o=r.__ref;if(!o)return;const i=c();if(i){s(null);try{return t(r)}finally{s(i)}}o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(e){console.error("[smbls] onBeforeRemove error:",e)}if(o.__effects){for(let e=0;e<o.__effects.length;e++)o.__effects[e].dispose();o.__effects.length=0}if(typeof o.__releaseMedia=="function"&&(o.__releaseMedia(),o.__releaseMedia=null),o.__eventCleanup){for(let e=0;e<o.__eventCleanup.length;e++)o.__eventCleanup[e]();o.__eventCleanup.length=0}if(o.__children){const e=o.__children.slice();o.__children.length=0;for(let _=0;_<e.length;_++){const f=r[e[_]];f&&f.__ref&&t(f)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const n=r.state?.$destroy||r.state?.destroy;if(typeof n=="function"&&r.state.__element===r&&n.call(r.state),r.parent?.__ref?.__children){const e=r.parent.__ref.__children.indexOf(r.key);e!==-1&&r.parent.__ref.__children.splice(e,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(e){console.error("[smbls] onRemove error:",e)}r.node=null,r.parent=null,r.__ref=null}function
|
|
1
|
+
import{getObserver as c,setObserver as s}from"@symbo.ls/signal";import{destroyBridge as a}from"./bridge.js";function t(r){if(!r)return;const o=r.__ref;if(!o)return;const i=c();if(i){s(null);try{return t(r)}finally{s(i)}}o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(e){console.error("[smbls] onBeforeRemove error:",e)}if(o.__bridge&&a(r),o.__effects){for(let e=0;e<o.__effects.length;e++)o.__effects[e].dispose();o.__effects.length=0}if(typeof o.__releaseMedia=="function"&&(o.__releaseMedia(),o.__releaseMedia=null),o.__eventCleanup){for(let e=0;e<o.__eventCleanup.length;e++)o.__eventCleanup[e]();o.__eventCleanup.length=0}if(o.__children){const e=o.__children.slice();o.__children.length=0;for(let _=0;_<e.length;_++){const f=r[e[_]];f&&f.__ref&&t(f)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const n=r.state?.$destroy||r.state?.destroy;if(typeof n=="function"&&r.state.__element===r&&n.call(r.state),r.parent?.__ref?.__children){const e=r.parent.__ref.__children.indexOf(r.key);e!==-1&&r.parent.__ref.__children.splice(e,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(e){console.error("[smbls] onRemove error:",e)}r.node=null,r.parent=null,r.__ref=null}function l(){t(this)}export{t as dispose,l as remove};
|
package/dist/esm/src/extends.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const A=new WeakMap;function l(t){const r=[];return t.extends&&(Array.isArray(t.extends)?r.push(...t.extends):r.push(t.extends)),t.extend&&(Array.isArray(t.extend)?r.push(...t.extend):r.push(t.extend)),r}function h(t,r,e){const s=l(r);if(!s.length)return;const f=(t.context||e?.context||{}).components||{};for(let n=0;n<s.length;n++){const o=y(s[n],f);o&&o!==r&&p(t,o,e,new Set([r]))}}function y(t,r){if(typeof t=="string"){if(t.includes(">")){const e=t.split(">").map(c=>c.trim());let s=r[e[0]]||r[`smbls.${e[0]}`];for(let c=1;c<e.length&&s;c++)s=s[e[c]];return s||null}return r[t]||r[`smbls.${t}`]||null}return typeof t=="object"&&t!==null?t:null}function p(t,r,e,s=new Set){if(s.has(r))return;s.add(r);const c=l(r);if(c.length){const o=(t.context||e?.context||{}).components||{};for(let a=0;a<c.length;a++){const u=y(c[a],o);u&&p(t,u,e,s)}}const f=i(t);for(const n in r){if(n==="extends"||n==="extend")continue;const o=r[n];f&&f.set(n,f.rank),t[n]===void 0?o&&typeof o=="object"&&!Array.isArray(o)&&typeof o!="function"?t[n]={...o}:t[n]=o:typeof t[n]=="object"&&typeof o=="object"&&!Array.isArray(t[n])&&!Array.isArray(o)&&t[n]!==null&&o!==null?t[n]=x(t[n],o):t[n]=o}}function i(t){const r=t&&t.__ref;if(!r)return null;let e=r.__mergeLayer;return e||(e=r.__mergeLayer=new Map),e.rank=(e.rank||0)+1,e}function x(t,r){const e={...t};for(const s in r){const c=e[s],f=r[s];c&&f&&typeof c=="object"&&typeof f=="object"&&!Array.isArray(c)&&!Array.isArray(f)&&typeof c!="function"&&typeof f!="function"?e[s]=x(c,f):e[s]=f}return e}export{h as applyExtends,i as openMergeLayer};
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as
|
|
1
|
+
import{create as o,default as r,flushMounts as a}from"./create.js";import{update as E}from"./update.js";import{dispose as f,remove as n}from"./dispose.js";import{REGISTRY as m,LIFECYCLE_EVENTS as s,DELEGATED_EVENTS as x,NON_BUBBLING_EVENTS as g,MIXINS as i}from"./registry.js";import{addDelegatedEvent as T,removeDelegatedEvent as v,registerEvent as S,registerGlobalEvent as u,globalEventKeyInfo as G}from"./delegate.js";import{cacheNode as c,detectTag as h,createHTMLNode as L,isValidTag as V,isSvgTag as _,SVG_TAGS as D,adoptHydrationNode as M,elementPath as y}from"./cache.js";import{applyExtends as C}from"./extends.js";import{addMethods as b,refreshContextProto as A}from"./methods.js";import{inertOutsidePlugin as O}from"./inertOutside.js";export{x as DELEGATED_EVENTS,s as LIFECYCLE_EVENTS,i as MIXINS,g as NON_BUBBLING_EVENTS,m as REGISTRY,D as SVG_TAGS,T as addDelegatedEvent,b as addMethods,M as adoptHydrationNode,C as applyExtends,c as cacheNode,o as create,L as createHTMLNode,r as default,h as detectTag,f as dispose,y as elementPath,a as flushMounts,G as globalEventKeyInfo,O as inertOutsidePlugin,_ as isSvgTag,V as isValidTag,A as refreshContextProto,S as registerEvent,u as registerGlobalEvent,n as remove,v as removeDelegatedEvent,E as update};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createEffect as F,getObserver as M,setObserver as E}from"@symbo.ls/signal";const a="inertOutside",N=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),R='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',x={attributes:!0,attributeFilter:["inert"]},w=new WeakMap,g=new WeakMap,d=new Set,O=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){const t=M();t&&E(null);try{return e()}catch(n){console.error("[smbls] inertOutside:",n)}finally{t&&E(t)}}function _(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function P(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=w.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(s=>f(()=>b(t,s))),w.set(e,t),t)}function S(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function L(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const T=e=>!!(e.closest&&e.closest("[inert]"));function k(e){const t=e.ownerDocument,n=new Set,s=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;s.push(c);for(let l=c.firstElementChild;l;l=l.nextElementSibling)l!==o&&!N.has(l.tagName)&&n.add(l)}return{outside:n,parents:s}}function A(e,t){for(let n=0;n<t.length;n++){const{type:s,target:o}=t[n];s==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function b(e,t){const{doc:n,held:s,observer:o}=e;t&&A(e,t),A(e,o.takeRecords());const c=e.top,l=[];for(const r of e.layers){const y=S(r,n);y&&!r.live&&(l.push(r),r.returnFocus=L(n)),r.live=y}l.length&&(e.layers=e.layers.filter(r=>!l.includes(r)).concat(l));let i=null;for(let r=e.layers.length-1;r>=0&&!i;r--)e.layers[r].live&&(i=e.layers[r]);e.top=i;const{outside:p,parents:v}=i?k(i.element.node):{outside:new Set,parents:[]};for(const[r,y]of s)p.has(r)||(y&&r.removeAttribute("inert"),s.delete(r));for(const r of p)s.has(r)||s.set(r,!1),r.hasAttribute("inert")||(r.setAttribute("inert",""),s.set(r,!0));o.takeRecords(),o.disconnect();for(const r of v)o.observe(r,{childList:!0});for(const r of s.keys())o.observe(r,x);if(e.layers.some(r=>!r.live)?d.add(e):d.delete(e),i===c)return;const u=c&&!(c.declared&&c.live)?c:null;if(i&&l.includes(i))u&&u.returnFocus&&(i.returnFocus=u.returnFocus),_(()=>m(e,i));else if(u){const r=u.returnFocus;_(()=>D(e,u,r))}u&&(u.returnFocus=null)}function m(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const s=e.doc,o=s.activeElement;if(o&&n.contains(o))return;const c=new Set,l=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),s.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(l(i,!1))return;for(const i of n.querySelectorAll(R))if(l(i,!0))return;o&&o!==s.body&&typeof o.blur=="function"&&o.blur()}function D(e,t,n){if(t.declared&&t.live)return;const s=e.doc,o=s.activeElement,c=t.element.node;(!o||o===s.body||c&&c.contains(o)||T(o))&&(n&&n.isConnected&&n.ownerDocument===s&&!T(n)&&(n.focus({preventScroll:!0}),s.activeElement===n)||e.top&&m(e,e.top))}function h(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const s=n.layers.indexOf(e);s!==-1&&n.layers.splice(s,1)}b(n)}function C(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function I(e){let t=g.get(e);if(t)return t;const n=e.__ref,s=e.node;if(!n||!s||s.nodeType!==1)return null;const o=P(s.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},g.set(e,t);const c=F(()=>{const l=C(e);f(()=>h(t,l))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>h(t,!1))),t}function q(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&S(t,e.doc))&&b(e)}}const B={name:a,create(e){O(e,a)&&f(()=>I(e))},render(){d.size&&f(q)},update(e){O(e,a)&&f(()=>{const t=I(e);t&&h(t,C(e))})}};export{B as inertOutsidePlugin};
|
package/dist/esm/src/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
|
|
1
|
+
const e=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","vars","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","srcObject","allowRuntimeTemplates","__name","__ref","__hash","__text","parent","node"]),t={text:"text",html:"html",style:"style",attr:"attr",data:"data",classlist:"classlist",state:"state",scope:"scope"},o=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove","bridgeMount","bridgeUpdate","bridgeDestroy"]),a=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),r=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),s=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);export{s as DELEGATED_EVENTS,o as LIFECYCLE_EVENTS,t as MIXINS,a as NON_BUBBLING_EVENTS,r as PASSIVE_EVENTS,e as REGISTRY};
|
package/dist/esm/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as
|
|
1
|
+
import{batch as _,isStore as v}from"@symbo.ls/signal";import{REGISTRY as p}from"./registry.js";import{create as x,resolveStyleBlock as b,acquireBeforeUpdateGuard as g,releaseBeforeUpdateGuard as l,writeElementText as A,reconcileAttrProp as P,isStaticCssProp as j,recompileStaticCss as U}from"./create.js";import{runPluginHook as u}from"@symbo.ls/utils/function.js";import{serializeAttrValue as B,isEnumeratedTrueFalseAttr as S}from"attrs-in-props";function k(o={},f={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof e.onBeforeUpdate=="function"&&g(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,f);if(t&&typeof t.then=="function")t.then(()=>l(i,!1),n=>{l(i,!0),e.context?.plugins?.length&&u("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),t===!1)return e}catch(t){throw l(i,!0),t}const a=!o||Object.keys(o).length===0,s=[];let d=!1;_(()=>{if(o.state&&v(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&A(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style){const t=b(e,o.style);for(const n in t){const r=t[n];if(r==null)continue;const c=n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),y=String(r).replace(/\s*!important\s*$/,"");e.node.style.setProperty(c,y,"important")}}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t];n==null||n===!1&&!S(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,B(t,n))}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const t=e.vars&&typeof e.vars=="object"&&!Array.isArray(e.vars)?e.vars:null;e.vars={...t,...o.vars},d=!0}for(const t in o){if(p.has(t)||t==="state")continue;const n=o[t],r=e[t];if(r&&r.__ref&&typeof r.update=="function")r.update(n,f);else if(typeof n=="object"&&n!==null){const c=t.charCodeAt(0);c>=65&&c<=90&&x(n,e,t,f)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&s.push(t))}});for(let t=0;t<s.length;t++)P(e,s[t]);if(e.node){let t=d;for(let n=0;!t&&n<s.length;n++)j(s[n])&&(t=!0);t&&U(e)}if(e.node&&a&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return u("update",e),!f.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,f),e}var w=k;export{w as default,k as update};
|
package/dist/esm/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="3.14.
|
|
1
|
+
const o="3.14.800";export{o as VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/element",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.800",
|
|
4
4
|
"description": "Core element creation, update, and disposal engine for smbls v3.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@symbo.ls/css": "^3.14.
|
|
24
|
-
"@symbo.ls/scratch": "^3.14.
|
|
25
|
-
"@symbo.ls/signal": "^3.14.
|
|
26
|
-
"@symbo.ls/state": "^3.14.
|
|
27
|
-
"@symbo.ls/utils": "^3.14.
|
|
28
|
-
"css-in-props": "^3.14.
|
|
29
|
-
"attrs-in-props": "^3.14.
|
|
23
|
+
"@symbo.ls/css": "^3.14.775",
|
|
24
|
+
"@symbo.ls/scratch": "^3.14.786",
|
|
25
|
+
"@symbo.ls/signal": "^3.14.786",
|
|
26
|
+
"@symbo.ls/state": "^3.14.681",
|
|
27
|
+
"@symbo.ls/utils": "^3.14.784",
|
|
28
|
+
"css-in-props": "^3.14.761",
|
|
29
|
+
"attrs-in-props": "^3.14.694"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|