From 96b0dfa995cb5e527b24992adf171630ed3d6506 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 13:39:31 +0000 Subject: [PATCH 01/20] fix(color-model): filter -dark source tokens consistently across Bricks/Gutenberg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PL-013/PL-014: classifyVar()/classify_color() exist in three near-identical implementations (Bricks JS, Gutenberg JS, Gutenberg PHP) that had silently drifted — only Gutenberg's JS correctly filtered both the `-light` and `-dark` source-duplicate suffixes; Bricks' JS and Gutenberg's PHP only filtered `-light`, so Bricks' color picker rendered a spurious duplicate swatch for every `-dark` token that Gutenberg correctly hid. Fixed both to match Gutenberg JS's already-correct behavior. Also ported Gutenberg filterModel's missing Array.isArray(group.sections)/Array.isArray(section .swatches) defensive guards into Bricks, which never had them. PL-015: added tests/color-model-cross-impl.test.js, a parametrized regression test running a shared fixture list against all three implementations to guarantee they can't silently re-diverge. The PHP side is exercised via tests/php-harness/classify-color.php, a small reflection- based harness (classify_color() is private and reads no instance state, so newInstanceWithoutConstructor() avoids needing a WordPress bootstrap) shelled out to via execFileSync, matching the plugin's existing lint-php.js convention. Left a TODO to migrate this into the PHPUnit suite once PR-A3 (Brain Monkey scaffold) lands, per the remediation plan. Rebuilt SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js to include the source fix, matching this repo's existing built-asset commit convention. Verified: node --test tests/*.test.js (95/95, including the new 28-case cross-impl suite — confirmed it catches the original bug by temporarily reverting the Bricks fix and observing exactly the 4 expected subtest failures), php -l via npm run lint:php, npm run verify, and a full build:editor-app rebuild. composer phpstan/phpcs could not be run in this sandbox — composer install fails on all dev dependencies with "Could not authenticate against github.com" for both dist and source fallback downloads, a pre-existing environment network limitation unrelated to this change. --- .../bricks/assets/editor-app/app.js | 4 +- .../bricks/editor-app/src/lib/color-model.js | 8 +- .../gutenberg/includes/class-presets.php | 6 +- tests/color-model-cross-impl.test.js | 95 +++++++++++++++++++ tests/php-harness/classify-color.php | 42 ++++++++ 5 files changed, 148 insertions(+), 7 deletions(-) create mode 100644 tests/color-model-cross-impl.test.js create mode 100644 tests/php-harness/classify-color.php diff --git a/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js b/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js index 7430f39b..307cbd9e 100644 --- a/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js +++ b/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js @@ -1,7 +1,7 @@ -var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function m(e){"@babel/helpers - typeof";return m=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m(e)}function h(e,t){if(m(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(m(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return m(t)==`symbol`?t:t+``}function _(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=1024,y=2048,b=4096,x=8192,S=16384,ee=32768,te=1<<25,ne=65536,C=1<<19,re=1<<20,ie=1<<25,ae=65536,oe=1<<21,se=1<<22,ce=1<<23,le=Symbol(`$state`),ue=Symbol(`legacy props`),de=Symbol(``),fe=Symbol(`attributes`),pe=Symbol(`class`),me=Symbol(`style`),he=Symbol(`text`),ge=Symbol(`form reset`),_e=new class extends Error{constructor(...e){super(...e),_(this,`name`,`StaleReactionError`),_(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},ve=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ye(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function be(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function xe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Se(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ce(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function we(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Te(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function De(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Oe(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function ke(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ae(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var je={},w=Symbol(`uninitialized`);function Me(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ne(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Pe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Fe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function Ie(e){T=e}var E;function Le(e){if(e===null)throw Ne(),je;return E=e}function Re(){return Le(ur(E))}function D(e){if(T){if(ur(E)!==null)throw Ne(),je;E=e}}function ze(e=1){if(T){for(var t=e,n=E;t--;)n=ur(n);E=n}}function Be(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ur(n);e&&n.remove(),n=i}}function Ve(e){if(!e||e.nodeType!==8)throw Ne(),je;return e.data}function He(e){return e===this.v}function Ue(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function We(e){return!Ue(e,this.v)}var Ge=!1,Ke=!1,O=null;function qe(e){O=e}function Je(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:G,l:Ke&&!t?{s:null,u:null,$:[]}:null}}function Ye(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)Tr(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,e??{}}function Xe(){return!Ke||O!==null&&O.l===null}var Ze=[];function Qe(){var e=Ze;Ze=[],f(e)}function $e(e){if(Ze.length===0&&!on){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}function tt(e){var t=G;if(t===null)return W.f|=ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;nt(e,t)}function nt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var rt=~(y|b|v);function k(e,t){e.f=e.f&rt|t}function it(e){e.f&512||e.deps===null?k(e,v):k(e,b)}function at(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ae,at(t.deps))}function ot(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),at(e.deps),k(e,v)}var st=!1,ct=!1;function lt(e){var t=ct;try{return ct=!1,[e(),ct]}finally{ct=t}}function ut(e){let t=0,n=Jn(0),r;return()=>{Sr()&&(K(n),kr(()=>(t===0&&(r=gi(()=>e(()=>Qn(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,Qn(n))})})))}}function dt(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function ft(e,t){dt(e,t),t.add(e)}function A(e,t,n){dt(e,t),t.set(e,n)}function j(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function M(e,t,n){return e.set(j(e,t),n),n}function N(e,t){return e.get(j(e,t))}var pt=ne|C;function mt(e,t,n,r){new jt(e,t,n,r)}var ht=new WeakMap,gt=new WeakMap,_t=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,xt=new WeakMap,St=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Tt=new WeakMap,Et=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,At=new WeakMap,P=new WeakSet,jt=class{constructor(e,t,n,r){ft(this,P),_(this,`parent`,void 0),_(this,`is_pending`,!1),_(this,`transform_error`,void 0),A(this,ht,void 0),A(this,gt,T?E:null),A(this,_t,void 0),A(this,vt,void 0),A(this,yt,void 0),A(this,bt,null),A(this,xt,null),A(this,St,null),A(this,Ct,null),A(this,wt,0),A(this,Tt,0),A(this,Et,!1),A(this,Dt,new Set),A(this,Ot,new Set),A(this,kt,null),A(this,At,ut(()=>(M(kt,this,Jn(N(wt,this))),()=>{M(kt,this,null)}))),M(ht,this,e),M(_t,this,t),M(vt,this,e=>{var t=G;t.b=this,t.f|=128,n(e)}),this.parent=G.b,this.transform_error=r??this.parent?.transform_error??(e=>e),M(yt,this,Ar(()=>{if(T){let e=N(gt,this);Re();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));j(P,this,Nt).call(this,t)}else t?j(P,this,Pt).call(this):j(P,this,Mt).call(this)}else j(P,this,Ft).call(this)},pt)),T&&M(ht,this,E)}defer_effect(e){ot(e,N(Dt,this),N(Ot,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!N(_t,this).pending}update_pending_count(e,t){j(P,this,Rt).call(this,e,t),M(wt,this,N(wt,this)+e),!(!N(kt,this)||N(Et,this))&&(M(Et,this,!0),$e(()=>{M(Et,this,!1),N(kt,this)&&Xn(N(kt,this),N(wt,this))}))}get_effect_pending(){return N(At,this).call(this),K(N(kt,this))}error(e){if(!N(_t,this).onerror&&!N(_t,this).failed)throw e;I?.is_fork?(N(bt,this)&&I.skip_effect(N(bt,this)),N(xt,this)&&I.skip_effect(N(xt,this)),N(St,this)&&I.skip_effect(N(St,this)),I.oncommit(()=>{j(P,this,zt).call(this,e)})):j(P,this,zt).call(this,e)}};function Mt(){try{M(bt,this,jr(()=>N(vt,this).call(this,N(ht,this))))}catch(e){this.error(e)}}function Nt(e){let t=N(_t,this).failed;t&&M(St,this,jr(()=>{t(N(ht,this),()=>e,()=>()=>{})}))}function Pt(){let e=N(_t,this).pending;e&&(this.is_pending=!0,M(xt,this,jr(()=>e(N(ht,this)))),$e(()=>{var e=M(Ct,this,document.createDocumentFragment()),t=cr();e.append(t),M(bt,this,j(P,this,Lt).call(this,()=>jr(()=>N(vt,this).call(this,t)))),N(Tt,this)===0&&(N(ht,this).before(e),M(Ct,this,null),Rr(N(xt,this),()=>{M(xt,this,null)}),j(P,this,It).call(this,I))}))}function Ft(){try{if(this.is_pending=this.has_pending_snippet(),M(Tt,this,0),M(wt,this,0),M(bt,this,jr(()=>{N(vt,this).call(this,N(ht,this))})),N(Tt,this)>0){var e=M(Ct,this,document.createDocumentFragment());Hr(N(bt,this),e);let t=N(_t,this).pending;M(xt,this,jr(()=>t(N(ht,this))))}else j(P,this,It).call(this,I)}catch(e){this.error(e)}}function It(e){this.is_pending=!1,e.transfer_effects(N(Dt,this),N(Ot,this))}function Lt(e){var t=G,n=W,r=O;Yr(N(yt,this)),Jr(N(yt,this)),qe(N(yt,this).ctx);try{return Dn.ensure(),e()}catch(e){return tt(e),null}finally{Yr(t),Jr(n),qe(r)}}function Rt(e,t){if(!this.has_pending_snippet()){if(this.parent){var n;j(P,n=this.parent,Rt).call(n,e,t)}return}M(Tt,this,N(Tt,this)+e),N(Tt,this)===0&&(j(P,this,It).call(this,t),N(xt,this)&&Rr(N(xt,this),()=>{M(xt,this,null)}),N(Ct,this)&&(N(ht,this).before(N(Ct,this)),M(Ct,this,null)))}function zt(e){N(bt,this)&&(Fr(N(bt,this)),M(bt,this,null)),N(xt,this)&&(Fr(N(xt,this)),M(xt,this,null)),N(St,this)&&(Fr(N(St,this)),M(St,this,null)),T&&(Le(N(gt,this)),ze(),Le(Be()));var t=N(_t,this).onerror;let n=N(_t,this).failed;var r=!1,i=!1;let a=()=>{if(r){Fe();return}r=!0,i&&Ae(),N(St,this)!==null&&Rr(N(St,this),()=>{M(St,this,null)}),j(P,this,Lt).call(this,()=>{j(P,this,Ft).call(this)})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){nt(e,N(yt,this)&&N(yt,this).parent)}n&&M(St,this,j(P,this,Lt).call(this,()=>{try{return jr(()=>{var t=G;t.b=this,t.f|=128,n(N(ht,this),()=>e,()=>a)})}catch(e){return nt(e,N(yt,this).parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){nt(e,N(yt,this)&&N(yt,this).parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>nt(e,N(yt,this)&&N(yt,this).parent)):o(t)})}function Bt(e,t,n,r){let i=Xe()?Wt:qt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=G,c=Vt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){nt(e,s)}Ht()}}var d=Ut();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Kt(e))).then(u).catch(e=>nt(e,s)).finally(d)}l?l.then(()=>{c(),f(),Ht()}):f()}function Vt(){var e=G,t=W,n=O,r=I;return function(i=!0){Yr(e),Jr(t),qe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ht(e=!0){Yr(null),Jr(null),qe(null),e&&I?.deactivate()}function Ut(){var e=G,t=e.b,n=I,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Wt(e){var t=2|y;return G!==null&&(G.f|=C),{ctx:O,deps:null,effects:null,equals:He,f:t,fn:e,reactions:null,rv:0,v:w,wv:0,parent:G,ac:null}}var Gt=Symbol(`obsolete`);function Kt(e,t,n){let r=G;r===null&&be();var i=void 0,a=Jn(w),o=!W,s=new Set;return Or(()=>{var t=G,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==_e&&n.reject(e)}).finally(Ht)}catch(e){n.reject(e),Ht()}var c=I;if(o){if(t.f&32768)var l=Ut();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Gt);else for(let e of s.values())e.reject(Gt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Gt&&(c.activate(),t?(a.f|=ce,Xn(a,t)):(a.f&8388608&&(a.f^=ce),Xn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Cr(()=>{for(let e of s)e.reject(Gt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function F(e){let t=Wt(e);return Ge||Zr(t),t}function qt(e){let t=Wt(e);return t.equals=We,t}function Jt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nthis.schedule(e)){var n=N(wn,this).get(e);if(n){N(wn,this).delete(e);for(var r of n.d)k(r,y),t(r);for(r of n.m)k(r,b),t(r)}N(Tn,this).add(e)}capture(e,t,n=!1){e.v!==w&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),rn?.set(e,t)),this.is_fork||(e.v=t)}activate(){I=this}deactivate(){I=null,rn=null}flush(){try{sn=!0,I=this,j(L,this,kn).call(this)}finally{un=0,an=null,cn=null,ln=null,sn=!1,I=null,rn=null,Kn.clear()}}discard(){for(let e of N(gn,this))e(this);N(gn,this).clear();for(let e of this.async_deriveds.values())e.reject(Gt);j(L,this,Fn).call(this),N(yn,this)?.resolve()}register_created_effect(e){N(xn,this).push(e)}increment(e,t){if(M(_n,this,N(_n,this)+1),e){let e=N(vn,this).get(t)??0;N(vn,this).set(t,e+1)}}decrement(e,t){if(M(_n,this,N(_n,this)-1),e){let e=N(vn,this).get(t)??0;e===1?N(vn,this).delete(t):N(vn,this).set(t,e-1)}N(En,this)||(M(En,this,!0),$e(()=>{M(En,this,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)N(Sn,this).add(t);for(let e of t)N(Cn,this).add(e);e.clear(),t.clear()}oncommit(e){N(hn,this).add(e)}ondiscard(e){N(gn,this).add(e)}settled(){return(N(yn,this)??M(yn,this,p())).promise}static ensure(){if(I===null){let t=I=new e;!sn&&!on&&$e(()=>{N(fn,t)||t.flush()})}return I}apply(){if(!Ge||!this.is_fork&&N(pn,this)===null&&N(mn,this)===null){rn=null;return}rn=new Map;for(let[e,[t]]of this.current)rn.set(e,t);for(let t=en;t!==null;t=N(mn,t))if(!(t===this||t.is_fork)){var e=!1;if(t.id1e3&&(j(L,this,Fn).call(this),Ln());for(let e of N(Sn,this))N(Cn,this).delete(e),k(e,y),this.schedule(e);for(let e of N(Cn,this))k(e,b),this.schedule(e);let e=N(bn,this);M(bn,this,[]),this.apply();var t=cn=[],n=[],r=ln=[];for(let r of e)try{j(L,this,An).call(this,r,t,n)}catch(e){throw Wn(r),j(L,this,On).call(this)||this.discard(),e}if(I=null,r.length>0){var i=$t.ensure();for(let e of r)i.schedule(e)}if(cn=null,ln=null,j(L,this,On).call(this)){j(L,this,Nn).call(this,n),j(L,this,Nn).call(this,t);for(let[e,t]of N(wn,this))Un(e,t);r.length>0&&j(L,I,kn).call(I);return}let a=j(L,this,jn).call(this);if(a){j(L,this,Nn).call(this,n),j(L,this,Nn).call(this,t),j(L,a,Mn).call(a,this);return}N(Sn,this).clear(),N(Cn,this).clear();for(let e of N(hn,this))e(this);N(hn,this).clear(),nn=this,zn(n),zn(t),nn=null,N(yn,this)?.resolve();var o=I;if(N(_n,this)===0&&(N(bn,this).length===0||o!==null)&&(j(L,this,Fn).call(this),Ge&&(j(L,this,Pn).call(this),I=o)),N(bn,this).length>0)if(o!==null){let e=o;N(bn,e).push(...N(bn,this).filter(t=>!N(bn,e).includes(t)))}else o=this;o!==null&&j(L,o,kn).call(o)}function An(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||N(wn,this).has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):Ge&&i&16777224?n.push(r):si(r)&&(i&16&&N(Cn,this).add(r),fi(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}function jn(){for(var e=N(pn,this);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=N(pn,e)}return null}function Mn(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(N(Sn,e),N(Cn,e));let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(N(Cn,this).delete(i),k(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),j(L,e,Fn).call(e),I=this,j(L,this,kn).call(this)}function Nn(e){for(var t=0;t!u.current.get(e)[1]);if(!(!N(fn,u)||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of N(Tn,this))u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):j(L,u,Nn).call(u,[e])});u.activate();var a=new Set,o=new Map;for(var s of t)Bn(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of N(xn,this))!(e.f&155648)&&Vn(e,c,o)&&(e.f&4194320?(k(e,y),u.schedule(e)):N(Sn,u).add(e));if(N(bn,u).length>0&&!N(En,u)){u.apply();for(var l of N(bn,u))j(L,u,An).call(u,l,[],[]);M(bn,u,[])}u.deactivate()}}}}function Fn(){if(this.linked){var e=N(pn,this),t=N(mn,this);e===null?en=t:M(mn,e,t),t===null?tn=e:M(pn,t,e),this.linked=!1}}function In(e){var t=on;on=!0;try{var n;for(e&&(I!==null&&!I.is_fork&&I.flush(),n=e());;){if(et(),I===null)return n;I.flush()}}finally{on=t}}function Ln(){try{Te()}catch(e){nt(e,an)}}var Rn=null;function zn(e){var t=e.length;if(t!==0){for(var n=0;n0)){Kn.clear();for(let e of Rn){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Rn.has(n)&&(Rn.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||fi(n)}}Rn.clear()}}Rn=null}}function Bn(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Bn(i,t,n,r):e&4194320&&!(e&2048)&&Vn(i,t,r)&&(k(i,y),Hn(i))}}function Vn(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&Vn(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Hn(e){I.schedule(e)}function Un(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,v);for(var n=e.first;n!==null;)Un(n,t),n=n.next}}function Wn(e){k(e,v);for(var t=e.first;t!==null;)Wn(t),t=t.next}var Gn=new Set,Kn=new Map,qn=!1;function Jn(e,t){return{f:0,v:e,reactions:null,equals:He,rv:0,wv:0}}function R(e,t){let n=Jn(e,t);return Zr(n),n}function Yn(e,t=!1,n=!0){let r=Jn(e);if(t||(r.equals=We),Ke&&n&&O!==null&&O.l!==null){var i;((i=O.l).s??(i.s=[])).push(r)}return r}function z(e,t,n=!1){return W!==null&&(!qr||W.f&131072)&&Xe()&&W.f&4325394&&(Xr===null||!Xr.has(e))&&ke(),Xn(e,n?er(t):t,ln)}function Xn(e,t,n=null){if(!e.equals(t)){Kn.set(e,Gr?t:e.v);var r=Dn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Yt(t),rn===null&&it(t)}e.wv=oi(),$n(e,y,n),Xe()&&G!==null&&G.f&1024&&!(G.f&96)&&(ei===null?ti([e]):ei.push(e)),!r.is_fork&&Gn.size>0&&!qn&&Zn()}return t}function Zn(){qn=!1;for(let e of Gn){e.f&1024&&k(e,b);let t;try{t=si(e)}catch{t=!0}t&&fi(e)}Gn.clear()}function Qn(e){z(e,e.v+1)}function $n(e,t,n){var r=e.reactions;if(r!==null)for(var i=Xe(),a=r.length,o=0;o{if(ii===d)return e();var t=W,n=ii;Jr(null),ai(d);var r=e();return Jr(t),ai(n),r};return i&&r.set(`length`,R(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&De();var i=r.get(t);return i===void 0?f(()=>{var e=R(n.value,u);return r.set(t,e),e}):z(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>R(w,u));r.set(t,e),Qn(o)}}else z(n,w),Qn(o);return!0},get(e,n,i){if(n===le)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>R(er(s?e[n]:w),u)),r.set(n,o)),o!==void 0){var c=K(o);return c===w?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=K(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==w)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===le)return!0;var n=r.get(t),i=n!==void 0&&n.v!==w||Reflect.has(e,t);return(n!==void 0||G!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>R(i?er(e[t]):w,u)),r.set(t,n)),K(n)===w)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;dR(w,u)),r.set(d+``,p)):z(p,w)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>R(void 0,u)),z(c,er(n)),r.set(t,c));else{l=c.v!==w;var m=f(()=>er(n));z(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&z(g,_+1)}Qn(o)}return!0},ownKeys(e){K(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==w});for(var[n,i]of r)i.v!==w&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Oe()}})}function tr(e){try{if(typeof e==`object`&&e&&le in e)return e[le]}catch{}return e}function nr(e,t){return Object.is(tr(e),tr(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var rr,ir,ar,or;function sr(){if(rr===void 0){rr=window,ir=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ar=a(t,`firstChild`).get,or=a(t,`nextSibling`).get,u(e)&&(e[pe]=void 0,e[fe]=null,e[me]=void 0,e.__e=void 0),u(n)&&(n[he]=void 0)}}function cr(e=``){return document.createTextNode(e)}function lr(e){return ar.call(e)}function ur(e){return or.call(e)}function B(e,t){if(!T)return lr(e);var n=lr(E);if(n===null)n=E.appendChild(cr());else if(t&&n.nodeType!==3){var r=cr();return n?.before(r),Le(r),r}return t&&mr(n),Le(n),n}function V(e,t=!1){if(!T){var n=lr(e);return n instanceof Comment&&n.data===``?ur(n):n}if(t){if(E?.nodeType!==3){var r=cr();return E?.before(r),Le(r),r}mr(E)}return E}function H(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=ur(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=cr();return r===null?i?.after(a):r.before(a),Le(a),a}mr(r)}return Le(r),r}function dr(e){e.textContent=``}function fr(){return!Ge||Rn!==null?!1:(G.f&ee)!==0}function pr(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function mr(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var hr=!1;function gr(){hr||(hr=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ge]?.()})},{capture:!0}))}function _r(e){var t=W,n=G;Jr(null),Yr(null);try{return e()}finally{Jr(t),Yr(n)}}function vr(e,t,n,r=n){e.addEventListener(t,()=>_r(n));let i=e[ge];i?e[ge]=()=>{i(),r(!0)}:e[ge]=()=>r(!0),gr()}function yr(e){G===null&&(W===null&&we(e),Ce()),Gr&&Se(e)}function br(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function xr(e,t){var n=G;n!==null&&n.f&8192&&(e|=x);var r={ctx:O,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};I?.register_created_effect(r);var i=r;if(e&4)cn===null?Dn.ensure().schedule(r):cn.push(r);else if(t!==null){try{fi(r)}catch(e){throw Fr(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&br(i,n),W!==null&&W.f&2&&!(e&64))){var a=W;(a.effects??(a.effects=[])).push(i)}return r}function Sr(){return W!==null&&!qr}function Cr(e){let t=xr(8,null);return k(t,v),t.teardown=e,t}function wr(e){yr(`$effect`);var t=G.f;if(!W&&t&32&&O!==null&&!O.i){var n=O;(n.e??(n.e=[])).push(e)}else return Tr(e)}function Tr(e){return xr(4|re,e)}function Er(e){Dn.ensure();let t=xr(64|C,e);return(e={})=>new Promise(n=>{e.outro?Rr(t,()=>{Fr(t),n(void 0)}):(Fr(t),n(void 0))})}function Dr(e){return xr(4,e)}function Or(e){return xr(se|C,e)}function kr(e,t=0){return xr(8|t,e)}function U(e,t=[],n=[],r=[]){Bt(r,t,n,t=>{xr(8,()=>{e(...t.map(K))})})}function Ar(e,t=0){return xr(16|t,e)}function jr(e){return xr(32|C,e)}function Mr(e){var t=e.teardown;if(t!==null){let e=Gr,n=W;Kr(!0),Jr(null);try{t.call(null)}finally{Kr(e),Jr(n)}}}function Nr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&_r(()=>{e.abort(_e)});var r=n.next;n.f&64?n.parent=null:Fr(n,t),n=r}}function Pr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Fr(t),t=n}}function Fr(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ir(e.nodes.start,e.nodes.end),n=!0),e.f|=te,Nr(e,t&&!n),di(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Mr(e),e.f^=te,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&Lr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ir(e,t){for(;e!==null;){var n=e===t?null:ur(e);e.remove(),e=n}}function Lr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Rr(e,t,n=!0){var r=[];zr(e,r,!0);var i=()=>{n&&Fr(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function zr(e,t,n){if(!(e.f&8192)){e.f^=x;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;zr(i,t,o?n:!1)}i=a}}}function Br(e){Vr(e,!0)}function Vr(e,t){if(e.f&8192){e.f^=x,e.f&1024||(k(e,y),Dn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Vr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Hr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ur(n);t.append(n),n=i}}var Ur=null,Wr=!1,Gr=!1;function Kr(e){Gr=e}var W=null,qr=!1;function Jr(e){W=e}var G=null;function Yr(e){G=e}var Xr=null;function Zr(e){W!==null&&(!Ge||W.f&2)&&(Xr??(Xr=new Set)).add(e)}var Qr=null,$r=0,ei=null;function ti(e){ei=e}var ni=1,ri=0,ii=ri;function ai(e){ii=e}function oi(){return++ni}function si(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ae),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&rn===null&&k(e,v)}return!1}function ci(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ge&&Xr!==null&&Xr.has(e)))for(var i=0;i{e.ac.abort(_e)}),e.ac=null);try{e.f|=oe;var u=e.fn,d=u();e.f|=ee;var f=e.deps,p=I?.is_fork;if(Qr!==null){var m;if(p||di(e,$r),f!==null&&$r>0)for(f.length=$r+Qr.length,m=0;m{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),In()}function K(e){var t=(e.f&2)!=0;if(Ur?.add(e),W!==null&&!qr&&!(G!==null&&G.f&16384)&&(Xr===null||!Xr.has(e))){var r=W.deps;if(W.f&2097152)e.rvn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Ci(e,t,n,r,i){var a={capture:r,passive:i},o=Si(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Cr(()=>{t.removeEventListener(e,o,a)})}function q(e,t,n){(t[yi]??(t[yi]={}))[e]=n}function wi(e){for(var t=0;t{throw e});throw p}}finally{e[yi]=t,delete e.currentTarget,Jr(d),Yr(f)}}}var Di=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Oi(e){return Di?.createHTML(e)??e}function ki(e){var t=pr(`template`);return t.innerHTML=Oi(e.replaceAll(``,``)),t.content}function Ai(e,t){var n=G;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function J(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(``);return()=>{if(T)return Ai(E,null),E;i===void 0&&(i=ki(a?e:``+e),n||(i=lr(i)));var t=r||ir?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=lr(t),s=t.lastChild;Ai(o,s)}else Ai(t,t);return t}}function ji(e=``){if(!T){var t=cr(e+``);return Ai(t,t),t}var n=E;return n.nodeType===3?mr(n):(n.before(n=cr()),Le(n)),Ai(n,n),n}function Mi(){if(T)return Ai(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(``),n=cr();return e.append(t,n),Ai(t,n),e}function Y(e,t){if(T){var n=G;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),Re();return}e!==null&&e.before(t)}function X(e,t){var n,r=t==null?``:typeof t==`object`?`${t}`:t;r!==((n=e)[he]??(n[he]=e.nodeValue))&&(e[he]=r,e.nodeValue=`${r}`)}function Ni(e,t){return Fi(e,t)}var Pi=new Map;function Fi(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){sr();var l=void 0,u=Er(()=>{var s=n??t.appendChild(cr());mt(s,{pending:()=>{}},t=>{Je({});var n=O;if(o&&(n.c=o),a&&(i.$$events=a),T&&Ai(t,null),l=e(t,i)||{},T&&(G.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw Ne(),je;Ye()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=Pi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ei),r.delete(e),r.size===0&&Pi.delete(n)):r.set(e,i)}xi.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Ii.set(l,u),l}var Ii=new WeakMap;function Li(e,t){let n=Ii.get(e);return n?(Ii.delete(e),n(t)):Promise.resolve()}var Ri=new WeakMap,zi=new WeakMap,Bi=new WeakMap,Vi=new WeakMap,Hi=new WeakMap,Ui=new WeakMap,Wi=new WeakMap,Gi=class{constructor(e,t=!0){_(this,`anchor`,void 0),A(this,Ri,new Map),A(this,zi,new Map),A(this,Bi,new Map),A(this,Vi,new Set),A(this,Hi,!0),A(this,Ui,e=>{if(N(Ri,this).has(e)){var t=N(Ri,this).get(e),n=N(zi,this).get(t);if(n)Br(n),N(Vi,this).delete(t);else{var r=N(Bi,this).get(t);r&&(Br(r.effect),N(zi,this).set(t,r.effect),N(Bi,this).delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of N(Ri,this)){if(N(Ri,this).delete(t),t===e)break;let r=N(Bi,this).get(n);r&&(Fr(r.effect),N(Bi,this).delete(n))}for(let[e,r]of N(zi,this)){if(e===t||N(Vi,this).has(e))continue;let i=()=>{if(Array.from(N(Ri,this).values()).includes(e)){var t=document.createDocumentFragment();Hr(r,t),t.append(cr()),N(Bi,this).set(e,{effect:r,fragment:t})}else Fr(r);N(Vi,this).delete(e),N(zi,this).delete(e)};N(Hi,this)||!n?(N(Vi,this).add(e),Rr(r,i,!1)):i()}}}),A(this,Wi,e=>{N(Ri,this).delete(e);let t=Array.from(N(Ri,this).values());for(let[e,n]of N(Bi,this))t.includes(e)||(Fr(n.effect),N(Bi,this).delete(e))}),this.anchor=e,M(Hi,this,t)}ensure(e,t){var n=I,r=fr();if(t&&!N(zi,this).has(e)&&!N(Bi,this).has(e))if(r){var i=document.createDocumentFragment(),a=cr();i.append(a),N(Bi,this).set(e,{effect:jr(()=>t(a)),fragment:i})}else N(zi,this).set(e,jr(()=>t(this.anchor)));if(N(Ri,this).set(n,e),r){for(let[t,r]of N(zi,this))t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of N(Bi,this))t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(N(Ui,this)),n.ondiscard(N(Wi,this))}else T&&(this.anchor=E),N(Ui,this).call(this,n)}};function Z(e,t,n=!1){var r;T&&(r=E,Re());var i=new Gi(e),a=n?ne:0;function o(e,t){if(T){var n=Ve(r);if(e!==parseInt(n.substring(1))){var a=Be();Le(a),i.anchor=a,Ie(!1),i.ensure(e,t),Ie(!0);return}}i.ensure(e,t)}Ar(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ki(e,t){return t}function qi(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Ji(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;dr(d),d.append(u),e.items.clear()}Ji(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(o)}function Ji(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Zi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ie,$i(d,null,c)):Br(d):Rr(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Ar(()=>{p=K(f);var e=p.length;let t=!1;T&&Ve(c)===`[!`!=(e===0)&&(c=Be(),Le(c),Ie(!1),t=!0);for(var r=new Set,u=I,v=fr(),y=0;ys(c)):(d=jr(()=>s(Yi??(Yi=cr()))),d.f|=ie)),e>r.size&&xe(``,``,``),T&&e>0&&Le(Be()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Ie(!0),K(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,T&&(c=E)}function Xi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Zi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=Xi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var C=i&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Qi(e,t,n,r,i,a,o,s){var c=o&1?o&16?Jn(n):Yn(n,!1,!1):null,l=o&2?Jn(i):null;return{v:c,i:l,e:jr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function $i(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ur(r);if(a.before(r),r===i)return;r=o}}function ea(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}var ta=[...` +var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function m(e){"@babel/helpers - typeof";return m=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m(e)}function h(e,t){if(m(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(m(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return m(t)==`symbol`?t:t+``}function _(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=1024,y=2048,b=4096,x=8192,S=16384,ee=32768,te=1<<25,ne=65536,C=1<<19,re=1<<20,ie=1<<25,ae=65536,oe=1<<21,se=1<<22,ce=1<<23,le=Symbol(`$state`),ue=Symbol(`legacy props`),de=Symbol(``),fe=Symbol(`attributes`),pe=Symbol(`class`),me=Symbol(`style`),he=Symbol(`text`),ge=Symbol(`form reset`),_e=new class extends Error{constructor(...e){super(...e),_(this,`name`,`StaleReactionError`),_(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},ve=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ye(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function be(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function xe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Se(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ce(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function we(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Te(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function De(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Oe(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function ke(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ae(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var je={},w=Symbol(`uninitialized`);function Me(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ne(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Pe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Fe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var T=!1;function Ie(e){T=e}var E;function Le(e){if(e===null)throw Ne(),je;return E=e}function Re(){return Le(ur(E))}function D(e){if(T){if(ur(E)!==null)throw Ne(),je;E=e}}function ze(e=1){if(T){for(var t=e,n=E;t--;)n=ur(n);E=n}}function Be(e=!0){for(var t=0,n=E;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ur(n);e&&n.remove(),n=i}}function Ve(e){if(!e||e.nodeType!==8)throw Ne(),je;return e.data}function He(e){return e===this.v}function Ue(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function We(e){return!Ue(e,this.v)}var Ge=!1,Ke=!1,O=null;function qe(e){O=e}function Je(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:G,l:Ke&&!t?{s:null,u:null,$:[]}:null}}function Ye(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)Tr(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,e??{}}function Xe(){return!Ke||O!==null&&O.l===null}var Ze=[];function Qe(){var e=Ze;Ze=[],f(e)}function $e(e){if(Ze.length===0&&!on){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}function tt(e){var t=G;if(t===null)return W.f|=ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;nt(e,t)}function nt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var rt=~(y|b|v);function k(e,t){e.f=e.f&rt|t}function it(e){e.f&512||e.deps===null?k(e,v):k(e,b)}function at(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ae,at(t.deps))}function ot(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),at(e.deps),k(e,v)}var st=!1,ct=!1;function lt(e){var t=ct;try{return ct=!1,[e(),ct]}finally{ct=t}}function ut(e){let t=0,n=Jn(0),r;return()=>{Sr()&&(K(n),kr(()=>(t===0&&(r=gi(()=>e(()=>Qn(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,Qn(n))})})))}}function dt(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function ft(e,t){dt(e,t),t.add(e)}function A(e,t,n){dt(e,t),t.set(e,n)}function j(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function M(e,t,n){return e.set(j(e,t),n),n}function N(e,t){return e.get(j(e,t))}var pt=ne|C;function mt(e,t,n,r){new jt(e,t,n,r)}var ht=new WeakMap,gt=new WeakMap,_t=new WeakMap,vt=new WeakMap,yt=new WeakMap,bt=new WeakMap,xt=new WeakMap,St=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Tt=new WeakMap,Et=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,At=new WeakMap,P=new WeakSet,jt=class{constructor(e,t,n,r){ft(this,P),_(this,`parent`,void 0),_(this,`is_pending`,!1),_(this,`transform_error`,void 0),A(this,ht,void 0),A(this,gt,T?E:null),A(this,_t,void 0),A(this,vt,void 0),A(this,yt,void 0),A(this,bt,null),A(this,xt,null),A(this,St,null),A(this,Ct,null),A(this,wt,0),A(this,Tt,0),A(this,Et,!1),A(this,Dt,new Set),A(this,Ot,new Set),A(this,kt,null),A(this,At,ut(()=>(M(kt,this,Jn(N(wt,this))),()=>{M(kt,this,null)}))),M(ht,this,e),M(_t,this,t),M(vt,this,e=>{var t=G;t.b=this,t.f|=128,n(e)}),this.parent=G.b,this.transform_error=r??this.parent?.transform_error??(e=>e),M(yt,this,Ar(()=>{if(T){let e=N(gt,this);Re();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));j(P,this,Nt).call(this,t)}else t?j(P,this,Pt).call(this):j(P,this,Mt).call(this)}else j(P,this,Ft).call(this)},pt)),T&&M(ht,this,E)}defer_effect(e){ot(e,N(Dt,this),N(Ot,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!N(_t,this).pending}update_pending_count(e,t){j(P,this,Rt).call(this,e,t),M(wt,this,N(wt,this)+e),!(!N(kt,this)||N(Et,this))&&(M(Et,this,!0),$e(()=>{M(Et,this,!1),N(kt,this)&&Xn(N(kt,this),N(wt,this))}))}get_effect_pending(){return N(At,this).call(this),K(N(kt,this))}error(e){if(!N(_t,this).onerror&&!N(_t,this).failed)throw e;I?.is_fork?(N(bt,this)&&I.skip_effect(N(bt,this)),N(xt,this)&&I.skip_effect(N(xt,this)),N(St,this)&&I.skip_effect(N(St,this)),I.oncommit(()=>{j(P,this,zt).call(this,e)})):j(P,this,zt).call(this,e)}};function Mt(){try{M(bt,this,jr(()=>N(vt,this).call(this,N(ht,this))))}catch(e){this.error(e)}}function Nt(e){let t=N(_t,this).failed;t&&M(St,this,jr(()=>{t(N(ht,this),()=>e,()=>()=>{})}))}function Pt(){let e=N(_t,this).pending;e&&(this.is_pending=!0,M(xt,this,jr(()=>e(N(ht,this)))),$e(()=>{var e=M(Ct,this,document.createDocumentFragment()),t=cr();e.append(t),M(bt,this,j(P,this,Lt).call(this,()=>jr(()=>N(vt,this).call(this,t)))),N(Tt,this)===0&&(N(ht,this).before(e),M(Ct,this,null),Rr(N(xt,this),()=>{M(xt,this,null)}),j(P,this,It).call(this,I))}))}function Ft(){try{if(this.is_pending=this.has_pending_snippet(),M(Tt,this,0),M(wt,this,0),M(bt,this,jr(()=>{N(vt,this).call(this,N(ht,this))})),N(Tt,this)>0){var e=M(Ct,this,document.createDocumentFragment());Hr(N(bt,this),e);let t=N(_t,this).pending;M(xt,this,jr(()=>t(N(ht,this))))}else j(P,this,It).call(this,I)}catch(e){this.error(e)}}function It(e){this.is_pending=!1,e.transfer_effects(N(Dt,this),N(Ot,this))}function Lt(e){var t=G,n=W,r=O;Yr(N(yt,this)),Jr(N(yt,this)),qe(N(yt,this).ctx);try{return Dn.ensure(),e()}catch(e){return tt(e),null}finally{Yr(t),Jr(n),qe(r)}}function Rt(e,t){if(!this.has_pending_snippet()){if(this.parent){var n;j(P,n=this.parent,Rt).call(n,e,t)}return}M(Tt,this,N(Tt,this)+e),N(Tt,this)===0&&(j(P,this,It).call(this,t),N(xt,this)&&Rr(N(xt,this),()=>{M(xt,this,null)}),N(Ct,this)&&(N(ht,this).before(N(Ct,this)),M(Ct,this,null)))}function zt(e){N(bt,this)&&(Fr(N(bt,this)),M(bt,this,null)),N(xt,this)&&(Fr(N(xt,this)),M(xt,this,null)),N(St,this)&&(Fr(N(St,this)),M(St,this,null)),T&&(Le(N(gt,this)),ze(),Le(Be()));var t=N(_t,this).onerror;let n=N(_t,this).failed;var r=!1,i=!1;let a=()=>{if(r){Fe();return}r=!0,i&&Ae(),N(St,this)!==null&&Rr(N(St,this),()=>{M(St,this,null)}),j(P,this,Lt).call(this,()=>{j(P,this,Ft).call(this)})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){nt(e,N(yt,this)&&N(yt,this).parent)}n&&M(St,this,j(P,this,Lt).call(this,()=>{try{return jr(()=>{var t=G;t.b=this,t.f|=128,n(N(ht,this),()=>e,()=>a)})}catch(e){return nt(e,N(yt,this).parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){nt(e,N(yt,this)&&N(yt,this).parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>nt(e,N(yt,this)&&N(yt,this).parent)):o(t)})}function Bt(e,t,n,r){let i=Xe()?Wt:qt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=G,c=Vt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){nt(e,s)}Ht()}}var d=Ut();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Kt(e))).then(u).catch(e=>nt(e,s)).finally(d)}l?l.then(()=>{c(),f(),Ht()}):f()}function Vt(){var e=G,t=W,n=O,r=I;return function(i=!0){Yr(e),Jr(t),qe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ht(e=!0){Yr(null),Jr(null),qe(null),e&&I?.deactivate()}function Ut(){var e=G,t=e.b,n=I,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Wt(e){var t=2|y;return G!==null&&(G.f|=C),{ctx:O,deps:null,effects:null,equals:He,f:t,fn:e,reactions:null,rv:0,v:w,wv:0,parent:G,ac:null}}var Gt=Symbol(`obsolete`);function Kt(e,t,n){let r=G;r===null&&be();var i=void 0,a=Jn(w),o=!W,s=new Set;return Or(()=>{var t=G,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==_e&&n.reject(e)}).finally(Ht)}catch(e){n.reject(e),Ht()}var c=I;if(o){if(t.f&32768)var l=Ut();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Gt);else for(let e of s.values())e.reject(Gt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Gt&&(c.activate(),t?(a.f|=ce,Xn(a,t)):(a.f&8388608&&(a.f^=ce),Xn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Cr(()=>{for(let e of s)e.reject(Gt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function F(e){let t=Wt(e);return Ge||Zr(t),t}function qt(e){let t=Wt(e);return t.equals=We,t}function Jt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nthis.schedule(e)){var n=N(wn,this).get(e);if(n){N(wn,this).delete(e);for(var r of n.d)k(r,y),t(r);for(r of n.m)k(r,b),t(r)}N(Tn,this).add(e)}capture(e,t,n=!1){e.v!==w&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),rn?.set(e,t)),this.is_fork||(e.v=t)}activate(){I=this}deactivate(){I=null,rn=null}flush(){try{sn=!0,I=this,j(L,this,kn).call(this)}finally{un=0,an=null,cn=null,ln=null,sn=!1,I=null,rn=null,Kn.clear()}}discard(){for(let e of N(gn,this))e(this);N(gn,this).clear();for(let e of this.async_deriveds.values())e.reject(Gt);j(L,this,Fn).call(this),N(yn,this)?.resolve()}register_created_effect(e){N(xn,this).push(e)}increment(e,t){if(M(_n,this,N(_n,this)+1),e){let e=N(vn,this).get(t)??0;N(vn,this).set(t,e+1)}}decrement(e,t){if(M(_n,this,N(_n,this)-1),e){let e=N(vn,this).get(t)??0;e===1?N(vn,this).delete(t):N(vn,this).set(t,e-1)}N(En,this)||(M(En,this,!0),$e(()=>{M(En,this,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)N(Sn,this).add(t);for(let e of t)N(Cn,this).add(e);e.clear(),t.clear()}oncommit(e){N(hn,this).add(e)}ondiscard(e){N(gn,this).add(e)}settled(){return(N(yn,this)??M(yn,this,p())).promise}static ensure(){if(I===null){let t=I=new e;!sn&&!on&&$e(()=>{N(fn,t)||t.flush()})}return I}apply(){if(!Ge||!this.is_fork&&N(pn,this)===null&&N(mn,this)===null){rn=null;return}rn=new Map;for(let[e,[t]]of this.current)rn.set(e,t);for(let t=en;t!==null;t=N(mn,t))if(!(t===this||t.is_fork)){var e=!1;if(t.id1e3&&(j(L,this,Fn).call(this),Ln());for(let e of N(Sn,this))N(Cn,this).delete(e),k(e,y),this.schedule(e);for(let e of N(Cn,this))k(e,b),this.schedule(e);let e=N(bn,this);M(bn,this,[]),this.apply();var t=cn=[],n=[],r=ln=[];for(let r of e)try{j(L,this,An).call(this,r,t,n)}catch(e){throw Wn(r),j(L,this,On).call(this)||this.discard(),e}if(I=null,r.length>0){var i=$t.ensure();for(let e of r)i.schedule(e)}if(cn=null,ln=null,j(L,this,On).call(this)){j(L,this,Nn).call(this,n),j(L,this,Nn).call(this,t);for(let[e,t]of N(wn,this))Un(e,t);r.length>0&&j(L,I,kn).call(I);return}let a=j(L,this,jn).call(this);if(a){j(L,this,Nn).call(this,n),j(L,this,Nn).call(this,t),j(L,a,Mn).call(a,this);return}N(Sn,this).clear(),N(Cn,this).clear();for(let e of N(hn,this))e(this);N(hn,this).clear(),nn=this,zn(n),zn(t),nn=null,N(yn,this)?.resolve();var o=I;if(N(_n,this)===0&&(N(bn,this).length===0||o!==null)&&(j(L,this,Fn).call(this),Ge&&(j(L,this,Pn).call(this),I=o)),N(bn,this).length>0)if(o!==null){let e=o;N(bn,e).push(...N(bn,this).filter(t=>!N(bn,e).includes(t)))}else o=this;o!==null&&j(L,o,kn).call(o)}function An(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||N(wn,this).has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):Ge&&i&16777224?n.push(r):si(r)&&(i&16&&N(Cn,this).add(r),fi(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}function jn(){for(var e=N(pn,this);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=N(pn,e)}return null}function Mn(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(N(Sn,e),N(Cn,e));let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(N(Cn,this).delete(i),k(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),j(L,e,Fn).call(e),I=this,j(L,this,kn).call(this)}function Nn(e){for(var t=0;t!u.current.get(e)[1]);if(!(!N(fn,u)||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of N(Tn,this))u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):j(L,u,Nn).call(u,[e])});u.activate();var a=new Set,o=new Map;for(var s of t)Bn(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of N(xn,this))!(e.f&155648)&&Vn(e,c,o)&&(e.f&4194320?(k(e,y),u.schedule(e)):N(Sn,u).add(e));if(N(bn,u).length>0&&!N(En,u)){u.apply();for(var l of N(bn,u))j(L,u,An).call(u,l,[],[]);M(bn,u,[])}u.deactivate()}}}}function Fn(){if(this.linked){var e=N(pn,this),t=N(mn,this);e===null?en=t:M(mn,e,t),t===null?tn=e:M(pn,t,e),this.linked=!1}}function In(e){var t=on;on=!0;try{var n;for(e&&(I!==null&&!I.is_fork&&I.flush(),n=e());;){if(et(),I===null)return n;I.flush()}}finally{on=t}}function Ln(){try{Te()}catch(e){nt(e,an)}}var Rn=null;function zn(e){var t=e.length;if(t!==0){for(var n=0;n0)){Kn.clear();for(let e of Rn){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Rn.has(n)&&(Rn.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||fi(n)}}Rn.clear()}}Rn=null}}function Bn(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Bn(i,t,n,r):e&4194320&&!(e&2048)&&Vn(i,t,r)&&(k(i,y),Hn(i))}}function Vn(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&Vn(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Hn(e){I.schedule(e)}function Un(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,v);for(var n=e.first;n!==null;)Un(n,t),n=n.next}}function Wn(e){k(e,v);for(var t=e.first;t!==null;)Wn(t),t=t.next}var Gn=new Set,Kn=new Map,qn=!1;function Jn(e,t){return{f:0,v:e,reactions:null,equals:He,rv:0,wv:0}}function R(e,t){let n=Jn(e,t);return Zr(n),n}function Yn(e,t=!1,n=!0){let r=Jn(e);if(t||(r.equals=We),Ke&&n&&O!==null&&O.l!==null){var i;((i=O.l).s??(i.s=[])).push(r)}return r}function z(e,t,n=!1){return W!==null&&(!qr||W.f&131072)&&Xe()&&W.f&4325394&&(Xr===null||!Xr.has(e))&&ke(),Xn(e,n?er(t):t,ln)}function Xn(e,t,n=null){if(!e.equals(t)){Kn.set(e,Gr?t:e.v);var r=Dn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Yt(t),rn===null&&it(t)}e.wv=oi(),$n(e,y,n),Xe()&&G!==null&&G.f&1024&&!(G.f&96)&&(ei===null?ti([e]):ei.push(e)),!r.is_fork&&Gn.size>0&&!qn&&Zn()}return t}function Zn(){qn=!1;for(let e of Gn){e.f&1024&&k(e,b);let t;try{t=si(e)}catch{t=!0}t&&fi(e)}Gn.clear()}function Qn(e){z(e,e.v+1)}function $n(e,t,n){var r=e.reactions;if(r!==null)for(var i=Xe(),a=r.length,o=0;o{if(ii===d)return e();var t=W,n=ii;Jr(null),ai(d);var r=e();return Jr(t),ai(n),r};return i&&r.set(`length`,R(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&De();var i=r.get(t);return i===void 0?f(()=>{var e=R(n.value,u);return r.set(t,e),e}):z(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>R(w,u));r.set(t,e),Qn(o)}}else z(n,w),Qn(o);return!0},get(e,n,i){if(n===le)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>R(er(s?e[n]:w),u)),r.set(n,o)),o!==void 0){var c=K(o);return c===w?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=K(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==w)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===le)return!0;var n=r.get(t),i=n!==void 0&&n.v!==w||Reflect.has(e,t);return(n!==void 0||G!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>R(i?er(e[t]):w,u)),r.set(t,n)),K(n)===w)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;dR(w,u)),r.set(d+``,p)):z(p,w)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>R(void 0,u)),z(c,er(n)),r.set(t,c));else{l=c.v!==w;var m=f(()=>er(n));z(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&z(g,_+1)}Qn(o)}return!0},ownKeys(e){K(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==w});for(var[n,i]of r)i.v!==w&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Oe()}})}function tr(e){try{if(typeof e==`object`&&e&&le in e)return e[le]}catch{}return e}function nr(e,t){return Object.is(tr(e),tr(t))}var rr,ir,ar,or;function sr(){if(rr===void 0){rr=window,ir=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ar=a(t,`firstChild`).get,or=a(t,`nextSibling`).get,u(e)&&(e[pe]=void 0,e[fe]=null,e[me]=void 0,e.__e=void 0),u(n)&&(n[he]=void 0)}}function cr(e=``){return document.createTextNode(e)}function lr(e){return ar.call(e)}function ur(e){return or.call(e)}function B(e,t){if(!T)return lr(e);var n=lr(E);if(n===null)n=E.appendChild(cr());else if(t&&n.nodeType!==3){var r=cr();return n?.before(r),Le(r),r}return t&&mr(n),Le(n),n}function V(e,t=!1){if(!T){var n=lr(e);return n instanceof Comment&&n.data===``?ur(n):n}if(t){if(E?.nodeType!==3){var r=cr();return E?.before(r),Le(r),r}mr(E)}return E}function H(e,t=1,n=!1){let r=T?E:e;for(var i;t--;)i=r,r=ur(r);if(!T)return r;if(n){if(r?.nodeType!==3){var a=cr();return r===null?i?.after(a):r.before(a),Le(a),a}mr(r)}return Le(r),r}function dr(e){e.textContent=``}function fr(){return!Ge||Rn!==null?!1:(G.f&ee)!==0}function pr(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function mr(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var hr=!1;function gr(){hr||(hr=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ge]?.()})},{capture:!0}))}function _r(e){var t=W,n=G;Jr(null),Yr(null);try{return e()}finally{Jr(t),Yr(n)}}function vr(e,t,n,r=n){e.addEventListener(t,()=>_r(n));let i=e[ge];i?e[ge]=()=>{i(),r(!0)}:e[ge]=()=>r(!0),gr()}function yr(e){G===null&&(W===null&&we(e),Ce()),Gr&&Se(e)}function br(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function xr(e,t){var n=G;n!==null&&n.f&8192&&(e|=x);var r={ctx:O,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};I?.register_created_effect(r);var i=r;if(e&4)cn===null?Dn.ensure().schedule(r):cn.push(r);else if(t!==null){try{fi(r)}catch(e){throw Fr(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&br(i,n),W!==null&&W.f&2&&!(e&64))){var a=W;(a.effects??(a.effects=[])).push(i)}return r}function Sr(){return W!==null&&!qr}function Cr(e){let t=xr(8,null);return k(t,v),t.teardown=e,t}function wr(e){yr(`$effect`);var t=G.f;if(!W&&t&32&&O!==null&&!O.i){var n=O;(n.e??(n.e=[])).push(e)}else return Tr(e)}function Tr(e){return xr(4|re,e)}function Er(e){Dn.ensure();let t=xr(64|C,e);return(e={})=>new Promise(n=>{e.outro?Rr(t,()=>{Fr(t),n(void 0)}):(Fr(t),n(void 0))})}function Dr(e){return xr(4,e)}function Or(e){return xr(se|C,e)}function kr(e,t=0){return xr(8|t,e)}function U(e,t=[],n=[],r=[]){Bt(r,t,n,t=>{xr(8,()=>{e(...t.map(K))})})}function Ar(e,t=0){return xr(16|t,e)}function jr(e){return xr(32|C,e)}function Mr(e){var t=e.teardown;if(t!==null){let e=Gr,n=W;Kr(!0),Jr(null);try{t.call(null)}finally{Kr(e),Jr(n)}}}function Nr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&_r(()=>{e.abort(_e)});var r=n.next;n.f&64?n.parent=null:Fr(n,t),n=r}}function Pr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Fr(t),t=n}}function Fr(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ir(e.nodes.start,e.nodes.end),n=!0),e.f|=te,Nr(e,t&&!n),di(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Mr(e),e.f^=te,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&Lr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ir(e,t){for(;e!==null;){var n=e===t?null:ur(e);e.remove(),e=n}}function Lr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Rr(e,t,n=!0){var r=[];zr(e,r,!0);var i=()=>{n&&Fr(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function zr(e,t,n){if(!(e.f&8192)){e.f^=x;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;zr(i,t,o?n:!1)}i=a}}}function Br(e){Vr(e,!0)}function Vr(e,t){if(e.f&8192){e.f^=x,e.f&1024||(k(e,y),Dn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Vr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Hr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ur(n);t.append(n),n=i}}var Ur=null,Wr=!1,Gr=!1;function Kr(e){Gr=e}var W=null,qr=!1;function Jr(e){W=e}var G=null;function Yr(e){G=e}var Xr=null;function Zr(e){W!==null&&(!Ge||W.f&2)&&(Xr??(Xr=new Set)).add(e)}var Qr=null,$r=0,ei=null;function ti(e){ei=e}var ni=1,ri=0,ii=ri;function ai(e){ii=e}function oi(){return++ni}function si(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ae),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&rn===null&&k(e,v)}return!1}function ci(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ge&&Xr!==null&&Xr.has(e)))for(var i=0;i{e.ac.abort(_e)}),e.ac=null);try{e.f|=oe;var u=e.fn,d=u();e.f|=ee;var f=e.deps,p=I?.is_fork;if(Qr!==null){var m;if(p||di(e,$r),f!==null&&$r>0)for(f.length=$r+Qr.length,m=0;m{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),In()}function K(e){var t=(e.f&2)!=0;if(Ur?.add(e),W!==null&&!qr&&!(G!==null&&G.f&16384)&&(Xr===null||!Xr.has(e))){var r=W.deps;if(W.f&2097152)e.rvn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Ci(e,t,n,r,i){var a={capture:r,passive:i},o=Si(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Cr(()=>{t.removeEventListener(e,o,a)})}function q(e,t,n){(t[yi]??(t[yi]={}))[e]=n}function wi(e){for(var t=0;t{throw e});throw p}}finally{e[yi]=t,delete e.currentTarget,Jr(d),Yr(f)}}}var Di=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Oi(e){return Di?.createHTML(e)??e}function ki(e){var t=pr(`template`);return t.innerHTML=Oi(e.replaceAll(``,``)),t.content}function Ai(e,t){var n=G;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function J(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(``);return()=>{if(T)return Ai(E,null),E;i===void 0&&(i=ki(a?e:``+e),n||(i=lr(i)));var t=r||ir?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=lr(t),s=t.lastChild;Ai(o,s)}else Ai(t,t);return t}}function ji(e=``){if(!T){var t=cr(e+``);return Ai(t,t),t}var n=E;return n.nodeType===3?mr(n):(n.before(n=cr()),Le(n)),Ai(n,n),n}function Mi(){if(T)return Ai(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(``),n=cr();return e.append(t,n),Ai(t,n),e}function Y(e,t){if(T){var n=G;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=E),Re();return}e!==null&&e.before(t)}function X(e,t){var n,r=t==null?``:typeof t==`object`?`${t}`:t;r!==((n=e)[he]??(n[he]=e.nodeValue))&&(e[he]=r,e.nodeValue=`${r}`)}function Ni(e,t){return Fi(e,t)}var Pi=new Map;function Fi(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){sr();var l=void 0,u=Er(()=>{var s=n??t.appendChild(cr());mt(s,{pending:()=>{}},t=>{Je({});var n=O;if(o&&(n.c=o),a&&(i.$$events=a),T&&Ai(t,null),l=e(t,i)||{},T&&(G.nodes.end=E,E===null||E.nodeType!==8||E.data!==`]`))throw Ne(),je;Ye()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=Pi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ei),r.delete(e),r.size===0&&Pi.delete(n)):r.set(e,i)}xi.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Ii.set(l,u),l}var Ii=new WeakMap;function Li(e,t){let n=Ii.get(e);return n?(Ii.delete(e),n(t)):Promise.resolve()}var Ri=new WeakMap,zi=new WeakMap,Bi=new WeakMap,Vi=new WeakMap,Hi=new WeakMap,Ui=new WeakMap,Wi=new WeakMap,Gi=class{constructor(e,t=!0){_(this,`anchor`,void 0),A(this,Ri,new Map),A(this,zi,new Map),A(this,Bi,new Map),A(this,Vi,new Set),A(this,Hi,!0),A(this,Ui,e=>{if(N(Ri,this).has(e)){var t=N(Ri,this).get(e),n=N(zi,this).get(t);if(n)Br(n),N(Vi,this).delete(t);else{var r=N(Bi,this).get(t);r&&(Br(r.effect),N(zi,this).set(t,r.effect),N(Bi,this).delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of N(Ri,this)){if(N(Ri,this).delete(t),t===e)break;let r=N(Bi,this).get(n);r&&(Fr(r.effect),N(Bi,this).delete(n))}for(let[e,r]of N(zi,this)){if(e===t||N(Vi,this).has(e))continue;let i=()=>{if(Array.from(N(Ri,this).values()).includes(e)){var t=document.createDocumentFragment();Hr(r,t),t.append(cr()),N(Bi,this).set(e,{effect:r,fragment:t})}else Fr(r);N(Vi,this).delete(e),N(zi,this).delete(e)};N(Hi,this)||!n?(N(Vi,this).add(e),Rr(r,i,!1)):i()}}}),A(this,Wi,e=>{N(Ri,this).delete(e);let t=Array.from(N(Ri,this).values());for(let[e,n]of N(Bi,this))t.includes(e)||(Fr(n.effect),N(Bi,this).delete(e))}),this.anchor=e,M(Hi,this,t)}ensure(e,t){var n=I,r=fr();if(t&&!N(zi,this).has(e)&&!N(Bi,this).has(e))if(r){var i=document.createDocumentFragment(),a=cr();i.append(a),N(Bi,this).set(e,{effect:jr(()=>t(a)),fragment:i})}else N(zi,this).set(e,jr(()=>t(this.anchor)));if(N(Ri,this).set(n,e),r){for(let[t,r]of N(zi,this))t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of N(Bi,this))t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(N(Ui,this)),n.ondiscard(N(Wi,this))}else T&&(this.anchor=E),N(Ui,this).call(this,n)}};function Z(e,t,n=!1){var r;T&&(r=E,Re());var i=new Gi(e),a=n?ne:0;function o(e,t){if(T){var n=Ve(r);if(e!==parseInt(n.substring(1))){var a=Be();Le(a),i.anchor=a,Ie(!1),i.ensure(e,t),Ie(!0);return}}i.ensure(e,t)}Ar(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ki(e,t){return t}function qi(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Ji(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;dr(d),d.append(u),e.items.clear()}Ji(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(o)}function Ji(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Zi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ie,$i(d,null,c)):Br(d):Rr(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Ar(()=>{p=K(f);var e=p.length;let t=!1;T&&Ve(c)===`[!`!=(e===0)&&(c=Be(),Le(c),Ie(!1),t=!0);for(var r=new Set,u=I,v=fr(),y=0;ys(c)):(d=jr(()=>s(Yi??(Yi=cr()))),d.f|=ie)),e>r.size&&xe(``,``,``),T&&e>0&&Le(Be()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Ie(!0),K(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,T&&(c=E)}function Xi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Zi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=Xi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var C=i&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Qi(e,t,n,r,i,a,o,s){var c=o&1?o&16?Jn(n):Yn(n,!1,!1):null,l=o&2?Jn(i):null;return{v:c,i:l,e:jr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function $i(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ur(r);if(a.before(r),r===i)return;r=o}}function ea(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}var ta=[...` \r\f\xA0\v`];function na(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ta.includes(r[o-1]))&&(s===r.length||ta.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ra(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ia(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function aa(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ia)),i&&c.push(...Object.keys(i).map(ia));var l=0,u=-1;let t=e.length;for(var d=0;d{la(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Cr(()=>{t.disconnect()})}function da(e,t,n=t){var r=new WeakSet,i=!0;vr(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),fa);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&fa(o)}n(a),e.__value=a,I!==null&&r.add(I)}),Dr(()=>{var a=t();if(e===document.activeElement){var o=Ge?nn:I;if(r.has(o))return}if(la(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=fa(s),n(a))}e.__value=a,i=!1}),ua(e)}function fa(e){return`__value`in e?e.__value:e.value}var pa=Symbol(`is custom element`),ma=Symbol(`is html`),ha=ve?`link`:`LINK`;function ga(e){if(T){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;$(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;$(e,`checked`,null),e.checked=r}}};e[ge]=n,$e(n),gr()}}function $(e,t,n,r){var i=_a(e);T&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ha)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[de]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ya(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function _a(e){var t;return(t=e)[fe]??(t[fe]={[pa]:e.nodeName.includes(`-`),[ma]:e.namespaceURI===`http://www.w3.org/1999/xhtml`})}var va=new Map;function ya(e){var t=e.getAttribute(`is`)||e.nodeName,n=va.get(t);if(n)return n;va.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function ba(e,t,n=t){var r=new WeakSet;vr(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Sa(e)?Ca(a):a,n(a),I!==null&&r.add(I),await pi(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(T&&e.defaultValue!==e.value||gi(t)==null&&e.value)&&(n(Sa(e)?Ca(e.value):e.value),I!==null&&r.add(I)),kr(()=>{var n=t();if(e===document.activeElement){var i=Ge?nn:I;if(r.has(i))return}Sa(e)&&n===Ca(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function xa(e,t,n=t){vr(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(T&&e.defaultChecked!==e.checked||gi(t)==null)&&n(e.checked),kr(()=>{e.checked=!!t()})}function Sa(e){var t=e.type;return t===`number`||t===`range`}function Ca(e){return e===``?null:+e}var wa,Ta=new WeakMap,Ea=new WeakMap,Da=new WeakMap,Oa=new WeakSet,ka=class{constructor(e){ft(this,Oa),A(this,Ta,new WeakMap),A(this,Ea,void 0),A(this,Da,void 0),M(Da,this,e)}observe(e,t){var n=N(Ta,this).get(e)||new Set;return n.add(t),N(Ta,this).set(e,n),j(Oa,this,Aa).call(this).observe(e,N(Da,this)),()=>{var n=N(Ta,this).get(e);n.delete(t),n.size===0&&(N(Ta,this).delete(e),N(Ea,this).unobserve(e))}}};wa=ka;function Aa(){return N(Ea,this)??M(Ea,this,new ResizeObserver(e=>{for(var t of e){wa.entries.set(t.target,t);for(var n of N(Ta,this).get(t.target)||[])n(t)}}))}_(ka,`entries`,new WeakMap);function ja(e,t){return e===t||e?.[le]===t}function Ma(e={},t,n,r){var i=O.r,a=G;return Dr(()=>{var o,s;return kr(()=>{o=s,s=r?.()||[],gi(()=>{ja(n(...s),e)||(t(e,...s),o&&ja(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ja(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Na(e,t,n,r){var i=!Ke||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=void 0,d=()=>s&&i?(u??(u=Wt(r)),K(u)):(l&&(l=!1,c=s?gi(r):r),c);let f;if(o){var p=le in e||ue in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=lt(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ee(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?Wt:qt)(()=>(v=!1,g()));o&&K(y);var b=G;return(function(e,t){if(arguments.length>0){let n=t?K(y):i&&o?er(e):e;return z(y,n),v=!0,c!==void 0&&(c=n),e}return Gr&&v||b.f&16384?y.v:K(y)})}function Pa(e){O===null&&ye(`onMount`),Ke&&O.l!==null?Fa(O).m.push(e):wr(()=>{let t=gi(e);if(typeof t==`function`)return t})}function Fa(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}var Ia=`[data-v-app]`,La=[`header`,`content`,`footer`],Ra=null,za=null;function Ba(e){let t=e instanceof Set?e:new Set(e||[]);for(let e=0;e<16;e++){let e=crypto.randomUUID().replace(/-/g,``).slice(0,8);if(!t.has(e))return e}throw Error(`rebemer: id collision exhausted`)}function Va(){if(typeof document>`u`)return!1;let e=document.querySelector(Ia)?.__vue_app__?.config?.globalProperties?.$_state;return!e||typeof e!=`object`||!Array.isArray(e.globalClasses)?(Ra=null,!1):(Ra=e,za=null,!0)}function Ha(){if(za!==null)return za;let e=typeof document<`u`?document.querySelector(Ia)?.__vue_app__:null;if(!e)return za=!1,!1;let t=e.config?.globalProperties??{};if(typeof Ra?.$history?.pause==`function`&&typeof Ra?.$history?.resume==`function`)return za={pause:()=>Ra.$history.pause(),resume:()=>Ra.$history.resume()},za;let n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause==`function`&&typeof n?.history?.resume==`function`?(za={pause:()=>n.history.pause(),resume:()=>n.history.resume()},za):(za=!1,!1)}function Ua(e){let t=Ha();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function Wa(e){if(!Ra||!e)return null;for(let t of La){let n=Ra[t];if(!Array.isArray(n))continue;let r=n.find(t=>t&&t.id===e);if(r)return r}return null}function Ga(e){let t=Wa(e);if(!t)return[];let n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Ka(t,1,n),n}function Ka(e,t,n){if(!(!e||!Array.isArray(e.children)))for(let r of e.children){let e=Wa(r);e&&(n.push({id:e.id,depth:t,label:e.label,name:e.name,settings:e.settings}),Ka(e,t+1,n))}}function qa(){return Ra?Ra.globalClasses:[]}function Ja(e,t){if(!Ra)throw Error(`rebemer: not ready`);let n=Ra.globalClasses,r=n.find(t=>t&&t.name===e);if(r)return r.id;let i=Ba(new Set(n.map(e=>e?.id).filter(Boolean)));return n.push({id:i,name:e,settings:t||{}}),i}function Ya(e,t){let n=Wa(e);if(!n)return;n.settings||(n.settings={});let r=Array.isArray(t)?t:[];Array.isArray(n.settings._cssGlobalClasses)?n.settings._cssGlobalClasses.splice(0,n.settings._cssGlobalClasses.length,...r):n.settings._cssGlobalClasses=[...r]}function Xa(e,t){let n=Wa(e);n&&(n.label=t)}function Za(e){if(!e||typeof e!=`string`||typeof window>`u`)return``;let t=(typeof document<`u`?document.querySelector(Ia)?.__vue_app__:null)?.config?.globalProperties??{},n=[window.bricks?.elements,t.$_bricksData?.elements,t.bricksData?.elements,Ra?.elements];for(let t of n){if(!t)continue;let n=t instanceof Map?t.get(e):t[e],r=n?.label??n?.nicename??n?.title;if(typeof r==`string`&&r.trim())return r}return``}var Qa=`slashed-rebemer-host`,$a=`slashed-class-hint`,eo=[`#bricks-panel`,`.bricks-class-manager`,`#bricks-class-manager`,`[data-control="cssClasses"]`],to=`rebemer-class-hint-btn`,no=50;function ro(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n[0]===`.`&&(n=n.slice(1)),!n.startsWith(`sf-`)&&!n.startsWith(`is-`))||!Object.prototype.hasOwnProperty.call(t,n))return null;let r=t[n];return!r||typeof r.description!=`string`?null:{name:n,description:r.description,category:r.category}}var io={},ao=null,oo=null,so=null,co=null,lo=null;function uo(){if(ao&&ao.isConnected)return ao;let e=document.getElementById(Qa);e||(e=document.createElement(`div`),e.id=Qa,document.body.appendChild(e));let t=document.createElement(`div`);return t.id=$a,t.className=`rebemer-class-hint`,t.setAttribute(`role`,`tooltip`),t.hidden=!0,t.innerHTML=`

`,e.appendChild(t),ao=t,t}function fo(e,t){let n=t.getBoundingClientRect(),r=e.offsetWidth,i=e.offsetHeight,a=document.documentElement.clientWidth,o=document.documentElement.clientHeight,s=n.bottom+8;s+i>o&&n.top-8-i>=0&&(s=n.top-8-i);let c=n.left+n.width/2-r/2;c+r>a-4&&(c=Math.max(4,a-4-r)),c<4&&(c=4),e.style.top=`${Math.round(s)}px`,e.style.left=`${Math.round(c)}px`}function po(e){let t=e.dataset.sfClass,n=t?ro(t,io):null;if(!n)return;let r=uo();r.querySelector(`.rebemer-class-hint__name`).textContent=`.${n.name}`;let i=r.querySelector(`.rebemer-class-hint__cat`);i.textContent=n.category||``,i.hidden=!n.category,r.querySelector(`.rebemer-class-hint__desc`).textContent=n.description,r.hidden=!1,fo(r,e),lo=e}function mo(){ao&&(ao.hidden=!0),lo=null}function ho(e){po(e.currentTarget)}function go(){mo()}function _o(e){e.preventDefault(),e.stopPropagation()}function vo(e){e.key===`Escape`&&mo()}function yo(e){let t=ro(e.textContent,io);if(t)return t;let n=e.querySelectorAll(`span, [contenteditable], .name, .label, a`);for(let e of n){let t=ro(e.textContent,io);if(t)return t}return null}function bo(e){return e.querySelector(`.actions, [class*="action"], [class*="icons"], [class*="controls"]`)||e}function xo(){let e=document.createElement(`span`);return e.className=to,e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-label`,`What does this class do?`),e.addEventListener(`mouseenter`,ho),e.addEventListener(`mouseleave`,go),e.addEventListener(`focus`,ho),e.addEventListener(`blur`,go),e.addEventListener(`click`,_o),e}function So(){for(let e of document.querySelectorAll(`.rebemer-class-hint-btn`)){let t=e.closest(`li`),n=t?yo(t):null;n?e.dataset.sfClass!==n.name&&(e.dataset.sfClass=n.name):(lo===e&&mo(),e.remove())}let e=document.querySelectorAll(eo.join(`,`));for(let t of e)for(let e of t.querySelectorAll(`li`)){if(e.querySelector(`.rebemer-class-hint-btn`)||e.querySelector(`li`))continue;let t=yo(e);if(!t)continue;let n=xo();n.dataset.sfClass=t.name,bo(e).appendChild(n)}}function Co(){co===null&&(co=setTimeout(()=>{co=null,So()},no))}function wo(e){let t=eo.join(`,`);for(let n of e){let e=n.target;if(e&&e.nodeType===1){if(e.classList&&e.classList.contains(to))continue;if(e.closest&&e.closest(t))return!0}for(let e of n.addedNodes)if(e.nodeType===1&&!(e.classList&&e.classList.contains(to))&&(e.matches&&e.matches(t)||e.closest&&e.closest(t)||e.querySelector&&e.querySelector(t)))return!0}return!1}function To(e,t,n={}){if(Eo(),io=t&&typeof t==`object`?t:{},!e||Object.keys(io).length===0)return;oo=new AbortController;let{signal:r}=oo;document.addEventListener(`keydown`,vo,{passive:!0,signal:r}),window.addEventListener(`scroll`,mo,{capture:!0,passive:!0,signal:r}),so=new MutationObserver(e=>{lo&&!lo.isConnected&&mo(),wo(e)&&Co()}),so.observe(document.body,{childList:!0,subtree:!0}),So(),n.signal&&(n.signal.aborted?Eo():n.signal.addEventListener(`abort`,Eo,{once:!0}))}function Eo(){co!==null&&(clearTimeout(co),co=null),so&&(so.disconnect(),so=null),oo&&(oo.abort(),oo=null);try{document.querySelectorAll(`.rebemer-class-hint-btn`).forEach(e=>e.remove())}catch{}ao&&(ao.remove(),ao=null),lo=null,io={}}var Do=`li.variable-picker-item`,Oo=`slashed-var-swatch`,ko=`slashed-sf-color-btn`,Ao=50,jo=(e,...t)=>console[e](`[slashed-swatches]`,...t);function Mo(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n.slice(0,2)!==`--`&&(n=`--`+n.replace(/^-+/,``)),n.indexOf(`--sf-color-`)!==0))return null;let r=t[n];return typeof r==`string`&&r?r:null}var No=!1,Po={},Fo=null,Io=null,Lo=null,Ro=null,zo=new WeakSet;function Bo(e){if(!Fo)return;let t=e.querySelector(`[data-control="text"].color-input`);if(!t)return;let n=e.querySelector(`:scope > .slashed-sf-color-btn`);if(!n){n=document.createElement(`div`),n.className=ko,n.setAttribute(`aria-label`,`SLASHED Colors`),n.setAttribute(`data-balloon`,`SLASHED Colors`),n.setAttribute(`data-balloon-pos`,`top`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`);let r=document.createElement(`span`);r.className=`slashed-sf-color-btn__dot`,r.setAttribute(`aria-hidden`,`true`),n.appendChild(r),n.addEventListener(`click`,n=>{n.stopPropagation();let r=e.querySelector(`[data-control="text"].color-input`);Fo&&Fo(r??t)}),n.addEventListener(`keydown`,e=>{e.key===` `?(e.preventDefault(),n.click()):e.key===`Enter`&&n.click()});let i=e.querySelector(`:scope > .bricks-control-preview`);if(i)e.insertBefore(n,i.nextSibling);else{let t=e.querySelector(`:scope > .input-wrapper`);t?e.insertBefore(n,t):e.appendChild(n)}}if(Vo(n,t),Ro){let e=t.querySelector(`input[type="text"]`)??t.querySelector(`input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])`);e&&!zo.has(e)&&(zo.add(e),e.addEventListener(`input`,()=>Vo(n,t),{signal:Ro.signal}))}}function Vo(e,t){let n=e.querySelector(`.slashed-sf-color-btn__dot`),r=((t.querySelector(`input[type="text"]`)??t.querySelector(`input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])`))?.value??``).match(/^var\((--[^)]+)\)/)?.[1],i=r?Po[r]??null:null;n&&(i?(n.style.background=i,n.style.removeProperty(`box-shadow`)):n.style.removeProperty(`background`)),i?e.style.setProperty(`--sf-active-color`,i):e.style.removeProperty(`--sf-active-color`),e.classList.toggle(`slashed-sf-color-btn--active`,!!i);let a=e.closest(`[data-control="color"]`);if(a){let e=a.querySelector(`:scope > .bricks-control-preview`);e&&Ho(e,!!i)}}function Ho(e,t){let n=e.querySelector(`.bricks-control-transparency-pattern`),r=e.querySelector(`.slashed-sf-preview-label`);t?(n&&n.style.setProperty(`visibility`,`hidden`),r||(r=document.createElement(`span`),r.className=`slashed-sf-preview-label`,r.setAttribute(`aria-hidden`,`true`),r.textContent=`✕`,e.appendChild(r))):(n&&n.style.removeProperty(`visibility`),r&&r.remove())}function Uo(e){let t=e.querySelector(`:scope > span[title]`)||e.querySelector(`:scope > span`);if(t){let e=t.getAttribute(`title`);return e&&e.trim()?e.trim():(t.textContent||``).trim()}return(e.textContent||``).trim()}function Wo(e){if(e.classList.contains(`title`)||e.classList.contains(`category`)){let t=e.querySelector(`:scope > .slashed-var-swatch`);t&&t.remove();return}let t=Mo(Uo(e),Po),n=e.querySelector(`:scope > .slashed-var-swatch`);if(!t){n&&n.remove();return}n||(n=document.createElement(`span`),n.className=Oo,n.setAttribute(`aria-hidden`,`true`),e.insertBefore(n,e.firstChild)),n.dataset.color!==t&&(n.style.setProperty(`--slashed-swatch-color`,t),n.dataset.color=t)}function Go(){try{let e=document.querySelectorAll(Do);for(let t of e)Wo(t)}catch(e){jo(`warn`,`swatch pass failed`,e)}if(Fo)try{document.querySelectorAll(`[data-control="color"]`).forEach(Bo)}catch(e){jo(`warn`,`SF button inject failed`,e)}}function Ko(){Lo===null&&(Lo=setTimeout(()=>{Lo=null,Go()},Ao))}function qo(e){for(let t of e){let e=t.target;if(e&&e.nodeType===1&&e.closest&&(e.closest(Do)||Fo&&e.closest(`[data-control="color"]`)))return!0;for(let e of t.addedNodes)if(e.nodeType===1&&(e.matches&&e.matches(Do)||e.querySelector&&e.querySelector(Do)||Fo&&(e.matches&&e.matches(`[data-control="color"]`)||e.querySelector&&e.querySelector(`[data-control="color"]`))))return!0}return!1}function Jo(e,t,n={}){Yo(),No=!!e,Po=t&&typeof t==`object`?t:{},Fo=typeof n.onOpenPanel==`function`?n.onOpenPanel:null,!(!(No&&Object.keys(Po).length>0)&&!Fo)&&(Ro=new AbortController,Io=new MutationObserver(e=>{qo(e)&&Ko()}),Io.observe(document.body,{childList:!0,subtree:!0}),Go(),n.signal&&(n.signal.aborted?Yo():n.signal.addEventListener(`abort`,Yo,{once:!0})))}function Yo(){Lo!==null&&(clearTimeout(Lo),Lo=null),Io&&(Io.disconnect(),Io=null),Ro&&(Ro.abort(),Ro=null);try{document.querySelectorAll(`.slashed-var-swatch`).forEach(e=>e.remove()),document.querySelectorAll(`.slashed-sf-color-btn`).forEach(e=>e.remove())}catch{}No=!1,Po={},Fo=null,zo=new WeakSet}var Xo=`li.variable-picker-item`,Zo=`slashed-var-hint-btn`,Qo=`slashed-var-hint`,$o=`slashed-rebemer-host`,es=50;function ts(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n))return null;let r=n.replace(/^-+/,``);if(!r||!Object.prototype.hasOwnProperty.call(t,r))return null;let i=t[r];return i?{name:r,category:i.category||``,description:i.description||``}:null}var ns={},rs=null,is=null,as=null,os=null,ss=null;function cs(){if(rs&&rs.isConnected)return rs;let e=document.getElementById($o);e||(e=document.createElement(`div`),e.id=$o,document.body.appendChild(e));let t=document.createElement(`div`);return t.id=Qo,t.className=`slashed-var-hint`,t.setAttribute(`role`,`tooltip`),t.hidden=!0,t.innerHTML=`

`,e.appendChild(t),rs=t,t}function ls(e,t){let n=t.getBoundingClientRect(),r=e.offsetWidth,i=e.offsetHeight,a=document.documentElement.clientWidth,o=document.documentElement.clientHeight,s=n.bottom+8;s+i>o&&n.top-8-i>=0&&(s=n.top-8-i);let c=n.left+n.width/2-r/2;c+r>a-4&&(c=Math.max(4,a-4-r)),c<4&&(c=4),e.style.top=`${Math.round(s)}px`,e.style.left=`${Math.round(c)}px`}function us(e){let t=e.dataset.sfVar,n=t?ts(t,ns):null;if(!n)return;let r=cs();r.querySelector(`.slashed-var-hint__name`).textContent=`--`+n.name;let i=r.querySelector(`.slashed-var-hint__cat`);i.textContent=n.category||``,i.hidden=!n.category;let a=r.querySelector(`.slashed-var-hint__desc`);a&&(a.textContent=n.description||``,a.hidden=!n.description),r.hidden=!1,ls(r,e),ss=e}function ds(){rs&&(rs.hidden=!0),ss=null}function fs(e){us(e.currentTarget)}function ps(){ds()}function ms(e){e.preventDefault(),e.stopPropagation()}function hs(e){e.key===`Escape`&&ds()}function gs(e){let t=e.querySelector(`:scope > span[title]`)||e.querySelector(`:scope > span`);if(t){let e=t.getAttribute(`title`);return e&&e.trim()?e.trim():(t.textContent||``).trim()}return(e.textContent||``).trim()}function _s(){let e=document.createElement(`span`);return e.className=Zo,e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-label`,`What is this variable?`),e.addEventListener(`mouseenter`,fs),e.addEventListener(`mouseleave`,ps),e.addEventListener(`focus`,fs),e.addEventListener(`blur`,ps),e.addEventListener(`click`,ms),e}function vs(){for(let e of document.querySelectorAll(`.slashed-var-hint-btn`)){let t=e.closest(`li`),n=t?ts(gs(t),ns):null;n?e.dataset.sfVar!==n.name&&(e.dataset.sfVar=n.name):(ss===e&&ds(),e.remove())}for(let e of document.querySelectorAll(Xo)){if(e.classList.contains(`title`)||e.classList.contains(`category`)||e.querySelector(`.slashed-var-hint-btn`))continue;let t=ts(gs(e),ns);if(!t)continue;let n=_s();n.dataset.sfVar=t.name,e.appendChild(n)}}function ys(){os===null&&(os=setTimeout(()=>{os=null,vs()},es))}function bs(e){for(let t of e){let e=t.target;if(e&&e.nodeType===1&&e.closest){if(e.classList&&e.classList.contains(Zo))continue;if(e.closest(Xo))return!0}for(let e of t.addedNodes)if(e.nodeType===1&&!(e.classList&&e.classList.contains(Zo))&&(e.matches&&e.matches(Xo)||e.querySelector&&e.querySelector(Xo)))return!0}return!1}function xs(e,t={}){if(Ss(),ns=e&&typeof e==`object`?e:{},Object.keys(ns).length===0)return;is=new AbortController;let{signal:n}=is;document.addEventListener(`keydown`,hs,{passive:!0,signal:n}),window.addEventListener(`scroll`,ds,{capture:!0,passive:!0,signal:n}),as=new MutationObserver(e=>{ss&&!ss.isConnected&&ds(),bs(e)&&ys()}),as.observe(document.body,{childList:!0,subtree:!0}),vs(),t.signal&&(t.signal.aborted?Ss():t.signal.addEventListener(`abort`,Ss,{once:!0}))}function Ss(){os!==null&&(clearTimeout(os),os=null),as&&(as.disconnect(),as=null),is&&(is.abort(),is=null);try{document.querySelectorAll(`.slashed-var-hint-btn`).forEach(e=>e.remove())}catch{}rs&&(rs.remove(),rs=null),ss=null,ns={}}if(typeof window<`u`){var Cs,ws;((Cs=(ws=window).__svelte??(ws.__svelte={})).v??(Cs.v=new Set)).add(`5`)}var Ts=J(`reBEM`);function Es(e,t){Je(t,!0);function n(e){e.stopPropagation(),e.preventDefault(),t.onActivate?.(t.elementId)}var r=Ts();U(()=>{$(r,`title`,t.label?`Open reBEMer for ${t.label}`:`Open reBEMer`),$(r,`aria-label`,t.label?`Open reBEMer for ${t.label}`:`Open reBEMer`)}),q(`click`,r,n),q(`keydown`,r,e=>(e.key===`Enter`||e.key===` `)&&n(e)),Y(e,r),Ye()}wi([`click`,`keydown`]);function Ds(e){return e?String(e).normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x00-\x7f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``):``}var Os=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,ks=new Set([`auto`,`inherit`,`initial`,`unset`,`revert`,`revert-layer`,`none`]);function As(e){return e?ks.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:Os.test(e)?{ok:!0}:{ok:!1,reason:`Use lowercase letters, digits, and hyphens.`}:{ok:!1,reason:`Name is empty.`}}var js=new Set(`_padding._padding_top._padding_right._padding_bottom._padding_left._margin._margin_top._margin_right._margin_bottom._margin_left._width._widthMin._widthMax._minWidth._maxWidth._height._heightMin._heightMax._minHeight._maxHeight._aspectRatio._overflow._overflowX._overflowY._color._background._backgroundColor._backgroundImage._backgroundSize._backgroundPosition._backgroundRepeat._backgroundAttachment._backgroundBlendMode._typography._fontFamily._fontSize._fontWeight._fontStyle._lineHeight._letterSpacing._wordSpacing._textAlign._textTransform._textDecoration._textDecorationColor._textShadow._textIndent._whiteSpace._listStyleType._listStylePosition._border._borderRadius._borderColor._borderStyle._borderWidth._outline._outlineColor._outlineStyle._outlineWidth._outlineOffset._boxShadow._filter._backdropFilter._opacity._blendMode._transform._transformOrigin._transition._animation._display._flexDirection._flexWrap._flexGrow._flexShrink._flexBasis._alignItems._alignSelf._alignContent._justifyContent._justifyItems._justifySelf._gap._rowGap._columnGap._gridTemplateColumns._gridTemplateRows._gridGap._gridAutoFlow._gridAutoColumns._gridAutoRows._gridColumn._gridRow._gridArea._position._top._right._bottom._left._zIndex._objectFit._objectPosition._cursor._pointerEvents._userSelect`.split(`.`));function Ms(e){if(!e||typeof e!=`object`)return[];let t=[];for(let n of Object.keys(e))js.has(n)&&t.push(n);return t.sort(),t}var Ns=new Set([`_cssGlobalClasses`,`_cssClasses`,`_cssId`,`_attributes`,`_hidden`,`_hidden_lg`,`_hidden_md`,`_hidden_sm`,`_hidden_xl`,`_name`,`_label`,`_id`,`tag`,`children`,`parent`]);function Ps(e){if(!e||typeof e!=`object`)return[];let t=[];for(let n of Object.keys(e))js.has(n)||Ns.has(n)||n.startsWith(`_hidden_`)||t.push(n);return t.sort(),t}var Fs=new Set([`add`,`rename`,`replace`,`migrate`,`mixed`]),Is=new Set([`user`,`label`]);function Ls(e,t){let n=new Map,r=[];for(let i of e){for(;r.length&&r[r.length-1].depth>=i.depth;)r.pop();let e=i.id===t,a=!e&&i.isBlockRoot===!0;if(e||a){let e=Ds(i.name);e&&i.include!==!1&&(r.push({depth:i.depth,blockName:e}),n.set(i.id,e))}else{let e=r.length?r[r.length-1].blockName:``;e&&n.set(i.id,e)}}return n}function Rs({rootId:e,rows:t,mode:n}){if(!Fs.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};let r=t.find(t=>t.id===e);if(!r)return{ok:!1,ops:[],error:`Root row missing.`};if(!Ds(r.name))return{ok:!1,ops:[],error:`Block name is empty.`};let i=[];for(let n of t)!n.isBlockRoot||!n.include||n.id===e||Ds(n.name)||i.push(n.originalLabel||n.id);if(i.length>0)return{ok:!1,ops:[],error:`Block name is empty for: ${i.join(`, `)}.`};let a=Ls(t,e),o=[];for(let n of t){if(!n.include)continue;let t=n.id===e,r=!t&&n.isBlockRoot===!0,i=a.get(n.id);if(!i)continue;let s;if(t||r)s=i;else{let e=Ds(n.name);if(!e)continue;s=`${i}__${e}`}o.push({row:n,isRoot:t||r,blockName:i,finalClass:s,modifierSlugs:[],suggestedFrom:n.suggestedFrom||`fallback`})}if(o.length===0)return{ok:!1,ops:[],error:`No rows to apply. Include at least one row.`};let s=Vs(o);if(!s.ok)return{ok:!1,ops:[],error:s.error};if(n!==`migrate`)for(let e of o)e.modifierSlugs=(Array.isArray(e.row.modifiers)?e.row.modifiers:[]).map(e=>Ds(e)).filter(Boolean);return{ok:!0,ops:o}}function zs({rootId:e,rows:t,mode:n,syncLabels:r,removeExisting:i=!1}){let a=Rs({rootId:e,rows:t,mode:n});if(!a.ok)return{ok:!1,error:a.error};let o=a.ops,s=qa();if(n===`migrate`){let e=Bs(o,s);if(!e.ok)return e}let c=new Map;for(let e of o){if(c.has(e.row.id))continue;let t=Wa(e.row.id);if(!t)continue;let i={classIds:Ws(t.settings).slice(),label:r?t.label??``:null};if(n===`migrate`&&Array.isArray(e.row.migrateKeys)){let n={};for(let r of e.row.migrateKeys)Object.prototype.hasOwnProperty.call(t.settings||{},r)&&(n[r]=JSON.parse(JSON.stringify(t.settings[r])));i.migrateKeys=n}c.set(e.row.id,i)}let l=0;try{Ua(()=>{for(let e of o){let t=Wa(e.row.id);if(!t)continue;let a=Ws(t.settings),o=e.row.op??`add`,c=n===`mixed`?[`add`,`rename`,`replace`].includes(o)?o:`add`:n,u=i&&(c===`rename`||c===`replace`),d={};if(c===`rename`&&a.length>0){let t=e.row.renameFamilyId||a[0],n=s.find(e=>e&&e.id===t);n&&n.settings&&(d=JSON.parse(JSON.stringify(n.settings)))}else c===`migrate`&&(d=Hs(t.settings,e.row.migrateKeys));if(c===`migrate`){let t=s.find(t=>t&&t.name===e.finalClass);if(t){(!t.settings||typeof t.settings!=`object`)&&(t.settings={});for(let[e,n]of Object.entries(d))Object.prototype.hasOwnProperty.call(t.settings,e)||(t.settings[e]=n)}}let f=Ja(e.finalClass,d),p;switch(c){case`add`:case`migrate`:p=a.includes(f)?a:[...a,f];break;case`rename`:{let t=e.row.renameFamilyId||(a[0]??null),n=[f],r=t?s.find(e=>e&&e.id===t):null;if(r&&!u){let i=r.name+`--`;for(let o of a){if(o===t)continue;let a=s.find(e=>e&&e.id===o);if(a)if(a.name.startsWith(i)){let t=a.name.slice(r.name.length),i=a.settings?JSON.parse(JSON.stringify(a.settings)):{};n.push(Ja(e.finalClass+t,i))}else n.push(o)}}p=n;break}case`replace`:if(e.row.renameFamilyId&&!u){let t=s.find(t=>t&&t.id===e.row.renameFamilyId);if(t){let n=t.name+`--`;p=[f,...a.filter(t=>{if(t===e.row.renameFamilyId)return!1;let r=s.find(e=>e&&e.id===t);return!r||!r.name.startsWith(n)})]}else p=[f]}else p=[f];break}for(let t of e.modifierSlugs){let n=Ja(`${e.finalClass}--${t}`,{});p.includes(n)||p.push(n)}if(Ya(e.row.id,p),c===`migrate`&&Us(t.settings,e.row.migrateKeys),r){let t=Gs(e.finalClass,e.blockName);t&&Xa(e.row.id,t)}l++}})}catch(e){for(let[e,t]of c)try{if(Ya(e,t.classIds),t.migrateKeys){let n=Wa(e);n&&n.settings&&Object.assign(n.settings,t.migrateKeys)}t.label!==null&&Xa(e,t.label)}catch{}let t=e instanceof Error?e.message:String(e);return console.warn(`[reBEMer] apply failed after`,l,`mutation(s), rolled back:`,t),{ok:!1,error:`Operation failed and was rolled back: ${t}`}}return l===0?{ok:!1,error:`No elements were modified. The subtree may have changed.`}:{ok:!0,count:l}}function Bs(e,t){for(let n of e){let e=t.find(e=>e&&e.name===n.finalClass);if(!e)continue;let r=Wa(n.row.id);if(!r)continue;let i=Hs(r.settings,n.row.migrateKeys),a=e.settings&&typeof e.settings==`object`?e.settings:{},o=[];for(let[e,t]of Object.entries(i))Object.prototype.hasOwnProperty.call(a,e)&&JSON.stringify(a[e])!==JSON.stringify(t)&&o.push(e.replace(/^_/,``));if(o.length>0){let e=o.join(`, `);return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${e}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Vs(e){let t=new Map;for(let n of e){let e=t.get(n.finalClass)||[];e.push(n),t.set(n.finalClass,e)}for(let[e,n]of t){if(n.length===1)continue;let t=n.filter(e=>Is.has(e.suggestedFrom));if(t.length>1)return{ok:!1,error:`"${e}" is used by ${t.length} rows. Edit one to make it unique.`};let r=1;for(let t of n)Is.has(t.suggestedFrom)||(t.finalClass=`${e}-${r++}`,t.suggestedFrom=`auto-number`)}let n=new Map;for(let t of e){let e=n.get(t.finalClass);if(e)return{ok:!1,error:`"${t.finalClass}" is produced by 2 rows after auto-numbering (one ${e}, one ${t.suggestedFrom}). Pick a different name for one of them.`};n.set(t.finalClass,t.suggestedFrom)}return{ok:!0}}function Hs(e,t){if(!e||!Array.isArray(t))return{};let n={};for(let r of t)js.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Us(e,t){if(!(!e||!Array.isArray(t)))for(let n of t)js.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function Ws(e){let t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(e=>typeof e==`string`&&e.length>0):[]}function Gs(e,t){let n=e;return n===t?Ks(t.replace(/-/g,` `)):(n.startsWith(t+`__`)&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,``),Ks(n.replace(/-/g,` `)))}function Ks(e){return e.replace(/(^|\s)([a-z])/g,(e,t,n)=>t+n.toUpperCase())}var qs=Object.freeze({heading:`heading`,"text-basic":`text`,text:`text`,"text-link":`link`,code:`code`,"post-title":`title`,"post-content":`content`,"post-excerpt":`excerpt`,"post-meta":`meta`,image:`image`,icon:`icon`,"icon-box":`icon`,video:`video`,audio:`audio`,svg:`svg`,logo:`logo`,shape:`shape`,divider:`divider`,separator:`separator`,button:`button`,"button-group":`buttons`,"nav-nested":`nav`,"nav-menu":`nav`,list:`list`,search:`search`,"social-icons":`social`,accordion:`accordion`,"accordion-nested":`accordion`,tabs:`tabs`,"tabs-nested":`tabs`,slider:`slider`,"slider-nested":`slider`,carousel:`carousel`,countdown:`countdown`,counter:`counter`,"progress-bar":`progress`,alert:`alert`,testimonials:`testimonials`,pricing:`pricing`,team:`team`,map:`map`,"google-maps":`map`,breadcrumbs:`breadcrumbs`,pagination:`pagination`,form:`form`,posts:`posts`,"related-posts":`posts`,template:`item`});function Js(){if(typeof window>`u`)return{};let e=window.slashedBricksEditor?.rebemerElementMap;return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Ys(){return{...qs,...Js()}}var Xs=new Set([`section`,`container`,`block`,`div`]);function Zs(e,t=`item`){return!e||typeof e!=`string`||Xs.has(e)?t:Ys()[e]||t}function Qs(e){return typeof e==`string`&&Xs.has(e)}var $s=Object.freeze({heading:`title`,"text-basic":`description`,text:`description`,button:`action`,"button-group":`actions`,"text-link":`link`,logo:`logo`,image:`image`,icon:`icon`,"icon-box":`icon`,svg:`icon`,divider:`divider`});function ec(e){if(typeof e!=`string`)return`item`;let t=e.trim();return Xs.has(t)?Ys()[t]||t:`item`}var tc=J(``),nc=J(`BLOCK`),rc=J(`suggested`),ic=J(` `),ac=J(``),oc=J(`
`),sc=J(``),cc=J(`
`),lc=J(`
`),uc=J(`

No existing classes — a new class will be added instead.

`),dc=J(``),fc=J(`
Rename
`),pc=J(`

Will rename

`),mc=J(`

Will rename

`),hc=J(` `,1),gc=J(`
Replace
`),_c=J(`

All existing classes will be removed from this element.

`),vc=J(`

No existing classes — a new class will be created.

`),yc=J(`

Will remove the selected family and replace with the new class (empty settings). Other classes kept.

`),bc=J(`A class named already exists. On Apply, missing style keys will be merged into it. Conflicting values block the migration — pick a different name or use Add.`,1),xc=J(`A class named already exists globally. Apply will attach the existing class instead of - creating a duplicate.`,1),Sc=J(`

`),Cc=J(` `),wc=J(`Migrate: `,1),Tc=J(`No migratable keys on this element.`),Ec=J(` `),Dc=J(`
`),Oc=J(`
`);function kc(e,t){Je(t,!0);let n=Na(t,`row`,15),r=Na(t,`rootId`,3,``),i=Na(t,`globalClasses`,19,()=>[]),a=Na(t,`removeExisting`,3,!1),o=Na(t,`finalClassNames`,19,()=>[]),s=F(()=>t.mode!==`migrate`),c=F(()=>t.mode===`migrate`),l=F(()=>t.mode===`mixed`),u=F(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:``),d=F(()=>K(l)?n().op??`add`:t.mode===`rename`?`rename`:t.mode===`replace`?`replace`:`add`),f=F(()=>{if(K(d)!==`rename`&&K(d)!==`replace`||!Array.isArray(n().currentClassIds))return[];let e=[];for(let t of n().currentClassIds){let r=i().find(e=>e?.id===t);if(!r||r.name.includes(`--`))continue;let a=n().currentClassIds.filter(e=>i().find(t=>t?.id===e)?.name.startsWith(r.name+`--`)).length;e.push({id:r.id,name:r.name,modCount:a})}for(let t of n().currentClassIds){let n=i().find(e=>e?.id===t);if(!n||!n.name.includes(`--`))continue;let r=n.name.slice(0,n.name.indexOf(`--`));e.some(e=>e.name===r)||e.push({id:n.id,name:n.name,modCount:0})}return e}),p=F(()=>K(f).find(e=>e.id===n().renameFamilyId)??K(f)[0]??null);wr(()=>{K(d)!==`rename`||!K(f).length||K(f).some(e=>e.id===n().renameFamilyId)||n(n().renameFamilyId=K(f)[0].id,!0)});let m=F(()=>n().isBlockRoot===!0&&n().id!==r()),h=F(()=>n().id!==r()),g=F(()=>n().suggestedFrom===`element-type`||n().suggestedFrom===`fallback`),_=F(()=>{if(!o().length||!n().include||!Array.isArray(i()))return null;for(let e of o()){let t=i().find(t=>t&&t.name===e);if(t)return t}return null}),v=F(()=>!Array.isArray(n().modifiers)||n().modifiers.every(e=>!Ds(e)));function y(){n().suggestedFrom!==`user`&&n(n().suggestedFrom=`user`,!0)}function b(e){return e.startsWith(`_`)?e.slice(1):e}var x=Oc();let S;var ee=B(x),te=B(ee);ga(te),D(ee);var ne=H(ee,2),C=B(ne),re=B(C,!0);D(C);var ie=H(C,2),ae=e=>{var t=tc();let r;var i=B(t,!0);D(t),U(e=>{r=oa(t,1,`rebemer-row__type rebemer-row__type--toggle`,null,r,{"rebemer-row__type--block":K(m)}),$(t,`title`,K(m)?`Sub-block root — click to revert to element`:`Click to promote to block root`),t.disabled=!n().include,X(i,e)},[()=>K(m)?`BLOCK`:(n().bricksType||`ELEM`).toUpperCase()]),q(`click`,t,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),Y(e,t)},oe=e=>{Y(e,nc())};Z(ie,e=>{K(h)?e(ae):e(oe,-1)});var se=H(ie,2),ce=e=>{var t=rc();U(()=>$(t,`title`,`Pre-filled from ${n().suggestedFrom===`element-type`?`Bricks element type`:`fallback`}`)),Y(e,t)};Z(se,e=>{K(g)&&n().include&&e(ce)}),D(ne);var le=H(ne,2),ue=B(le),de=B(ue),fe=e=>{var t=ic(),n=B(t,!0);D(t),U(()=>X(n,K(u))),Y(e,t)};Z(de,e=>{K(u)&&e(fe)});var pe=H(de,2);ga(pe),D(ue);var me=H(ue,2),he=e=>{var t=cc(),r=B(t);Q(r,17,()=>n().modifiers,Ki,(e,t,r)=>{var i=oc(),a=B(i);ga(a);var o=H(a,2),s=e=>{var t=ac();U(()=>t.disabled=!n().include),q(`click`,t,()=>{n(n().modifiers=n().modifiers.filter((e,t)=>t!==r),!0)}),Y(e,t)};Z(o,e=>{n().modifiers.length>1&&e(s)}),D(i),U(()=>a.disabled=!n().include),ba(a,()=>n().modifiers[r],e=>n(n().modifiers[r]=e,!0)),Y(e,i)});var i=H(r,2),a=e=>{var t=sc();U(()=>t.disabled=!n().include),q(`click`,t,()=>{n(n().modifiers=[...n().modifiers,``],!0)}),Y(e,t)};Z(i,e=>{K(v)||e(a)}),D(t),Y(e,t)};Z(me,e=>{K(s)&&e(he)}),D(le);var ge=H(le,2),_e=e=>{var t=lc(),r=B(t);let i;var a=H(r,2);let o;var s=H(a,2);let c;D(t),U(()=>{i=oa(r,1,`rebemer-row__op-btn`,null,i,{"rebemer-row__op-btn--on":n().op===`add`}),$(r,`aria-pressed`,n().op===`add`),o=oa(a,1,`rebemer-row__op-btn`,null,o,{"rebemer-row__op-btn--on":n().op===`rename`}),$(a,`aria-pressed`,n().op===`rename`),c=oa(s,1,`rebemer-row__op-btn`,null,c,{"rebemer-row__op-btn--on":n().op===`replace`}),$(s,`aria-pressed`,n().op===`replace`)}),q(`click`,r,()=>{n(n().op=`add`,!0)}),q(`click`,a,()=>{n(n().op=`rename`,!0),!n().renameFamilyId&&K(f).length&&n(n().renameFamilyId=K(f)[0].id,!0)}),q(`click`,s,()=>{n(n().op=`replace`,!0),n(n().renameFamilyId=``,!0)}),Y(e,t)};Z(ge,e=>{K(l)&&n().include&&e(_e)});var ve=H(ge,2),ye=e=>{var t=Mi(),r=V(t),i=e=>{var t=Mi(),r=V(t),i=e=>{Y(e,uc())},o=e=>{var t=hc(),r=V(t),i=e=>{var t=fc(),r=H(B(t),2);Q(r,21,()=>K(f),Ki,(e,t)=>{var n=dc(),r=B(n);D(n);var i={};U(()=>{X(r,`${K(t).name??``}${K(t).modCount>0?` (+ ${K(t).modCount} modifier${K(t).modCount>1?`s`:``})`:``}`),i!==(i=K(t).id)&&(n.value=(n.__value=K(t).id)??``)}),Y(e,n)}),D(r),D(t),da(r,()=>n().renameFamilyId,e=>n(n().renameFamilyId=e,!0)),Y(e,t)};Z(r,e=>{K(f).length>1&&e(i)});var o=H(r,2),s=e=>{let t=F(()=>1+K(p).modCount);var r=Mi(),i=V(r),o=e=>{var t=pc(),n=H(B(t)),r=B(n,!0);D(n);var i=H(n);D(t),U(()=>{X(r,K(p).name),X(i,`${K(p).modCount>0?` (+ ${K(p).modCount} modifier${K(p).modCount>1?`s`:``})`:``} and remove all other classes from this element.`)}),Y(e,t)},s=e=>{var r=mc(),i=H(B(r)),a=B(i,!0);D(i);var o=H(i);D(r),U(()=>{X(a,K(p).name),X(o,`${K(p).modCount>0?` (+ ${K(p).modCount} modifier${K(p).modCount>1?`s`:``})`:``}${(n().currentClassIds?.length??0)>K(t)?` Other classes kept.`:``}`)}),Y(e,r)};Z(i,e=>{a()?e(o):e(s,-1)}),Y(e,r)};Z(o,e=>{K(p)&&e(s)}),Y(e,t)};Z(r,e=>{K(f).length===0?e(i):e(o,-1)}),Y(e,t)},o=e=>{var t=hc(),r=V(t),i=e=>{var t=gc(),r=H(B(t),2),i=B(r);i.value=i.__value=``,Q(H(i),17,()=>K(f),Ki,(e,t)=>{var n=dc(),r=B(n);D(n);var i={};U(()=>{X(r,`${K(t).name??``}${K(t).modCount>0?` (+ ${K(t).modCount} modifier${K(t).modCount>1?`s`:``})`:``}`),i!==(i=K(t).id)&&(n.value=(n.__value=K(t).id)??``)}),Y(e,n)}),D(r),D(t),U(()=>r.disabled=a()),da(r,()=>n().renameFamilyId,e=>n(n().renameFamilyId=e,!0)),Y(e,t)};Z(r,e=>{K(f).length>0&&e(i)});var o=H(r,2),s=e=>{Y(e,_c())},c=e=>{Y(e,vc())},l=e=>{Y(e,yc())},u=e=>{Y(e,_c())};Z(o,e=>{a()?e(s):K(f).length===0?e(c,1):n().renameFamilyId?e(l,2):e(u,-1)}),Y(e,t)};Z(r,e=>{K(d)===`rename`?e(i):e(o,-1)}),Y(e,t)};Z(ve,e=>{(K(d)===`rename`||K(d)===`replace`)&&n().include&&e(ye)});var be=H(ve,2),xe=e=>{var t=Sc(),n=B(t),r=e=>{var t=bc(),n=H(V(t)),r=B(n,!0);D(n),ze(),U(()=>X(r,K(_).name)),Y(e,t)},i=e=>{var t=xc(),n=H(V(t)),r=B(n,!0);D(n),ze(),U(()=>X(r,K(_).name)),Y(e,t)};Z(n,e=>{K(c)?e(r):e(i,-1)}),D(t),Y(e,t)};Z(be,e=>{K(_)&&e(xe)});var Se=H(be,2),Ce=e=>{var t=Dc(),r=B(t),i=e=>{var t=wc();Q(H(V(t),2),17,()=>n().migrateKeys,Ki,(e,t)=>{var n=Cc(),r=B(n,!0);D(n),U(e=>{$(n,`title`,`Will be lifted into ${(o()[0]||`the new class`)??``}`),X(r,e)},[()=>b(K(t))]),Y(e,n)}),Y(e,t)},a=e=>{Y(e,Tc())};Z(r,e=>{n().migrateKeys?.length?e(i):e(a,-1)});var s=H(r,2),c=e=>{var t=Ec(),r=B(t);D(t),U(()=>X(r,`${n().skippedKeys.length??``} skipped`)),Y(e,t)};Z(s,e=>{n().skippedKeys?.length&&e(c)}),D(t),Y(e,t)};Z(Se,e=>{K(c)&&n().include&&e(Ce)}),D(x),U(()=>{S=oa(x,1,`rebemer-row`,null,S,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":K(g)}),ca(x,`--rebemer-row-depth: ${n().depth??0??``}`),X(re,n().originalLabel),$(pe,`placeholder`,t.isRoot?`block-name`:`element-name`),pe.disabled=!n().include}),xa(te,()=>n().include,e=>n(n().include=e,!0)),q(`input`,pe,y),ba(pe,()=>n().name,e=>n(n().name=e,!0)),Y(e,x),Ye()}wi([`click`,`input`]);var Ac=J(` `);function jc(e,t){Je(t,!0);let n=Na(t,`kind`,3,`info`),r=Na(t,`duration`,3,3e3),i=R(!0);wr(()=>{if(!K(i)||r()<=0)return;let e=setTimeout(()=>{z(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(e)});let a=F(()=>n()===`error`?`alert`:`status`);var o=Mi(),s=V(o),c=e=>{var r=Ac(),o=B(r,!0);D(r),U(()=>{oa(r,1,`rebemer-toast rebemer-toast--${n()??``}`),$(r,`role`,K(a)),$(r,`aria-live`,n()===`error`?`assertive`:`polite`),X(o,t.message)}),q(`click`,r,()=>{z(i,!1),t.onDismiss?.()}),Y(e,r)};Z(s,e=>{K(i)&&e(c)}),Y(e,o),Ye()}wi([`click`]);var Mc=J(``),Nc=J(`Will migrate `,1),Pc=J(` `),Fc=J(``),Ic=J(` `,1);function Lc(e,t){Je(t,!0);let n={add:`Attaches a new BEM class to each element without removing any existing classes.`,rename:`Renames an existing class family to the new name (its settings carry over). When an element has several classes, pick which family to rename per row; other classes are kept unless "Remove all existing classes" is on.`,replace:`Swaps classes for a new BEM class with empty settings. Pick a family to replace just that one (keeping the rest), or leave "— All classes —" / enable "Remove all existing classes" to clear the element.`,migrate:`Lifts inline element styles (padding, color, typography, etc.) into a new global class.`,mixed:`Per-element control — every row defaults to Add. Switch any row to Rename (targets one class family, keeps others) or Replace (a selected family, or all classes). "Remove all existing classes" clears every renamed/replaced row.`};function r(e){return e===`rename`||e===`replace`||e===`mixed`}function i(e){let t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(e=>typeof e==`string`&&e.length>0):[]}let a=R(`add`),o=R(!0),s=R(!1),c=R(er([])),l=R(er([])),u=R(null),d=R(null),f=F(()=>K(c)[0]?.originalLabel??``),p=F(()=>K(c).length===0?new Map:Ls(K(c),t.rootId)),m=F(()=>{if(K(a)!==`migrate`)return null;let e=0,t=0;for(let n of K(c))n.include&&(e+=n.migrateKeys?.length??0,t+=n.skippedKeys?.length??0);return{willMigrate:e,willSkip:t}}),h=F(()=>{if(K(c).length===0)return new Map;let e=Rs({rootId:t.rootId,rows:K(c),mode:K(a)}),n=new Map;if(!e.ok)return n;for(let t of e.ops){let e=[t.finalClass];for(let n of t.modifierSlugs??[])e.push(`${t.finalClass}--${n}`);n.set(t.row.id,e)}return n});Pa(()=>{let e=Ga(t.rootId);z(l,qa().slice(),!0);let n=e.map((e,t)=>{let n=t===0,r=e.label||``,a=Ds(r),o=e.name||``,s,c;if(a)s=a,c=`label`;else if(n)s=`block`,c=`fallback`;else if(o&&!Qs(o)){let e=Zs(o,``);if(e)s=e,c=`element-type`;else{let e=Ds(Za(o));e&&As(e).ok?(s=e,c=`element-type`):(s=`item`,c=`fallback`)}}else s=`item`,c=`fallback`;let l=i(e.settings);return{id:e.id,depth:e.depth,bricksType:o,originalLabel:r||(n?`block`:`element`),name:s,modifiers:[``],isBlockRoot:!1,include:!0,suggestedFrom:c,migrateKeys:Ms(e.settings),skippedKeys:Ps(e.settings),currentClassCount:l.length,currentClassIds:l,op:`add`,renameFamilyId:``}});if(n.length>1){let t=new Map(e.map(e=>[e.id,[]])),r=[];for(let n of e){for(;r.length&&r[r.length-1].depth>=n.depth;)r.pop();r.length&&t.get(r[r.length-1].id).push(n.id),r.push(n)}let i=new Map(e.map(e=>[e.id,e])),a=new Map(n.map(e=>[e.id,e]));for(let[,e]of t){if(!e.length)continue;let t=new Map;for(let n of e){let e=i.get(n)?.name;e&&t.set(e,(t.get(e)??0)+1)}for(let n of e){let e=a.get(n),r=i.get(n);if(!(!e||!r||e.suggestedFrom===`label`)){if(Qs(r.name))e.name=ec(r.name),e.suggestedFrom=`element-type`;else if((t.get(r.name)??0)===1){let t=$s[r.name];t&&(e.name=t,e.suggestedFrom=`element-type`)}}}}}z(c,n,!0)});function g(e){if(e.key===`Escape`){t.onClose?.();return}K(d)&&e.target instanceof Node&&K(d).contains(e.target)&&e.key===`Enter`&&(e.target?.tagName===`INPUT`||e.target?.tagName===`SELECT`)&&(e.preventDefault(),v())}let _=null;function v(){let e=As(Ds(K(c)[0]?.name??``));if(!e.ok){z(u,{kind:`error`,message:e.reason},!0);return}for(let e of K(c)){if(!e.isBlockRoot||!e.include)continue;let t=As(Ds(e.name??``));if(!t.ok){z(u,{kind:`error`,message:`Sub-block "${e.originalLabel}": ${t.reason}`},!0);return}}let n=zs({rootId:t.rootId,rows:K(c),mode:K(a),syncLabels:K(o),removeExisting:K(s)});n.ok?(z(u,{kind:`success`,message:`Applied to ${n.count} element${n.count===1?``:`s`}.`},!0),_&&clearTimeout(_),_=setTimeout(()=>t.onClose?.(),800)):z(u,{kind:`error`,message:n.error},!0)}wr(()=>()=>{_&&clearTimeout(_)});var y=Ic();Ci(`keydown`,rr,g);var b=V(y),x=B(b),S=B(x),ee=H(B(S)),te=B(ee,!0);D(ee),D(S);var ne=H(S,2);D(x);var C=H(x,2),re=B(C),ie=H(B(re),2),ae=B(ie);ae.value=ae.__value=`add`;var oe=H(ae);oe.value=oe.__value=`rename`;var se=H(oe);se.value=se.__value=`replace`;var ce=H(se);ce.value=ce.__value=`migrate`;var le=H(ce);le.value=le.__value=`mixed`,D(ie),D(re);var ue=H(re,2),de=B(ue);ga(de),ze(2),D(ue);var fe=H(ue,2),pe=e=>{var t=Mc(),n=B(t);ga(n),ze(2),D(t),xa(n,()=>K(s),e=>z(s,e)),Y(e,t)},me=F(()=>r(K(a)));Z(fe,e=>{K(me)&&e(pe)}),D(C);var he=H(C,2),ge=B(he,!0);D(he);var _e=H(he,2),ve=e=>{var t=Fc();let n;var r=B(t),i=e=>{Y(e,ji(`No migratable style keys found on any included element. Apply will attach empty classes.`))},a=e=>{var t=Nc(),n=H(V(t)),r=B(n,!0);D(n);var i=H(n);U(()=>{X(r,K(m).willMigrate),X(i,` style key${K(m).willMigrate===1?``:`s`} into new classes.`)}),Y(e,t)};Z(r,e=>{K(m).willMigrate===0?e(i):e(a,-1)});var o=H(r,2),s=e=>{var t=Pc(),n=B(t);D(t),U(()=>X(n,`${K(m).willSkip??``} key${K(m).willSkip===1?``:`s`} not on the allowlist will stay on the element.`)),Y(e,t)};Z(o,e=>{K(m).willSkip>0&&e(s)}),D(t),U(()=>n=oa(t,1,`rebemer-panel__notice`,null,n,{"rebemer-panel__notice--warn":K(m).willSkip>0||K(m).willMigrate===0})),Y(e,t)};Z(_e,e=>{K(m)&&e(ve)});var ye=H(_e,2);Q(ye,23,()=>K(c),e=>e.id,(e,n,r)=>{{let i=F(()=>K(p).get(K(n).id)??``),o=F(()=>K(n).id===t.rootId||K(n).isBlockRoot),u=F(()=>K(h).get(K(n).id)??[]);kc(e,{get mode(){return K(a)},get blockName(){return K(i)},get isRoot(){return K(o)},get rootId(){return t.rootId},get globalClasses(){return K(l)},get removeExisting(){return K(s)},get finalClassNames(){return K(u)},get row(){return K(c)[K(r)]},set row(e){K(c)[K(r)]=e}})}}),D(ye);var be=H(ye,2),xe=B(be),Se=H(xe,2);D(be),D(b),Ma(b,e=>z(d,e),()=>K(d));var Ce=H(b,2),we=e=>{jc(e,{get kind(){return K(u).kind},get message(){return K(u).message},onDismiss:()=>{z(u,null)}})};Z(Ce,e=>{K(u)&&e(we)}),U(()=>{X(te,K(f)),X(ge,n[K(a)])}),q(`click`,ne,()=>t.onClose?.()),da(ie,()=>K(a),e=>z(a,e)),xa(de,()=>K(o),e=>z(o,e)),q(`click`,xe,()=>t.onClose?.()),q(`click`,Se,v),Y(e,y),Ye()}wi([`click`]);var Rc=J(``);function zc(e,t){var n=Rc();let r;U(()=>{r=oa(n,1,`slashed-cp-launch`,null,r,{"slashed-cp-launch--on":t.open}),$(n,`aria-pressed`,t.open)}),q(`click`,n,function(...e){t.onToggle?.apply(this,e)}),Y(e,n)}wi([`click`]);var Bc=`--sf-color-`,Vc=[`primary`,`secondary`,`tertiary`,`action`,`neutral`,`base`],Hc=[`success`,`warning`,`error`,`info`,`danger`],Uc=[`a5`,`a10`,`a20`,`a30`,`a40`,`a50`,`a60`,`a70`,`a80`,`a90`,`a95`],Wc=[`superlight`,`xlight`,`lighter`,`darker`,`xdark`,`superdark`,`hover`,`active`,`strong`,`subtle`,`muted`,`ghost`],Gc=[`text`,`heading`,`bg`,`surface`,`inset`,`raised`,`overlay`,`inverse`,`border`,`link`,`code`,`selection`,`mark`,`dim`],Kc=(e=>new Set(e))([...Vc,...Hc]),qc={primary:{tagline:`Brand identity & main emphasis`,use:`Headlines, primary buttons, key brand moments.`},secondary:{tagline:`Supporting brand tone`,use:`Secondary surfaces and muted brand accents.`},tertiary:{tagline:`Accent / highlight`,use:`Badges, tags, decorative highlights.`},action:{tagline:`Interactive & links`,use:`Links, focus rings, anything clickable.`},neutral:{tagline:`Text, icons & dividers`,use:`Body text, borders, neutral UI chrome.`},base:{tagline:`Page & surface backgrounds`,use:`Page background and raised surfaces.`},success:{tagline:`Positive / confirmation`,use:`Success messages and valid state.`},warning:{tagline:`Caution`,use:`Warnings and at-risk / pending state.`},error:{tagline:`Form & validation errors`,use:`Invalid inputs and error messages.`},info:{tagline:`Informational`,use:`Tips and neutral notices.`},danger:{tagline:`Destructive actions`,use:`Delete / remove and irreversible actions.`},semantic:{tagline:`Ready-made role tokens`,use:`Pre-wired roles that already adapt to light/dark.`}},Jc=[{id:`text-on`,label:`Text on color`,match:e=>e.startsWith(`text--on`)},{id:`text`,label:`Text`,match:e=>e===`text`||e===`heading`||e.startsWith(`text-`)},{id:`state`,label:`Interactive states`,match:e=>e.startsWith(`bg--`)},{id:`surface`,label:`Surfaces & backgrounds`,match:e=>[`bg`,`surface`,`inset`,`raised`,`overlay`,`inverse`].some(t=>e===t||e.startsWith(t+`-`))},{id:`border`,label:`Borders`,match:e=>e===`border`||e.startsWith(`border-`)},{id:`link`,label:`Links`,match:e=>e===`link`||e.startsWith(`link-`)},{id:`select`,label:`Selection & marks`,match:e=>e.startsWith(`selection`)||e.startsWith(`mark`)||e===`dim`},{id:`code`,label:`Code`,match:e=>e.startsWith(`code`)}];function Yc(e){if(typeof e!=`string`||e.indexOf(Bc)!==0)return null;let t=e.slice(11);if(!t||t===`scheme`)return null;let n=t.indexOf(`-`),r=n===-1?t:t.slice(0,n);if(!Kc.has(r))return{family:`semantic`,kind:`semantic`,step:null,key:t};let i=n===-1?``:t.slice(n+1);return i===``?{family:r,kind:`base`,step:null,key:t}:i===`light`?null:/^[0-9]+$/.test(i)?{family:r,kind:`scale`,step:Number(i),key:t}:/^a[0-9]+$/.test(i)?{family:r,kind:`alpha`,step:i,key:t}:{family:r,kind:`alias`,step:i,key:t}}function Xc(e){return e.kind===`alpha`?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function Zc(e){switch(e.kind){case`base`:return Qc(e.family);case`scale`:return String(e.step);case`alpha`:return String(e.step).toUpperCase();case`alias`:return Qc(String(e.step));default:return $c(e.key)}}function Qc(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function $c(e){return e.split(`--`).map(e=>e.split(`-`).map(Qc).join(` `)).join(` · `)}function el(e,t,n,r){let i=n[e];if(typeof i!=`string`||!i)return null;let a=typeof r[e]==`string`&&r[e]?r[e]:i;return{var:e,name:e.slice(2),label:Zc(t),light:i,dark:a,alpha:Xc(t)}}function tl(e,t){let n={base:0,scale:1,alias:2,alpha:3};if(n[e.info.kind]!==n[t.info.kind])return n[e.info.kind]-n[t.info.kind];if(e.info.kind===`scale`)return e.info.step-t.info.step;if(e.info.kind===`alpha`)return Uc.indexOf(e.info.step)-Uc.indexOf(t.info.step);if(e.info.kind===`alias`){let n=Wc.indexOf(e.info.step),r=Wc.indexOf(t.info.step),i=n===-1?999:n,a=r===-1?999:r;return i===a?String(e.info.step).localeCompare(String(t.info.step)):i-a}return 0}function nl(e,t){let n=Gc.findIndex(t=>e.info.key===t||e.info.key.startsWith(t+`-`)),r=Gc.findIndex(e=>t.info.key===e||t.info.key.startsWith(e+`-`)),i=n===-1?Gc.length:n,a=r===-1?Gc.length:r;return i===a?e.info.key.localeCompare(t.info.key):i-a}function rl(e,t,n){let r=Array.isArray(e)?e:[],i=t&&typeof t==`object`?t:{},a=n&&typeof n==`object`?n:{},o=new Map,s=[];for(let e of r){let t=Yc(e);if(!t)continue;let n=el(e,t,i,a);if(!n)continue;let r={swatch:n,info:t};if(t.family===`semantic`){s.push(r);continue}o.has(t.family)||o.set(t.family,[]),o.get(t.family).push(r)}let c=[],l=(e,t)=>{let n=o.get(e);if(!n||n.length===0)return;n.sort(tl);let r=n.filter(e=>e.info.kind===`base`||e.info.kind===`scale`),i=n.filter(e=>e.info.kind===`alias`),a=n.filter(e=>e.info.kind===`alpha`),s=[];r.length&&s.push({id:`scale`,label:`Shades & tints`,swatches:r.map(e=>e.swatch)}),a.length&&s.push({id:`alpha`,label:`Transparent`,swatches:a.map(e=>e.swatch)}),i.length&&s.push({id:`alias`,label:`Semantic`,swatches:i.map(e=>e.swatch)});let l=qc[e]||{};c.push({id:e,label:Qc(e),type:t,count:n.length,tagline:l.tagline||``,use:l.use||``,sections:s})};for(let e of Vc)l(e,`brand`);for(let e of Hc)l(e,`status`);if(s.length){s.sort(nl);let e=new Map(Jc.map(e=>[e.id,[]])),t=[];for(let n of s){let r=Jc.find(e=>e.match(n.info.key));r?e.get(r.id).push(n.swatch):t.push(n.swatch)}let n=[];for(let t of Jc){let r=e.get(t.id);r.length&&n.push({id:t.id,label:t.label,swatches:r})}t.length&&n.push({id:`other`,label:`Other`,swatches:t});let r=qc.semantic||{};c.push({id:`semantic`,label:`Semantic`,type:`semantic`,count:s.length,tagline:r.tagline||``,use:r.use||``,sections:n})}return{groups:c}}function il(e,t){let n=String(t||``).trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};let r=[];for(let t of e.groups){let e=[];for(let r of t.sections){let i=r.swatches.filter(e=>e.name.toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||t.label.toLowerCase().includes(n));i.length&&e.push({...r,swatches:i})}if(e.length){let n=e.reduce((e,t)=>e+t.swatches.length,0);r.push({...t,sections:e,count:n})}}return{groups:r}}function al(e){return`var(${e.var})`}function ol(e,t){return t===`dark`?e.dark:e.light}var sl=[{id:`typography`,label:`Typography`,tokens:[{var:`--sf-color-heading`,label:`Heading`},{var:`--sf-color-text`,label:`Text`},{var:`--sf-color-text--muted`,label:`Text · Muted`},{var:`--sf-color-text--secondary`,label:`Text · Secondary`},{var:`--sf-color-text--on-primary`,label:`On Primary`},{var:`--sf-color-text--on-secondary`,label:`On Secondary`}]},{id:`surfaces`,label:`Surfaces`,tokens:[{var:`--sf-color-bg`,label:`Background`},{var:`--sf-color-surface`,label:`Surface`},{var:`--sf-color-raised`,label:`Raised`},{var:`--sf-color-inset`,label:`Inset`},{var:`--sf-color-overlay`,label:`Overlay`},{var:`--sf-color-inverse`,label:`Inverse`}]},{id:`structure`,label:`Structure`,tokens:[{var:`--sf-color-border`,label:`Border`},{var:`--sf-color-border--subtle`,label:`Border · Subtle`},{var:`--sf-color-border--strong`,label:`Border · Strong`},{var:`--sf-color-link`,label:`Link`},{var:`--sf-color-link--hover`,label:`Link · Hover`}]},{id:`brand`,label:`Brand`,tokens:[{var:`--sf-color-primary`,label:`Primary`},{var:`--sf-color-secondary`,label:`Secondary`},{var:`--sf-color-tertiary`,label:`Tertiary`},{var:`--sf-color-action`,label:`Action`},{var:`--sf-color-neutral`,label:`Neutral`},{var:`--sf-color-base`,label:`Base`}]},{id:`feedback`,label:`Feedback`,tokens:[{var:`--sf-color-success`,label:`Success`},{var:`--sf-color-success-subtle`,label:`Success · Subtle`},{var:`--sf-color-warning`,label:`Warning`},{var:`--sf-color-warning-subtle`,label:`Warning · Subtle`},{var:`--sf-color-error`,label:`Error`},{var:`--sf-color-error-subtle`,label:`Error · Subtle`},{var:`--sf-color-info`,label:`Info`},{var:`--sf-color-danger`,label:`Danger`}]}];function cl(e,t,n){let r=t&&typeof t==`object`?t:{},i=n&&typeof n==`object`?n:{},a=[];for(let e of sl){let t=[];for(let n of e.tokens){let e=r[n.var];if(!e)continue;let a=i[n.var]||e;t.push({var:n.var,name:n.var.slice(2),label:n.label,light:e,dark:a,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(n.var)})}t.length&&a.push({id:e.id,label:e.label,swatches:t})}return{groups:a}}var ll=J(``);function ul(e,t){Je(t,!0);let n=Na(t,`onPick`,3,void 0),r=F(()=>`${t.swatch.name}\nlight ${t.swatch.light} · dark ${t.swatch.dark}`);var i=ll();let a;U(e=>{a=oa(i,1,`slashed-cp-swatch`,null,a,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode===`both`}),ca(i,`--cp-l:${t.swatch.light??``}; --cp-d:${t.swatch.dark??``}; --cp-solid:${e??``};`),$(i,`title`,K(r)),$(i,`aria-label`,t.swatch.name)},[()=>ol(t.swatch,t.mode===`dark`?`dark`:`light`)]),q(`click`,i,()=>n()?.(t.swatch)),Y(e,i),Ye()}wi([`click`]);var dl=J(``),fl=J(``),pl=J(``),ml=J(`
`),hl=J(`

`,1),gl=J(``),_l=J(`

Scale 50 → 950

`,1),vl=J(``),yl=J(`
`),bl=J(` `,1),xl=J(`
`),Sl=J(`
`),Cl=J(`
`),wl=J(``),Tl=J(`

`),El=J(` `),Dl=J(``),Ol=J(`
  • `),kl=J(`
      `),Al=J(`
      `),jl=J(` `,1),Ml=J(`

      `),Nl=J(``),Pl=J(`

      `),Fl=J(`

      Quick Use

      Palette

      Brand

      Status

      `,1),Il=J(``),Ll=J(`

      Color System

      var()
      `,1);function Rl(e,t){Je(t,!0);let n=(e,t=d)=>{var n=Cl();Q(n,21,t,e=>e.id,(e,t)=>{let n=F(()=>oe(K(t))),r=F(()=>se(K(t))),i=F(()=>K(u)===K(t).id);var a=Sl(),o=B(a);let c;var l=B(o),d=e=>{var t=dl();U(()=>ca(t,`--sw-l: ${K(n).light??``}; --sw-d: ${K(n).dark??``}`)),Y(e,t)};Z(l,e=>{K(n)&&e(d)});var p=H(l,2),m=B(p,!0);D(p);var h=H(p,2),g=B(h,!0);D(h);var _=H(h,2);Q(_,21,()=>K(r),e=>e.var,(e,t)=>{var n=fl();U(()=>{ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`),$(n,`title`,K(t).label)}),Y(e,n)}),D(_);var v=H(_,2),y=B(v,!0);D(v),D(o);var b=H(o,2),x=e=>{let r=F(()=>ae(K(t),`alias`)),i=F(()=>ce(K(t))),a=F(()=>ae(K(t),`alpha`));var o=xl(),c=B(o),l=e=>{var r=pl(),i=B(r),a=B(i,!0);D(i),D(r),U(()=>{ca(r,`--sw-l: ${K(n).light??``}; --sw-d: ${K(n).dark??``}`),$(r,`title`,`${K(t).label??``} base — ${K(n).name??``}`),X(a,K(t).label)}),q(`click`,r,()=>C(K(n))),Y(e,r)};Z(c,e=>{K(n)&&e(l)});var u=H(c,2),d=e=>{var t=hl(),n=V(t),i=B(n);D(n);var a=H(n,2);Q(a,21,()=>K(r).swatches,e=>e.var,(e,t)=>{var n=ml(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i),D(n),U(()=>X(a,K(t).label)),Y(e,n)}),D(a),U(()=>X(i,`Aliases · ${K(r).swatches.length??``}`)),Y(e,t)};Z(u,e=>{K(r)?.swatches.length&&e(d)});var p=H(u,2),m=e=>{var t=_l(),n=H(V(t),2);Q(n,21,()=>K(i),e=>e.var,(e,t)=>{var n=gl();U(()=>{$(n,`title`,`${K(t).label??``} — ${K(t).name??``}`),ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(n),Y(e,t)};Z(p,e=>{K(i).length&&e(m)});var h=H(p,2),g=e=>{var n=bl(),r=V(n),i=B(r),o=B(i,!0);D(i),ze(),D(r);var s=H(r,2),c=e=>{var t=yl();Q(t,21,()=>K(a).swatches,e=>e.var,(e,t)=>{var n=vl();U(()=>{$(n,`title`,`${K(t).label??``} — ${K(t).name??``}`),ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(t),Y(e,t)},l=F(()=>K(f).has(K(t).id));Z(s,e=>{K(l)&&e(c)}),U(e=>X(o,e),[()=>K(f).has(K(t).id)?`▾`:`▸`]),q(`click`,r,()=>ie(K(t).id)),Y(e,n)};Z(h,e=>{K(a)?.swatches.length&&e(g)}),D(o),Y(e,o)};Z(b,e=>{K(i)&&e(x)}),D(a),U(()=>{c=oa(o,1,`slashed-cp__scan-row`,null,c,{"slashed-cp__scan-row--open":K(i)}),$(o,`aria-expanded`,K(i)),X(m,K(t).label),X(g,K(t).tagline),X(y,K(i)?`▾`:`▸`)}),q(`click`,o,()=>re(K(t).id)),Y(e,a)}),D(n),Y(e,n)},r=Na(t,`dockedLeft`,3,null),i=F(()=>typeof t.onPickValue==`function`),a=[{id:`both`,label:`Both`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],o=[`Hover`,`Active`,`Subtle`,`Ghost`,`Superlight`],s=R(`both`),c=R(``),l=R(null),u=R(null),f=R(er(new Set)),p=F(()=>rl(t.source?.variables,t.source?.light,t.source?.dark)),m=F(()=>K(c).trim()),h=F(()=>il(K(p),K(m))),g=F(()=>cl(t.source?.variables,t.source?.light,t.source?.dark)),_=F(()=>K(p).groups.reduce((e,t)=>e+t.count,0)),v=F(()=>K(p).groups.filter(e=>e.type===`brand`)),y=F(()=>K(p).groups.filter(e=>e.type===`status`)),b;function x(){if(typeof document>`u`)return null;let e=document.querySelector(`iframe#bricks-builder-iframe, iframe[name="bricks-builder-iframe"], #bricks-builder-area iframe`);try{return e?.contentDocument?.documentElement??null}catch{return null}}function S(e){let t=x();if(t)try{b===void 0&&(b=t.getAttribute(`data-theme`)),e===`light`||e===`dark`?t.setAttribute(`data-theme`,e):b===null?t.removeAttribute(`data-theme`):t.setAttribute(`data-theme`,b)}catch{}}function ee(){let e=x();if(!(!e||b===void 0))try{b===null?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,b)}catch{}}function te(e){z(s,e,!0),S(e)}Pa(()=>()=>ee());async function ne(e){try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;opacity:0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}async function C(e){let n=al(e);if(K(i)){if(t.onPickValue(n)===!1){z(l,{kind:`error`,message:`Couldn't apply ${n} — input not found`},!0);return}t.onPick?.();return}z(l,await ne(n)?{kind:`info`,message:`Copied — ${e.name}`}:{kind:`error`,message:`Couldn't copy ${n}`},!0)}function re(e){z(u,K(u)===e?null:e,!0),z(f,new Set,!0)}function ie(e){let t=new Set(K(f));t.has(e)?t.delete(e):t.add(e),z(f,t,!0)}function ae(e,t){return e.sections.find(e=>e.id===t)}function oe(e){return ae(e,`scale`)?.swatches[0]??null}function se(e){let t=ae(e,`alias`);if(!t?.swatches.length)return[];let n=o.map(e=>t.swatches.find(t=>t.label===e)).filter(Boolean);return n.length?n:t.swatches.slice(0,5)}function ce(e){return ae(e,`scale`)?.swatches.slice(1)??[]}function le(e){e.key===`Escape`&&t.onClose?.()}var ue=Ll();Ci(`keydown`,rr,le);var de=V(ue);let fe;var pe=B(de),me=H(B(pe),2);Q(me,21,()=>a,e=>e.id,(e,t)=>{var n=wl();let r;var i=B(n,!0);D(n),U(()=>{r=oa(n,1,`slashed-cp__seg-btn`,null,r,{"slashed-cp__seg-btn--on":K(s)===K(t).id}),$(n,`aria-pressed`,K(s)===K(t).id),X(i,K(t).label)}),q(`click`,n,()=>te(K(t).id)),Y(e,n)}),D(me);var he=H(me,2);D(pe);var ge=H(pe,2),_e=B(ge);ga(_e),D(ge);var ve=H(ge,2),ye=B(ve),be=e=>{var t=jl(),n=V(t),r=e=>{var t=Tl(),n=B(t);D(t),U(()=>X(n,`No tokens match "${K(m)??``}".`)),Y(e,t)};Z(n,e=>{K(h).groups.length===0&&e(r)}),Q(H(n,2),17,()=>K(h).groups,e=>e.id,(e,t)=>{var n=Ml(),r=B(n),i=B(r),a=B(i),o=H(a),c=e=>{var n=El(),r=B(n,!0);D(n),U(()=>X(r,K(t).tagline)),Y(e,n)};Z(o,e=>{K(t).tagline&&e(c)});var l=H(o,2),u=B(l,!0);D(l),D(i),D(r),Q(H(r,2),17,()=>K(t).sections,e=>e.id,(e,n)=>{var r=jl(),i=V(r),a=e=>{var t=Dl(),r=B(t,!0);D(t),U(()=>X(r,K(n).label)),Y(e,t)};Z(i,e=>{K(n).label&&e(a)});var o=H(i,2),c=e=>{var t=kl();Q(t,21,()=>K(n).swatches,e=>e.var,(e,t)=>{var n=Ol(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i);var o=H(i,2),c=B(o,!0);D(o),D(n),U(()=>{X(a,K(t).label),X(c,K(t).name)}),Y(e,n)}),D(t),Y(e,t)},l=e=>{var t=Al();Q(t,21,()=>K(n).swatches,e=>e.var,(e,t)=>{var n=ml(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i),D(n),U(()=>X(a,K(t).label)),Y(e,n)}),D(t),Y(e,t)};Z(o,e=>{K(t).type===`semantic`?e(c):e(l,-1)}),Y(e,r)}),D(n),U(()=>{$(n,`data-type`,K(t).type),X(a,`${K(t).label??``} `),X(u,K(t).count)}),Y(e,n)}),Y(e,t)},xe=e=>{var t=Fl(),r=V(t);Q(H(B(r),2),17,()=>K(g).groups,e=>e.id,(e,t)=>{var n=Pl(),r=B(n),i=B(r,!0);D(r);var a=H(r,2);Q(a,21,()=>K(t).swatches,e=>e.var,(e,t)=>{var n=Nl(),r=B(n);let i;var a=H(r,2),o=B(a,!0);D(a),D(n),U(()=>{$(n,`title`,K(t).name),i=oa(r,1,`slashed-cp__qu-sw`,null,i,{"slashed-cp__qu-sw--alpha":K(t).alpha}),ca(r,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`),X(o,K(t).label)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(a),D(n),U(()=>X(i,K(t).label)),Y(e,n)}),D(r);var i=H(r,2),a=H(B(i),4);n(a,()=>K(v)),n(H(a,4),()=>K(y)),D(i),Y(e,t)};Z(ye,e=>{K(m)?e(be):e(xe,-1)}),D(ve);var Se=H(ve,2),Ce=B(Se),we=e=>{Y(e,Il())};Z(Ce,e=>{K(s)===`both`&&e(we)});var Te=H(Ce,2),Ee=B(Te);ze(),D(Te),D(Se),D(de);var De=H(de,2),Oe=e=>{jc(e,{get kind(){return K(l).kind},get message(){return K(l).message},onDismiss:()=>{z(l,null)}})};Z(De,e=>{K(l)&&e(Oe)}),U(()=>{fe=oa(de,1,`slashed-cp`,null,fe,{"slashed-cp--docked":K(i)}),$(de,`data-mode`,K(s)),ca(de,K(i)&&r()!=null?`--cp-dock-left: ${r()}px`:``),$(_e,`placeholder`,`Search ${K(_)} tokens…`),X(Ee,`${K(i)?`Click to insert`:`Click to copy`} `)}),q(`click`,de,e=>e.stopPropagation()),q(`mousedown`,de,e=>e.stopPropagation()),q(`pointerdown`,de,e=>e.stopPropagation()),q(`touchstart`,de,e=>e.stopPropagation(),void 0,!0),q(`click`,he,()=>t.onClose?.()),ba(_e,()=>K(c),e=>z(c,e)),Y(e,ue),Ye()}wi([`click`,`mousedown`,`pointerdown`,`touchstart`]);var zl=J(` `,1);function Bl(e,t){let n=R(!1);var r=zl(),i=V(r);zc(i,{get open(){return K(n)},onToggle:()=>z(n,!K(n))});var a=H(i,2),o=e=>{Rl(e,{get source(){return t.source},onClose:()=>z(n,!1)})};Z(a,e=>{K(n)&&e(o)}),Y(e,r)}var Vl=`#bricks-structure`,Hl=`li[data-id]`,Ul=`slashed-rebemer-host`,Wl=400,Gl=25,Kl=(e,...t)=>console[e](`[reBEMer]`,...t),ql=new AbortController,{signal:Jl}=ql,Yl=new Map,Xl=null,Zl=null,Ql=null;function $l(){let e=document.getElementById(Ul);return e||(e=document.createElement(`div`),e.id=Ul,document.body.appendChild(e)),e}var eu=null;function tu(){eu=window.slashedBricksEditor,eu&&typeof eu==`object`&&(To(eu.showClassHints,eu.classHints,{signal:Jl}),Jo(eu.showColorSwatches,eu.colorHexMap,{signal:Jl,onOpenPanel:eu.showColorPanel?e=>uu(e):void 0}),xs(eu.variableHints||{},{signal:Jl}));let e=0,t=()=>{if(!Jl.aborted){if(Va()){nu();return}if(++e>=Gl){Kl(`warn`,`Bricks Vue app not detected after grace window — reBEMer disabled on this page.`);return}setTimeout(t,Wl)}};t()}function nu(){if(ou(),eu&&eu.rebemerEnabled===!1)return;let e=document.querySelector(Vl);if(e){ru(e);return}let t=new MutationObserver(()=>{let e=document.querySelector(Vl);e&&(t.disconnect(),ru(e))});t.observe(document.body,{childList:!0,subtree:!0}),Jl.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function ru(e){let t=null,n=new MutationObserver(()=>{t===null&&(t=setTimeout(()=>{t=null,iu(e)},50))});n.observe(e,{childList:!0,subtree:!0}),Jl.addEventListener(`abort`,()=>{n.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),iu(e)}function iu(e){for(let[e,t]of Yl)if(!t.host.isConnected){try{Li(t.instance)}catch(e){Kl(`warn`,`badge unmount failed`,e)}Yl.delete(e)}let t=e.querySelectorAll(Hl);for(let e of t){let t=e.getAttribute(`data-id`);if(!t)continue;let n=Yl.get(t);n&&n.host.isConnected&&e.contains(n.host)||au(e)}}function au(e){let t=e.getAttribute(`data-id`);if(!t)return;let n=e.querySelector(`:scope > .structure-item`)||e,r=n.querySelector(`:scope > ul.actions`)||n.querySelector(`:scope > .actions`)||n.querySelector(`:scope > .structure-item-actions`),i=document.createElement(`span`);i.className=`rebemer-badge-host`,r?n.insertBefore(i,r):n.appendChild(i);let a=n.querySelector(`:scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label`),o=Ni(Es,{target:i,props:{elementId:t,label:a?a.textContent.trim():``,onActivate:fu}}),s=Yl.get(t);if(s){try{Li(s.instance)}catch(e){Kl(`warn`,`badge remount cleanup failed`,e)}s.host.isConnected&&s.host.remove()}Yl.set(t,{instance:o,host:i})}function ou(){if(Zl)return;let e=eu&&eu.colorPanel;if(!eu?.showColorPanel||!e||!Array.isArray(e.variables)||e.variables.length===0)return;let t=document.createElement(`div`);$l().appendChild(t),Zl={instance:Ni(Bl,{target:t,props:{source:e}}),node:t}}function su(){if(Zl){try{Li(Zl.instance)}catch(e){Kl(`warn`,`color app unmount failed`,e)}Zl.node.remove(),Zl=null}}function cu(e,t){if(!e||!e.isConnected)return!1;try{let n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;return n?n.call(e,t):e.value=t,e.dispatchEvent(new Event(`input`,{bubbles:!0})),!0}catch{return!1}}function lu(e){let t=[`#bricks-panel-inner`,`#bricks-panel`,`[id^="bricks-panel"]`];if(e)for(let n of t){let t=e.closest(n);if(t){let e=t.getBoundingClientRect();if(e.width>100)return Math.ceil(e.right)}}for(let e of t){let t=document.querySelector(e);if(t){let e=t.getBoundingClientRect();if(e.width>100)return Math.ceil(e.right)}}return null}function uu(e){du();let t=eu?.colorPanel;if(!t||!Array.isArray(t.variables)||t.variables.length===0)return;let n=lu(e),r=document.createElement(`div`);$l().appendChild(r),Ql={instance:Ni(Rl,{target:r,props:{source:t,dockedLeft:n,onPickValue:t=>{let n=cu(e?.querySelector(`input[type="text"]`)??e?.querySelector(`input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])`),t);if(n){let n=t.match(/^var\((--[^)]+)\)/)?.[1],r=n?eu?.colorHexMap?.[n]??null:null,i=(e?.closest(`[data-control="color"]`))?.querySelector(`:scope > .slashed-sf-color-btn`);if(i){let e=i.querySelector(`.slashed-sf-color-btn__dot`);e&&(r?(e.style.background=r,e.style.removeProperty(`box-shadow`)):e.style.removeProperty(`background`)),i.classList.toggle(`slashed-sf-color-btn--active`,!!r)}if(r){let t=e?.closest(`[data-control="color"]`);requestAnimationFrame(()=>{if(!t)return;let e=t.querySelector(`.bricks-control-preview`);e&&(Ho(e,!0),e.classList.remove(`empty`))})}}return n},onPick:du,onClose:du}}),node:r}}function du(){if(Ql){try{Li(Ql.instance)}catch(e){Kl(`warn`,`color picker panel unmount failed`,e)}Ql.node.remove(),Ql=null}}function fu(e){pu();let t=document.createElement(`div`);$l().appendChild(t),Xl={instance:Ni(Lc,{target:t,props:{rootId:e,onClose:pu}}),node:t}}function pu(){if(Xl){try{Li(Xl.instance)}catch(e){Kl(`warn`,`panel unmount failed`,e)}Xl.node.remove(),Xl=null}}window.addEventListener(`beforeunload`,()=>{ql.abort(),pu(),su(),du(),Eo(),Yo(),Ss();for(let{instance:e}of Yl.values())try{Li(e)}catch{}Yl.clear()},{once:!0}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,tu,{once:!0}):tu(); + creating a duplicate.`,1),Sc=J(`

      `),Cc=J(` `),wc=J(`Migrate: `,1),Tc=J(`No migratable keys on this element.`),Ec=J(` `),Dc=J(`
      `),Oc=J(`
      `);function kc(e,t){Je(t,!0);let n=Na(t,`row`,15),r=Na(t,`rootId`,3,``),i=Na(t,`globalClasses`,19,()=>[]),a=Na(t,`removeExisting`,3,!1),o=Na(t,`finalClassNames`,19,()=>[]),s=F(()=>t.mode!==`migrate`),c=F(()=>t.mode===`migrate`),l=F(()=>t.mode===`mixed`),u=F(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:``),d=F(()=>K(l)?n().op??`add`:t.mode===`rename`?`rename`:t.mode===`replace`?`replace`:`add`),f=F(()=>{if(K(d)!==`rename`&&K(d)!==`replace`||!Array.isArray(n().currentClassIds))return[];let e=[];for(let t of n().currentClassIds){let r=i().find(e=>e?.id===t);if(!r||r.name.includes(`--`))continue;let a=n().currentClassIds.filter(e=>i().find(t=>t?.id===e)?.name.startsWith(r.name+`--`)).length;e.push({id:r.id,name:r.name,modCount:a})}for(let t of n().currentClassIds){let n=i().find(e=>e?.id===t);if(!n||!n.name.includes(`--`))continue;let r=n.name.slice(0,n.name.indexOf(`--`));e.some(e=>e.name===r)||e.push({id:n.id,name:n.name,modCount:0})}return e}),p=F(()=>K(f).find(e=>e.id===n().renameFamilyId)??K(f)[0]??null);wr(()=>{K(d)!==`rename`||!K(f).length||K(f).some(e=>e.id===n().renameFamilyId)||n(n().renameFamilyId=K(f)[0].id,!0)});let m=F(()=>n().isBlockRoot===!0&&n().id!==r()),h=F(()=>n().id!==r()),g=F(()=>n().suggestedFrom===`element-type`||n().suggestedFrom===`fallback`),_=F(()=>{if(!o().length||!n().include||!Array.isArray(i()))return null;for(let e of o()){let t=i().find(t=>t&&t.name===e);if(t)return t}return null}),v=F(()=>!Array.isArray(n().modifiers)||n().modifiers.every(e=>!Ds(e)));function y(){n().suggestedFrom!==`user`&&n(n().suggestedFrom=`user`,!0)}function b(e){return e.startsWith(`_`)?e.slice(1):e}var x=Oc();let S;var ee=B(x),te=B(ee);ga(te),D(ee);var ne=H(ee,2),C=B(ne),re=B(C,!0);D(C);var ie=H(C,2),ae=e=>{var t=tc();let r;var i=B(t,!0);D(t),U(e=>{r=oa(t,1,`rebemer-row__type rebemer-row__type--toggle`,null,r,{"rebemer-row__type--block":K(m)}),$(t,`title`,K(m)?`Sub-block root — click to revert to element`:`Click to promote to block root`),t.disabled=!n().include,X(i,e)},[()=>K(m)?`BLOCK`:(n().bricksType||`ELEM`).toUpperCase()]),q(`click`,t,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),Y(e,t)},oe=e=>{Y(e,nc())};Z(ie,e=>{K(h)?e(ae):e(oe,-1)});var se=H(ie,2),ce=e=>{var t=rc();U(()=>$(t,`title`,`Pre-filled from ${n().suggestedFrom===`element-type`?`Bricks element type`:`fallback`}`)),Y(e,t)};Z(se,e=>{K(g)&&n().include&&e(ce)}),D(ne);var le=H(ne,2),ue=B(le),de=B(ue),fe=e=>{var t=ic(),n=B(t,!0);D(t),U(()=>X(n,K(u))),Y(e,t)};Z(de,e=>{K(u)&&e(fe)});var pe=H(de,2);ga(pe),D(ue);var me=H(ue,2),he=e=>{var t=cc(),r=B(t);Q(r,17,()=>n().modifiers,Ki,(e,t,r)=>{var i=oc(),a=B(i);ga(a);var o=H(a,2),s=e=>{var t=ac();U(()=>t.disabled=!n().include),q(`click`,t,()=>{n(n().modifiers=n().modifiers.filter((e,t)=>t!==r),!0)}),Y(e,t)};Z(o,e=>{n().modifiers.length>1&&e(s)}),D(i),U(()=>a.disabled=!n().include),ba(a,()=>n().modifiers[r],e=>n(n().modifiers[r]=e,!0)),Y(e,i)});var i=H(r,2),a=e=>{var t=sc();U(()=>t.disabled=!n().include),q(`click`,t,()=>{n(n().modifiers=[...n().modifiers,``],!0)}),Y(e,t)};Z(i,e=>{K(v)||e(a)}),D(t),Y(e,t)};Z(me,e=>{K(s)&&e(he)}),D(le);var ge=H(le,2),_e=e=>{var t=lc(),r=B(t);let i;var a=H(r,2);let o;var s=H(a,2);let c;D(t),U(()=>{i=oa(r,1,`rebemer-row__op-btn`,null,i,{"rebemer-row__op-btn--on":n().op===`add`}),$(r,`aria-pressed`,n().op===`add`),o=oa(a,1,`rebemer-row__op-btn`,null,o,{"rebemer-row__op-btn--on":n().op===`rename`}),$(a,`aria-pressed`,n().op===`rename`),c=oa(s,1,`rebemer-row__op-btn`,null,c,{"rebemer-row__op-btn--on":n().op===`replace`}),$(s,`aria-pressed`,n().op===`replace`)}),q(`click`,r,()=>{n(n().op=`add`,!0)}),q(`click`,a,()=>{n(n().op=`rename`,!0),!n().renameFamilyId&&K(f).length&&n(n().renameFamilyId=K(f)[0].id,!0)}),q(`click`,s,()=>{n(n().op=`replace`,!0),n(n().renameFamilyId=``,!0)}),Y(e,t)};Z(ge,e=>{K(l)&&n().include&&e(_e)});var ve=H(ge,2),ye=e=>{var t=Mi(),r=V(t),i=e=>{var t=Mi(),r=V(t),i=e=>{Y(e,uc())},o=e=>{var t=hc(),r=V(t),i=e=>{var t=fc(),r=H(B(t),2);Q(r,21,()=>K(f),Ki,(e,t)=>{var n=dc(),r=B(n);D(n);var i={};U(()=>{X(r,`${K(t).name??``}${K(t).modCount>0?` (+ ${K(t).modCount} modifier${K(t).modCount>1?`s`:``})`:``}`),i!==(i=K(t).id)&&(n.value=(n.__value=K(t).id)??``)}),Y(e,n)}),D(r),D(t),da(r,()=>n().renameFamilyId,e=>n(n().renameFamilyId=e,!0)),Y(e,t)};Z(r,e=>{K(f).length>1&&e(i)});var o=H(r,2),s=e=>{let t=F(()=>1+K(p).modCount);var r=Mi(),i=V(r),o=e=>{var t=pc(),n=H(B(t)),r=B(n,!0);D(n);var i=H(n);D(t),U(()=>{X(r,K(p).name),X(i,`${K(p).modCount>0?` (+ ${K(p).modCount} modifier${K(p).modCount>1?`s`:``})`:``} and remove all other classes from this element.`)}),Y(e,t)},s=e=>{var r=mc(),i=H(B(r)),a=B(i,!0);D(i);var o=H(i);D(r),U(()=>{X(a,K(p).name),X(o,`${K(p).modCount>0?` (+ ${K(p).modCount} modifier${K(p).modCount>1?`s`:``})`:``}${(n().currentClassIds?.length??0)>K(t)?` Other classes kept.`:``}`)}),Y(e,r)};Z(i,e=>{a()?e(o):e(s,-1)}),Y(e,r)};Z(o,e=>{K(p)&&e(s)}),Y(e,t)};Z(r,e=>{K(f).length===0?e(i):e(o,-1)}),Y(e,t)},o=e=>{var t=hc(),r=V(t),i=e=>{var t=gc(),r=H(B(t),2),i=B(r);i.value=i.__value=``,Q(H(i),17,()=>K(f),Ki,(e,t)=>{var n=dc(),r=B(n);D(n);var i={};U(()=>{X(r,`${K(t).name??``}${K(t).modCount>0?` (+ ${K(t).modCount} modifier${K(t).modCount>1?`s`:``})`:``}`),i!==(i=K(t).id)&&(n.value=(n.__value=K(t).id)??``)}),Y(e,n)}),D(r),D(t),U(()=>r.disabled=a()),da(r,()=>n().renameFamilyId,e=>n(n().renameFamilyId=e,!0)),Y(e,t)};Z(r,e=>{K(f).length>0&&e(i)});var o=H(r,2),s=e=>{Y(e,_c())},c=e=>{Y(e,vc())},l=e=>{Y(e,yc())},u=e=>{Y(e,_c())};Z(o,e=>{a()?e(s):K(f).length===0?e(c,1):n().renameFamilyId?e(l,2):e(u,-1)}),Y(e,t)};Z(r,e=>{K(d)===`rename`?e(i):e(o,-1)}),Y(e,t)};Z(ve,e=>{(K(d)===`rename`||K(d)===`replace`)&&n().include&&e(ye)});var be=H(ve,2),xe=e=>{var t=Sc(),n=B(t),r=e=>{var t=bc(),n=H(V(t)),r=B(n,!0);D(n),ze(),U(()=>X(r,K(_).name)),Y(e,t)},i=e=>{var t=xc(),n=H(V(t)),r=B(n,!0);D(n),ze(),U(()=>X(r,K(_).name)),Y(e,t)};Z(n,e=>{K(c)?e(r):e(i,-1)}),D(t),Y(e,t)};Z(be,e=>{K(_)&&e(xe)});var Se=H(be,2),Ce=e=>{var t=Dc(),r=B(t),i=e=>{var t=wc();Q(H(V(t),2),17,()=>n().migrateKeys,Ki,(e,t)=>{var n=Cc(),r=B(n,!0);D(n),U(e=>{$(n,`title`,`Will be lifted into ${(o()[0]||`the new class`)??``}`),X(r,e)},[()=>b(K(t))]),Y(e,n)}),Y(e,t)},a=e=>{Y(e,Tc())};Z(r,e=>{n().migrateKeys?.length?e(i):e(a,-1)});var s=H(r,2),c=e=>{var t=Ec(),r=B(t);D(t),U(()=>X(r,`${n().skippedKeys.length??``} skipped`)),Y(e,t)};Z(s,e=>{n().skippedKeys?.length&&e(c)}),D(t),Y(e,t)};Z(Se,e=>{K(c)&&n().include&&e(Ce)}),D(x),U(()=>{S=oa(x,1,`rebemer-row`,null,S,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":K(g)}),ca(x,`--rebemer-row-depth: ${n().depth??0??``}`),X(re,n().originalLabel),$(pe,`placeholder`,t.isRoot?`block-name`:`element-name`),pe.disabled=!n().include}),xa(te,()=>n().include,e=>n(n().include=e,!0)),q(`input`,pe,y),ba(pe,()=>n().name,e=>n(n().name=e,!0)),Y(e,x),Ye()}wi([`click`,`input`]);var Ac=J(` `);function jc(e,t){Je(t,!0);let n=Na(t,`kind`,3,`info`),r=Na(t,`duration`,3,3e3),i=R(!0);wr(()=>{if(!K(i)||r()<=0)return;let e=setTimeout(()=>{z(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(e)});let a=F(()=>n()===`error`?`alert`:`status`);var o=Mi(),s=V(o),c=e=>{var r=Ac(),o=B(r,!0);D(r),U(()=>{oa(r,1,`rebemer-toast rebemer-toast--${n()??``}`),$(r,`role`,K(a)),$(r,`aria-live`,n()===`error`?`assertive`:`polite`),X(o,t.message)}),q(`click`,r,()=>{z(i,!1),t.onDismiss?.()}),Y(e,r)};Z(s,e=>{K(i)&&e(c)}),Y(e,o),Ye()}wi([`click`]);var Mc=J(``),Nc=J(`Will migrate `,1),Pc=J(` `),Fc=J(``),Ic=J(` `,1);function Lc(e,t){Je(t,!0);let n={add:`Attaches a new BEM class to each element without removing any existing classes.`,rename:`Renames an existing class family to the new name (its settings carry over). When an element has several classes, pick which family to rename per row; other classes are kept unless "Remove all existing classes" is on.`,replace:`Swaps classes for a new BEM class with empty settings. Pick a family to replace just that one (keeping the rest), or leave "— All classes —" / enable "Remove all existing classes" to clear the element.`,migrate:`Lifts inline element styles (padding, color, typography, etc.) into a new global class.`,mixed:`Per-element control — every row defaults to Add. Switch any row to Rename (targets one class family, keeps others) or Replace (a selected family, or all classes). "Remove all existing classes" clears every renamed/replaced row.`};function r(e){return e===`rename`||e===`replace`||e===`mixed`}function i(e){let t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(e=>typeof e==`string`&&e.length>0):[]}let a=R(`add`),o=R(!0),s=R(!1),c=R(er([])),l=R(er([])),u=R(null),d=R(null),f=F(()=>K(c)[0]?.originalLabel??``),p=F(()=>K(c).length===0?new Map:Ls(K(c),t.rootId)),m=F(()=>{if(K(a)!==`migrate`)return null;let e=0,t=0;for(let n of K(c))n.include&&(e+=n.migrateKeys?.length??0,t+=n.skippedKeys?.length??0);return{willMigrate:e,willSkip:t}}),h=F(()=>{if(K(c).length===0)return new Map;let e=Rs({rootId:t.rootId,rows:K(c),mode:K(a)}),n=new Map;if(!e.ok)return n;for(let t of e.ops){let e=[t.finalClass];for(let n of t.modifierSlugs??[])e.push(`${t.finalClass}--${n}`);n.set(t.row.id,e)}return n});Pa(()=>{let e=Ga(t.rootId);z(l,qa().slice(),!0);let n=e.map((e,t)=>{let n=t===0,r=e.label||``,a=Ds(r),o=e.name||``,s,c;if(a)s=a,c=`label`;else if(n)s=`block`,c=`fallback`;else if(o&&!Qs(o)){let e=Zs(o,``);if(e)s=e,c=`element-type`;else{let e=Ds(Za(o));e&&As(e).ok?(s=e,c=`element-type`):(s=`item`,c=`fallback`)}}else s=`item`,c=`fallback`;let l=i(e.settings);return{id:e.id,depth:e.depth,bricksType:o,originalLabel:r||(n?`block`:`element`),name:s,modifiers:[``],isBlockRoot:!1,include:!0,suggestedFrom:c,migrateKeys:Ms(e.settings),skippedKeys:Ps(e.settings),currentClassCount:l.length,currentClassIds:l,op:`add`,renameFamilyId:``}});if(n.length>1){let t=new Map(e.map(e=>[e.id,[]])),r=[];for(let n of e){for(;r.length&&r[r.length-1].depth>=n.depth;)r.pop();r.length&&t.get(r[r.length-1].id).push(n.id),r.push(n)}let i=new Map(e.map(e=>[e.id,e])),a=new Map(n.map(e=>[e.id,e]));for(let[,e]of t){if(!e.length)continue;let t=new Map;for(let n of e){let e=i.get(n)?.name;e&&t.set(e,(t.get(e)??0)+1)}for(let n of e){let e=a.get(n),r=i.get(n);if(!(!e||!r||e.suggestedFrom===`label`)){if(Qs(r.name))e.name=ec(r.name),e.suggestedFrom=`element-type`;else if((t.get(r.name)??0)===1){let t=$s[r.name];t&&(e.name=t,e.suggestedFrom=`element-type`)}}}}}z(c,n,!0)});function g(e){if(e.key===`Escape`){t.onClose?.();return}K(d)&&e.target instanceof Node&&K(d).contains(e.target)&&e.key===`Enter`&&(e.target?.tagName===`INPUT`||e.target?.tagName===`SELECT`)&&(e.preventDefault(),v())}let _=null;function v(){let e=As(Ds(K(c)[0]?.name??``));if(!e.ok){z(u,{kind:`error`,message:e.reason},!0);return}for(let e of K(c)){if(!e.isBlockRoot||!e.include)continue;let t=As(Ds(e.name??``));if(!t.ok){z(u,{kind:`error`,message:`Sub-block "${e.originalLabel}": ${t.reason}`},!0);return}}let n=zs({rootId:t.rootId,rows:K(c),mode:K(a),syncLabels:K(o),removeExisting:K(s)});n.ok?(z(u,{kind:`success`,message:`Applied to ${n.count} element${n.count===1?``:`s`}.`},!0),_&&clearTimeout(_),_=setTimeout(()=>t.onClose?.(),800)):z(u,{kind:`error`,message:n.error},!0)}wr(()=>()=>{_&&clearTimeout(_)});var y=Ic();Ci(`keydown`,rr,g);var b=V(y),x=B(b),S=B(x),ee=H(B(S)),te=B(ee,!0);D(ee),D(S);var ne=H(S,2);D(x);var C=H(x,2),re=B(C),ie=H(B(re),2),ae=B(ie);ae.value=ae.__value=`add`;var oe=H(ae);oe.value=oe.__value=`rename`;var se=H(oe);se.value=se.__value=`replace`;var ce=H(se);ce.value=ce.__value=`migrate`;var le=H(ce);le.value=le.__value=`mixed`,D(ie),D(re);var ue=H(re,2),de=B(ue);ga(de),ze(2),D(ue);var fe=H(ue,2),pe=e=>{var t=Mc(),n=B(t);ga(n),ze(2),D(t),xa(n,()=>K(s),e=>z(s,e)),Y(e,t)},me=F(()=>r(K(a)));Z(fe,e=>{K(me)&&e(pe)}),D(C);var he=H(C,2),ge=B(he,!0);D(he);var _e=H(he,2),ve=e=>{var t=Fc();let n;var r=B(t),i=e=>{Y(e,ji(`No migratable style keys found on any included element. Apply will attach empty classes.`))},a=e=>{var t=Nc(),n=H(V(t)),r=B(n,!0);D(n);var i=H(n);U(()=>{X(r,K(m).willMigrate),X(i,` style key${K(m).willMigrate===1?``:`s`} into new classes.`)}),Y(e,t)};Z(r,e=>{K(m).willMigrate===0?e(i):e(a,-1)});var o=H(r,2),s=e=>{var t=Pc(),n=B(t);D(t),U(()=>X(n,`${K(m).willSkip??``} key${K(m).willSkip===1?``:`s`} not on the allowlist will stay on the element.`)),Y(e,t)};Z(o,e=>{K(m).willSkip>0&&e(s)}),D(t),U(()=>n=oa(t,1,`rebemer-panel__notice`,null,n,{"rebemer-panel__notice--warn":K(m).willSkip>0||K(m).willMigrate===0})),Y(e,t)};Z(_e,e=>{K(m)&&e(ve)});var ye=H(_e,2);Q(ye,23,()=>K(c),e=>e.id,(e,n,r)=>{{let i=F(()=>K(p).get(K(n).id)??``),o=F(()=>K(n).id===t.rootId||K(n).isBlockRoot),u=F(()=>K(h).get(K(n).id)??[]);kc(e,{get mode(){return K(a)},get blockName(){return K(i)},get isRoot(){return K(o)},get rootId(){return t.rootId},get globalClasses(){return K(l)},get removeExisting(){return K(s)},get finalClassNames(){return K(u)},get row(){return K(c)[K(r)]},set row(e){K(c)[K(r)]=e}})}}),D(ye);var be=H(ye,2),xe=B(be),Se=H(xe,2);D(be),D(b),Ma(b,e=>z(d,e),()=>K(d));var Ce=H(b,2),we=e=>{jc(e,{get kind(){return K(u).kind},get message(){return K(u).message},onDismiss:()=>{z(u,null)}})};Z(Ce,e=>{K(u)&&e(we)}),U(()=>{X(te,K(f)),X(ge,n[K(a)])}),q(`click`,ne,()=>t.onClose?.()),da(ie,()=>K(a),e=>z(a,e)),xa(de,()=>K(o),e=>z(o,e)),q(`click`,xe,()=>t.onClose?.()),q(`click`,Se,v),Y(e,y),Ye()}wi([`click`]);var Rc=J(``);function zc(e,t){var n=Rc();let r;U(()=>{r=oa(n,1,`slashed-cp-launch`,null,r,{"slashed-cp-launch--on":t.open}),$(n,`aria-pressed`,t.open)}),q(`click`,n,function(...e){t.onToggle?.apply(this,e)}),Y(e,n)}wi([`click`]);var Bc=`--sf-color-`,Vc=[`primary`,`secondary`,`tertiary`,`action`,`neutral`,`base`],Hc=[`success`,`warning`,`error`,`info`,`danger`],Uc=[`a5`,`a10`,`a20`,`a30`,`a40`,`a50`,`a60`,`a70`,`a80`,`a90`,`a95`],Wc=[`superlight`,`xlight`,`lighter`,`darker`,`xdark`,`superdark`,`hover`,`active`,`strong`,`subtle`,`muted`,`ghost`],Gc=[`text`,`heading`,`bg`,`surface`,`inset`,`raised`,`overlay`,`inverse`,`border`,`link`,`code`,`selection`,`mark`,`dim`],Kc=(e=>new Set(e))([...Vc,...Hc]),qc={primary:{tagline:`Brand identity & main emphasis`,use:`Headlines, primary buttons, key brand moments.`},secondary:{tagline:`Supporting brand tone`,use:`Secondary surfaces and muted brand accents.`},tertiary:{tagline:`Accent / highlight`,use:`Badges, tags, decorative highlights.`},action:{tagline:`Interactive & links`,use:`Links, focus rings, anything clickable.`},neutral:{tagline:`Text, icons & dividers`,use:`Body text, borders, neutral UI chrome.`},base:{tagline:`Page & surface backgrounds`,use:`Page background and raised surfaces.`},success:{tagline:`Positive / confirmation`,use:`Success messages and valid state.`},warning:{tagline:`Caution`,use:`Warnings and at-risk / pending state.`},error:{tagline:`Form & validation errors`,use:`Invalid inputs and error messages.`},info:{tagline:`Informational`,use:`Tips and neutral notices.`},danger:{tagline:`Destructive actions`,use:`Delete / remove and irreversible actions.`},semantic:{tagline:`Ready-made role tokens`,use:`Pre-wired roles that already adapt to light/dark.`}},Jc=[{id:`text-on`,label:`Text on color`,match:e=>e.startsWith(`text--on`)},{id:`text`,label:`Text`,match:e=>e===`text`||e===`heading`||e.startsWith(`text-`)},{id:`state`,label:`Interactive states`,match:e=>e.startsWith(`bg--`)},{id:`surface`,label:`Surfaces & backgrounds`,match:e=>[`bg`,`surface`,`inset`,`raised`,`overlay`,`inverse`].some(t=>e===t||e.startsWith(t+`-`))},{id:`border`,label:`Borders`,match:e=>e===`border`||e.startsWith(`border-`)},{id:`link`,label:`Links`,match:e=>e===`link`||e.startsWith(`link-`)},{id:`select`,label:`Selection & marks`,match:e=>e.startsWith(`selection`)||e.startsWith(`mark`)||e===`dim`},{id:`code`,label:`Code`,match:e=>e.startsWith(`code`)}];function Yc(e){if(typeof e!=`string`||e.indexOf(Bc)!==0)return null;let t=e.slice(11);if(!t||t===`scheme`)return null;let n=t.indexOf(`-`),r=n===-1?t:t.slice(0,n);if(!Kc.has(r))return{family:`semantic`,kind:`semantic`,step:null,key:t};let i=n===-1?``:t.slice(n+1);return i===``?{family:r,kind:`base`,step:null,key:t}:i===`light`||i===`dark`?null:/^[0-9]+$/.test(i)?{family:r,kind:`scale`,step:Number(i),key:t}:/^a[0-9]+$/.test(i)?{family:r,kind:`alpha`,step:i,key:t}:{family:r,kind:`alias`,step:i,key:t}}function Xc(e){return e.kind===`alpha`?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function Zc(e){switch(e.kind){case`base`:return Qc(e.family);case`scale`:return String(e.step);case`alpha`:return String(e.step).toUpperCase();case`alias`:return Qc(String(e.step));default:return $c(e.key)}}function Qc(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function $c(e){return e.split(`--`).map(e=>e.split(`-`).map(Qc).join(` `)).join(` · `)}function el(e,t,n,r){let i=n[e];if(typeof i!=`string`||!i)return null;let a=typeof r[e]==`string`&&r[e]?r[e]:i;return{var:e,name:e.slice(2),label:Zc(t),light:i,dark:a,alpha:Xc(t)}}function tl(e,t){let n={base:0,scale:1,alias:2,alpha:3};if(n[e.info.kind]!==n[t.info.kind])return n[e.info.kind]-n[t.info.kind];if(e.info.kind===`scale`)return e.info.step-t.info.step;if(e.info.kind===`alpha`)return Uc.indexOf(e.info.step)-Uc.indexOf(t.info.step);if(e.info.kind===`alias`){let n=Wc.indexOf(e.info.step),r=Wc.indexOf(t.info.step),i=n===-1?999:n,a=r===-1?999:r;return i===a?String(e.info.step).localeCompare(String(t.info.step)):i-a}return 0}function nl(e,t){let n=Gc.findIndex(t=>e.info.key===t||e.info.key.startsWith(t+`-`)),r=Gc.findIndex(e=>t.info.key===e||t.info.key.startsWith(e+`-`)),i=n===-1?Gc.length:n,a=r===-1?Gc.length:r;return i===a?e.info.key.localeCompare(t.info.key):i-a}function rl(e,t,n){let r=Array.isArray(e)?e:[],i=t&&typeof t==`object`?t:{},a=n&&typeof n==`object`?n:{},o=new Map,s=[];for(let e of r){let t=Yc(e);if(!t)continue;let n=el(e,t,i,a);if(!n)continue;let r={swatch:n,info:t};if(t.family===`semantic`){s.push(r);continue}o.has(t.family)||o.set(t.family,[]),o.get(t.family).push(r)}let c=[],l=(e,t)=>{let n=o.get(e);if(!n||n.length===0)return;n.sort(tl);let r=n.filter(e=>e.info.kind===`base`||e.info.kind===`scale`),i=n.filter(e=>e.info.kind===`alias`),a=n.filter(e=>e.info.kind===`alpha`),s=[];r.length&&s.push({id:`scale`,label:`Shades & tints`,swatches:r.map(e=>e.swatch)}),a.length&&s.push({id:`alpha`,label:`Transparent`,swatches:a.map(e=>e.swatch)}),i.length&&s.push({id:`alias`,label:`Semantic`,swatches:i.map(e=>e.swatch)});let l=qc[e]||{};c.push({id:e,label:Qc(e),type:t,count:n.length,tagline:l.tagline||``,use:l.use||``,sections:s})};for(let e of Vc)l(e,`brand`);for(let e of Hc)l(e,`status`);if(s.length){s.sort(nl);let e=new Map(Jc.map(e=>[e.id,[]])),t=[];for(let n of s){let r=Jc.find(e=>e.match(n.info.key));r?e.get(r.id).push(n.swatch):t.push(n.swatch)}let n=[];for(let t of Jc){let r=e.get(t.id);r.length&&n.push({id:t.id,label:t.label,swatches:r})}t.length&&n.push({id:`other`,label:`Other`,swatches:t});let r=qc.semantic||{};c.push({id:`semantic`,label:`Semantic`,type:`semantic`,count:s.length,tagline:r.tagline||``,use:r.use||``,sections:n})}return{groups:c}}function il(e,t){let n=String(t||``).trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};let r=[];for(let t of e.groups){if(!Array.isArray(t.sections))continue;let e=[];for(let r of t.sections){if(!Array.isArray(r.swatches))continue;let i=r.swatches.filter(e=>e.name.toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||t.label.toLowerCase().includes(n));i.length&&e.push({...r,swatches:i})}if(e.length){let n=e.reduce((e,t)=>e+t.swatches.length,0);r.push({...t,sections:e,count:n})}}return{groups:r}}function al(e){return`var(${e.var})`}function ol(e,t){return t===`dark`?e.dark:e.light}var sl=[{id:`typography`,label:`Typography`,tokens:[{var:`--sf-color-heading`,label:`Heading`},{var:`--sf-color-text`,label:`Text`},{var:`--sf-color-text--muted`,label:`Text · Muted`},{var:`--sf-color-text--secondary`,label:`Text · Secondary`},{var:`--sf-color-text--on-primary`,label:`On Primary`},{var:`--sf-color-text--on-secondary`,label:`On Secondary`}]},{id:`surfaces`,label:`Surfaces`,tokens:[{var:`--sf-color-bg`,label:`Background`},{var:`--sf-color-surface`,label:`Surface`},{var:`--sf-color-raised`,label:`Raised`},{var:`--sf-color-inset`,label:`Inset`},{var:`--sf-color-overlay`,label:`Overlay`},{var:`--sf-color-inverse`,label:`Inverse`}]},{id:`structure`,label:`Structure`,tokens:[{var:`--sf-color-border`,label:`Border`},{var:`--sf-color-border--subtle`,label:`Border · Subtle`},{var:`--sf-color-border--strong`,label:`Border · Strong`},{var:`--sf-color-link`,label:`Link`},{var:`--sf-color-link--hover`,label:`Link · Hover`}]},{id:`brand`,label:`Brand`,tokens:[{var:`--sf-color-primary`,label:`Primary`},{var:`--sf-color-secondary`,label:`Secondary`},{var:`--sf-color-tertiary`,label:`Tertiary`},{var:`--sf-color-action`,label:`Action`},{var:`--sf-color-neutral`,label:`Neutral`},{var:`--sf-color-base`,label:`Base`}]},{id:`feedback`,label:`Feedback`,tokens:[{var:`--sf-color-success`,label:`Success`},{var:`--sf-color-success-subtle`,label:`Success · Subtle`},{var:`--sf-color-warning`,label:`Warning`},{var:`--sf-color-warning-subtle`,label:`Warning · Subtle`},{var:`--sf-color-error`,label:`Error`},{var:`--sf-color-error-subtle`,label:`Error · Subtle`},{var:`--sf-color-info`,label:`Info`},{var:`--sf-color-danger`,label:`Danger`}]}];function cl(e,t,n){let r=t&&typeof t==`object`?t:{},i=n&&typeof n==`object`?n:{},a=[];for(let e of sl){let t=[];for(let n of e.tokens){let e=r[n.var];if(!e)continue;let a=i[n.var]||e;t.push({var:n.var,name:n.var.slice(2),label:n.label,light:e,dark:a,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(n.var)})}t.length&&a.push({id:e.id,label:e.label,swatches:t})}return{groups:a}}var ll=J(``);function ul(e,t){Je(t,!0);let n=Na(t,`onPick`,3,void 0),r=F(()=>`${t.swatch.name}\nlight ${t.swatch.light} · dark ${t.swatch.dark}`);var i=ll();let a;U(e=>{a=oa(i,1,`slashed-cp-swatch`,null,a,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode===`both`}),ca(i,`--cp-l:${t.swatch.light??``}; --cp-d:${t.swatch.dark??``}; --cp-solid:${e??``};`),$(i,`title`,K(r)),$(i,`aria-label`,t.swatch.name)},[()=>ol(t.swatch,t.mode===`dark`?`dark`:`light`)]),q(`click`,i,()=>n()?.(t.swatch)),Y(e,i),Ye()}wi([`click`]);var dl=J(``),fl=J(``),pl=J(``),ml=J(`
      `),hl=J(`

      `,1),gl=J(``),_l=J(`

      Scale 50 → 950

      `,1),vl=J(``),yl=J(`
      `),bl=J(` `,1),xl=J(`
      `),Sl=J(`
      `),Cl=J(`
      `),wl=J(``),Tl=J(`

      `),El=J(` `),Dl=J(``),Ol=J(`
    • `),kl=J(`
        `),Al=J(`
        `),jl=J(` `,1),Ml=J(`

        `),Nl=J(``),Pl=J(`

        `),Fl=J(`

        Quick Use

        Palette

        Brand

        Status

        `,1),Il=J(``),Ll=J(`

        Color System

        var()
        `,1);function Rl(e,t){Je(t,!0);let n=(e,t=d)=>{var n=Cl();Q(n,21,t,e=>e.id,(e,t)=>{let n=F(()=>oe(K(t))),r=F(()=>se(K(t))),i=F(()=>K(u)===K(t).id);var a=Sl(),o=B(a);let c;var l=B(o),d=e=>{var t=dl();U(()=>ca(t,`--sw-l: ${K(n).light??``}; --sw-d: ${K(n).dark??``}`)),Y(e,t)};Z(l,e=>{K(n)&&e(d)});var p=H(l,2),m=B(p,!0);D(p);var h=H(p,2),g=B(h,!0);D(h);var _=H(h,2);Q(_,21,()=>K(r),e=>e.var,(e,t)=>{var n=fl();U(()=>{ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`),$(n,`title`,K(t).label)}),Y(e,n)}),D(_);var v=H(_,2),y=B(v,!0);D(v),D(o);var b=H(o,2),x=e=>{let r=F(()=>ae(K(t),`alias`)),i=F(()=>ce(K(t))),a=F(()=>ae(K(t),`alpha`));var o=xl(),c=B(o),l=e=>{var r=pl(),i=B(r),a=B(i,!0);D(i),D(r),U(()=>{ca(r,`--sw-l: ${K(n).light??``}; --sw-d: ${K(n).dark??``}`),$(r,`title`,`${K(t).label??``} base — ${K(n).name??``}`),X(a,K(t).label)}),q(`click`,r,()=>C(K(n))),Y(e,r)};Z(c,e=>{K(n)&&e(l)});var u=H(c,2),d=e=>{var t=hl(),n=V(t),i=B(n);D(n);var a=H(n,2);Q(a,21,()=>K(r).swatches,e=>e.var,(e,t)=>{var n=ml(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i),D(n),U(()=>X(a,K(t).label)),Y(e,n)}),D(a),U(()=>X(i,`Aliases · ${K(r).swatches.length??``}`)),Y(e,t)};Z(u,e=>{K(r)?.swatches.length&&e(d)});var p=H(u,2),m=e=>{var t=_l(),n=H(V(t),2);Q(n,21,()=>K(i),e=>e.var,(e,t)=>{var n=gl();U(()=>{$(n,`title`,`${K(t).label??``} — ${K(t).name??``}`),ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(n),Y(e,t)};Z(p,e=>{K(i).length&&e(m)});var h=H(p,2),g=e=>{var n=bl(),r=V(n),i=B(r),o=B(i,!0);D(i),ze(),D(r);var s=H(r,2),c=e=>{var t=yl();Q(t,21,()=>K(a).swatches,e=>e.var,(e,t)=>{var n=vl();U(()=>{$(n,`title`,`${K(t).label??``} — ${K(t).name??``}`),ca(n,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(t),Y(e,t)},l=F(()=>K(f).has(K(t).id));Z(s,e=>{K(l)&&e(c)}),U(e=>X(o,e),[()=>K(f).has(K(t).id)?`▾`:`▸`]),q(`click`,r,()=>ie(K(t).id)),Y(e,n)};Z(h,e=>{K(a)?.swatches.length&&e(g)}),D(o),Y(e,o)};Z(b,e=>{K(i)&&e(x)}),D(a),U(()=>{c=oa(o,1,`slashed-cp__scan-row`,null,c,{"slashed-cp__scan-row--open":K(i)}),$(o,`aria-expanded`,K(i)),X(m,K(t).label),X(g,K(t).tagline),X(y,K(i)?`▾`:`▸`)}),q(`click`,o,()=>re(K(t).id)),Y(e,a)}),D(n),Y(e,n)},r=Na(t,`dockedLeft`,3,null),i=F(()=>typeof t.onPickValue==`function`),a=[{id:`both`,label:`Both`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],o=[`Hover`,`Active`,`Subtle`,`Ghost`,`Superlight`],s=R(`both`),c=R(``),l=R(null),u=R(null),f=R(er(new Set)),p=F(()=>rl(t.source?.variables,t.source?.light,t.source?.dark)),m=F(()=>K(c).trim()),h=F(()=>il(K(p),K(m))),g=F(()=>cl(t.source?.variables,t.source?.light,t.source?.dark)),_=F(()=>K(p).groups.reduce((e,t)=>e+t.count,0)),v=F(()=>K(p).groups.filter(e=>e.type===`brand`)),y=F(()=>K(p).groups.filter(e=>e.type===`status`)),b;function x(){if(typeof document>`u`)return null;let e=document.querySelector(`iframe#bricks-builder-iframe, iframe[name="bricks-builder-iframe"], #bricks-builder-area iframe`);try{return e?.contentDocument?.documentElement??null}catch{return null}}function S(e){let t=x();if(t)try{b===void 0&&(b=t.getAttribute(`data-theme`)),e===`light`||e===`dark`?t.setAttribute(`data-theme`,e):b===null?t.removeAttribute(`data-theme`):t.setAttribute(`data-theme`,b)}catch{}}function ee(){let e=x();if(!(!e||b===void 0))try{b===null?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,b)}catch{}}function te(e){z(s,e,!0),S(e)}Pa(()=>()=>ee());async function ne(e){try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;opacity:0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}async function C(e){let n=al(e);if(K(i)){if(t.onPickValue(n)===!1){z(l,{kind:`error`,message:`Couldn't apply ${n} — input not found`},!0);return}t.onPick?.();return}z(l,await ne(n)?{kind:`info`,message:`Copied — ${e.name}`}:{kind:`error`,message:`Couldn't copy ${n}`},!0)}function re(e){z(u,K(u)===e?null:e,!0),z(f,new Set,!0)}function ie(e){let t=new Set(K(f));t.has(e)?t.delete(e):t.add(e),z(f,t,!0)}function ae(e,t){return e.sections.find(e=>e.id===t)}function oe(e){return ae(e,`scale`)?.swatches[0]??null}function se(e){let t=ae(e,`alias`);if(!t?.swatches.length)return[];let n=o.map(e=>t.swatches.find(t=>t.label===e)).filter(Boolean);return n.length?n:t.swatches.slice(0,5)}function ce(e){return ae(e,`scale`)?.swatches.slice(1)??[]}function le(e){e.key===`Escape`&&t.onClose?.()}var ue=Ll();Ci(`keydown`,rr,le);var de=V(ue);let fe;var pe=B(de),me=H(B(pe),2);Q(me,21,()=>a,e=>e.id,(e,t)=>{var n=wl();let r;var i=B(n,!0);D(n),U(()=>{r=oa(n,1,`slashed-cp__seg-btn`,null,r,{"slashed-cp__seg-btn--on":K(s)===K(t).id}),$(n,`aria-pressed`,K(s)===K(t).id),X(i,K(t).label)}),q(`click`,n,()=>te(K(t).id)),Y(e,n)}),D(me);var he=H(me,2);D(pe);var ge=H(pe,2),_e=B(ge);ga(_e),D(ge);var ve=H(ge,2),ye=B(ve),be=e=>{var t=jl(),n=V(t),r=e=>{var t=Tl(),n=B(t);D(t),U(()=>X(n,`No tokens match "${K(m)??``}".`)),Y(e,t)};Z(n,e=>{K(h).groups.length===0&&e(r)}),Q(H(n,2),17,()=>K(h).groups,e=>e.id,(e,t)=>{var n=Ml(),r=B(n),i=B(r),a=B(i),o=H(a),c=e=>{var n=El(),r=B(n,!0);D(n),U(()=>X(r,K(t).tagline)),Y(e,n)};Z(o,e=>{K(t).tagline&&e(c)});var l=H(o,2),u=B(l,!0);D(l),D(i),D(r),Q(H(r,2),17,()=>K(t).sections,e=>e.id,(e,n)=>{var r=jl(),i=V(r),a=e=>{var t=Dl(),r=B(t,!0);D(t),U(()=>X(r,K(n).label)),Y(e,t)};Z(i,e=>{K(n).label&&e(a)});var o=H(i,2),c=e=>{var t=kl();Q(t,21,()=>K(n).swatches,e=>e.var,(e,t)=>{var n=Ol(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i);var o=H(i,2),c=B(o,!0);D(o),D(n),U(()=>{X(a,K(t).label),X(c,K(t).name)}),Y(e,n)}),D(t),Y(e,t)},l=e=>{var t=Al();Q(t,21,()=>K(n).swatches,e=>e.var,(e,t)=>{var n=ml(),r=B(n);ul(r,{get swatch(){return K(t)},get mode(){return K(s)},onPick:C});var i=H(r,2),a=B(i,!0);D(i),D(n),U(()=>X(a,K(t).label)),Y(e,n)}),D(t),Y(e,t)};Z(o,e=>{K(t).type===`semantic`?e(c):e(l,-1)}),Y(e,r)}),D(n),U(()=>{$(n,`data-type`,K(t).type),X(a,`${K(t).label??``} `),X(u,K(t).count)}),Y(e,n)}),Y(e,t)},xe=e=>{var t=Fl(),r=V(t);Q(H(B(r),2),17,()=>K(g).groups,e=>e.id,(e,t)=>{var n=Pl(),r=B(n),i=B(r,!0);D(r);var a=H(r,2);Q(a,21,()=>K(t).swatches,e=>e.var,(e,t)=>{var n=Nl(),r=B(n);let i;var a=H(r,2),o=B(a,!0);D(a),D(n),U(()=>{$(n,`title`,K(t).name),i=oa(r,1,`slashed-cp__qu-sw`,null,i,{"slashed-cp__qu-sw--alpha":K(t).alpha}),ca(r,`--sw-l: ${K(t).light??``}; --sw-d: ${K(t).dark??``}`),X(o,K(t).label)}),q(`click`,n,()=>C(K(t))),Y(e,n)}),D(a),D(n),U(()=>X(i,K(t).label)),Y(e,n)}),D(r);var i=H(r,2),a=H(B(i),4);n(a,()=>K(v)),n(H(a,4),()=>K(y)),D(i),Y(e,t)};Z(ye,e=>{K(m)?e(be):e(xe,-1)}),D(ve);var Se=H(ve,2),Ce=B(Se),we=e=>{Y(e,Il())};Z(Ce,e=>{K(s)===`both`&&e(we)});var Te=H(Ce,2),Ee=B(Te);ze(),D(Te),D(Se),D(de);var De=H(de,2),Oe=e=>{jc(e,{get kind(){return K(l).kind},get message(){return K(l).message},onDismiss:()=>{z(l,null)}})};Z(De,e=>{K(l)&&e(Oe)}),U(()=>{fe=oa(de,1,`slashed-cp`,null,fe,{"slashed-cp--docked":K(i)}),$(de,`data-mode`,K(s)),ca(de,K(i)&&r()!=null?`--cp-dock-left: ${r()}px`:``),$(_e,`placeholder`,`Search ${K(_)} tokens…`),X(Ee,`${K(i)?`Click to insert`:`Click to copy`} `)}),q(`click`,de,e=>e.stopPropagation()),q(`mousedown`,de,e=>e.stopPropagation()),q(`pointerdown`,de,e=>e.stopPropagation()),q(`touchstart`,de,e=>e.stopPropagation(),void 0,!0),q(`click`,he,()=>t.onClose?.()),ba(_e,()=>K(c),e=>z(c,e)),Y(e,ue),Ye()}wi([`click`,`mousedown`,`pointerdown`,`touchstart`]);var zl=J(` `,1);function Bl(e,t){let n=R(!1);var r=zl(),i=V(r);zc(i,{get open(){return K(n)},onToggle:()=>z(n,!K(n))});var a=H(i,2),o=e=>{Rl(e,{get source(){return t.source},onClose:()=>z(n,!1)})};Z(a,e=>{K(n)&&e(o)}),Y(e,r)}var Vl=`#bricks-structure`,Hl=`li[data-id]`,Ul=`slashed-rebemer-host`,Wl=400,Gl=25,Kl=(e,...t)=>console[e](`[reBEMer]`,...t),ql=new AbortController,{signal:Jl}=ql,Yl=new Map,Xl=null,Zl=null,Ql=null;function $l(){let e=document.getElementById(Ul);return e||(e=document.createElement(`div`),e.id=Ul,document.body.appendChild(e)),e}var eu=null;function tu(){eu=window.slashedBricksEditor,eu&&typeof eu==`object`&&(To(eu.showClassHints,eu.classHints,{signal:Jl}),Jo(eu.showColorSwatches,eu.colorHexMap,{signal:Jl,onOpenPanel:eu.showColorPanel?e=>uu(e):void 0}),xs(eu.variableHints||{},{signal:Jl}));let e=0,t=()=>{if(!Jl.aborted){if(Va()){nu();return}if(++e>=Gl){Kl(`warn`,`Bricks Vue app not detected after grace window — reBEMer disabled on this page.`);return}setTimeout(t,Wl)}};t()}function nu(){if(ou(),eu&&eu.rebemerEnabled===!1)return;let e=document.querySelector(Vl);if(e){ru(e);return}let t=new MutationObserver(()=>{let e=document.querySelector(Vl);e&&(t.disconnect(),ru(e))});t.observe(document.body,{childList:!0,subtree:!0}),Jl.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function ru(e){let t=null,n=new MutationObserver(()=>{t===null&&(t=setTimeout(()=>{t=null,iu(e)},50))});n.observe(e,{childList:!0,subtree:!0}),Jl.addEventListener(`abort`,()=>{n.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),iu(e)}function iu(e){for(let[e,t]of Yl)if(!t.host.isConnected){try{Li(t.instance)}catch(e){Kl(`warn`,`badge unmount failed`,e)}Yl.delete(e)}let t=e.querySelectorAll(Hl);for(let e of t){let t=e.getAttribute(`data-id`);if(!t)continue;let n=Yl.get(t);n&&n.host.isConnected&&e.contains(n.host)||au(e)}}function au(e){let t=e.getAttribute(`data-id`);if(!t)return;let n=e.querySelector(`:scope > .structure-item`)||e,r=n.querySelector(`:scope > ul.actions`)||n.querySelector(`:scope > .actions`)||n.querySelector(`:scope > .structure-item-actions`),i=document.createElement(`span`);i.className=`rebemer-badge-host`,r?n.insertBefore(i,r):n.appendChild(i);let a=n.querySelector(`:scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label`),o=Ni(Es,{target:i,props:{elementId:t,label:a?a.textContent.trim():``,onActivate:fu}}),s=Yl.get(t);if(s){try{Li(s.instance)}catch(e){Kl(`warn`,`badge remount cleanup failed`,e)}s.host.isConnected&&s.host.remove()}Yl.set(t,{instance:o,host:i})}function ou(){if(Zl)return;let e=eu&&eu.colorPanel;if(!eu?.showColorPanel||!e||!Array.isArray(e.variables)||e.variables.length===0)return;let t=document.createElement(`div`);$l().appendChild(t),Zl={instance:Ni(Bl,{target:t,props:{source:e}}),node:t}}function su(){if(Zl){try{Li(Zl.instance)}catch(e){Kl(`warn`,`color app unmount failed`,e)}Zl.node.remove(),Zl=null}}function cu(e,t){if(!e||!e.isConnected)return!1;try{let n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;return n?n.call(e,t):e.value=t,e.dispatchEvent(new Event(`input`,{bubbles:!0})),!0}catch{return!1}}function lu(e){let t=[`#bricks-panel-inner`,`#bricks-panel`,`[id^="bricks-panel"]`];if(e)for(let n of t){let t=e.closest(n);if(t){let e=t.getBoundingClientRect();if(e.width>100)return Math.ceil(e.right)}}for(let e of t){let t=document.querySelector(e);if(t){let e=t.getBoundingClientRect();if(e.width>100)return Math.ceil(e.right)}}return null}function uu(e){du();let t=eu?.colorPanel;if(!t||!Array.isArray(t.variables)||t.variables.length===0)return;let n=lu(e),r=document.createElement(`div`);$l().appendChild(r),Ql={instance:Ni(Rl,{target:r,props:{source:t,dockedLeft:n,onPickValue:t=>{let n=cu(e?.querySelector(`input[type="text"]`)??e?.querySelector(`input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])`),t);if(n){let n=t.match(/^var\((--[^)]+)\)/)?.[1],r=n?eu?.colorHexMap?.[n]??null:null,i=(e?.closest(`[data-control="color"]`))?.querySelector(`:scope > .slashed-sf-color-btn`);if(i){let e=i.querySelector(`.slashed-sf-color-btn__dot`);e&&(r?(e.style.background=r,e.style.removeProperty(`box-shadow`)):e.style.removeProperty(`background`)),i.classList.toggle(`slashed-sf-color-btn--active`,!!r)}if(r){let t=e?.closest(`[data-control="color"]`);requestAnimationFrame(()=>{if(!t)return;let e=t.querySelector(`.bricks-control-preview`);e&&(Ho(e,!0),e.classList.remove(`empty`))})}}return n},onPick:du,onClose:du}}),node:r}}function du(){if(Ql){try{Li(Ql.instance)}catch(e){Kl(`warn`,`color picker panel unmount failed`,e)}Ql.node.remove(),Ql=null}}function fu(e){pu();let t=document.createElement(`div`);$l().appendChild(t),Xl={instance:Ni(Lc,{target:t,props:{rootId:e,onClose:pu}}),node:t}}function pu(){if(Xl){try{Li(Xl.instance)}catch(e){Kl(`warn`,`panel unmount failed`,e)}Xl.node.remove(),Xl=null}}window.addEventListener(`beforeunload`,()=>{ql.abort(),pu(),su(),du(),Eo(),Yo(),Ss();for(let{instance:e}of Yl.values())try{Li(e)}catch{}Yl.clear()},{once:!0}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,tu,{once:!0}):tu(); //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js b/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js index e0b5c35e..66b20e88 100644 --- a/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js +++ b/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js @@ -136,9 +136,9 @@ export function classifyVar(varName) { return { family, kind: 'base', step: null, key }; } - // The `-light` source token duplicates the base swatch — skip to avoid a - // visual dupe (the base swatch already represents the resolved colour). - if (suffix === 'light') return null; + // The `-light`/`-dark` source tokens are internal implementation details — + // skip to avoid exposing them in the UI (base swatch already covers them). + if (suffix === 'light' || suffix === 'dark') return null; if (/^[0-9]+$/.test(suffix)) { return { family, kind: 'scale', step: Number(suffix), key }; @@ -374,8 +374,10 @@ export function filterModel(model, query) { const groups = []; for (const group of model.groups) { + if (!Array.isArray(group.sections)) continue; const sections = []; for (const section of group.sections) { + if (!Array.isArray(section.swatches)) continue; const swatches = section.swatches.filter( (s) => s.name.toLowerCase().includes(q) || s.label.toLowerCase().includes(q) || group.label.toLowerCase().includes(q) ); diff --git a/SLASHED-for-WP/integrations/gutenberg/includes/class-presets.php b/SLASHED-for-WP/integrations/gutenberg/includes/class-presets.php index f52e4b30..8ddb2530 100644 --- a/SLASHED-for-WP/integrations/gutenberg/includes/class-presets.php +++ b/SLASHED-for-WP/integrations/gutenberg/includes/class-presets.php @@ -333,8 +333,10 @@ private function classify_color( $var ) { 'order' => -1, ); } - // The `-light` source duplicates the resolved base swatch — skip. - if ( 'light' === $suffix ) { + // The `-light`/`-dark` source tokens duplicate the resolved base + // swatch — skip both (matches the JS ports in integrations/bricks + // and integrations/gutenberg's own editor color-model.js). + if ( 'light' === $suffix || 'dark' === $suffix ) { return null; } if ( preg_match( '/^[0-9]+$/', $suffix ) ) { diff --git a/tests/color-model-cross-impl.test.js b/tests/color-model-cross-impl.test.js new file mode 100644 index 00000000..d697e56a --- /dev/null +++ b/tests/color-model-cross-impl.test.js @@ -0,0 +1,95 @@ +/** + * PL-015: cross-implementation regression test for color-token classification. + * + * classifyVar()/classify_color() exist in three near-identical + * implementations — Bricks JS, Gutenberg JS, and Gutenberg PHP — that had + * silently drifted (PL-013/PL-014: only Gutenberg JS correctly filtered both + * `-light` and `-dark` source tokens; Bricks JS and Gutenberg PHP only + * filtered `-light`). This test runs a shared fixture list against all three + * so a future edit to one can't silently re-diverge from the others without + * a test failure. + * + * The PHP side can't be imported into node:test directly, so it's exercised + * by shelling out to php-harness/classify-color.php (a reflection-based + * harness — classify_color() is private and needs no WordPress bootstrap). + * TODO: migrate this PHP-side comparison into the PHPUnit suite once PR-A3 + * (Brain Monkey test scaffold) lands, rather than shelling out. + * + * Run: node --test tests/color-model-cross-impl.test.js + */ +import { test, describe, before } from 'node:test'; +import assert from 'node:assert/strict'; +import { execFileSync } from 'node:child_process'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { classifyVar as classifyVarBricks } from '../SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js'; +import { classifyVar as classifyVarGutenberg } from '../SLASHED-for-WP/integrations/gutenberg/assets/editor/color-model.js'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const PHP_HARNESS = path.join(__dirname, 'php-harness', 'classify-color.php'); + +// Covers every classify_color() branch (base/scale/alpha/alias/semantic), +// both source-duplicate suffixes under test (PL-013/014's bug), the +// --sf-color-scheme special-case, and a non-color var. +const FIXTURE_VARS = [ + '--sf-color-primary', + '--sf-color-primary-light', + '--sf-color-primary-dark', + '--sf-color-primary-50', + '--sf-color-primary-500', + '--sf-color-primary-900', + '--sf-color-primary-a20', + '--sf-color-primary-hover', + '--sf-color-success', + '--sf-color-success-dark', + '--sf-color-text--secondary', + '--sf-color-scheme', + '--sf-space-4', + 'not-a-var', +]; + +let phpResultsByVar; + +before(() => { + const output = execFileSync('php', [PHP_HARNESS], { + input: JSON.stringify(FIXTURE_VARS), + encoding: 'utf8', + }); + const phpResults = JSON.parse(output); + phpResultsByVar = new Map(phpResults.map((r) => [r.var, r.result])); +}); + +describe('color classification stays behaviorally identical across Bricks JS, Gutenberg JS, and Gutenberg PHP', () => { + for (const varName of FIXTURE_VARS) { + test(`${varName}: all three agree on filtered (null) vs. classified`, () => { + const bricks = classifyVarBricks(varName); + const gutenbergJs = classifyVarGutenberg(varName); + const gutenbergPhp = phpResultsByVar.get(varName); + + assert.equal(bricks === null, gutenbergJs === null, 'Bricks JS and Gutenberg JS disagree on whether this var is filtered'); + assert.equal(bricks === null, gutenbergPhp === null, 'Bricks JS and Gutenberg PHP disagree on whether this var is filtered'); + }); + + test(`${varName}: family/kind/key agree when not filtered`, () => { + const bricks = classifyVarBricks(varName); + const gutenbergJs = classifyVarGutenberg(varName); + const gutenbergPhp = phpResultsByVar.get(varName); + if (bricks === null) return; + + // step/order are intentionally not compared: PHP's `order` for the + // `alias` kind is a lookup-table index (self::ALIAS_ORDER), not the + // raw suffix string the JS `step` field carries — a deliberate + // per-consumer shape difference, not drift. + assert.deepEqual( + { family: bricks.family, kind: bricks.kind, key: bricks.key }, + { family: gutenbergJs.family, kind: gutenbergJs.kind, key: gutenbergJs.key }, + 'Bricks JS and Gutenberg JS classify this var differently' + ); + assert.deepEqual( + { family: bricks.family, kind: bricks.kind, key: bricks.key }, + { family: gutenbergPhp.family, kind: gutenbergPhp.kind, key: gutenbergPhp.key }, + 'Bricks JS and Gutenberg PHP classify this var differently' + ); + }); + } +}); diff --git a/tests/php-harness/classify-color.php b/tests/php-harness/classify-color.php new file mode 100644 index 00000000..de725bc2 --- /dev/null +++ b/tests/php-harness/classify-color.php @@ -0,0 +1,42 @@ +newInstanceWithoutConstructor(); +$method = $reflection->getMethod( 'classify_color' ); +$method->setAccessible( true ); + +$results = array(); +foreach ( $vars as $var ) { + $results[] = array( + 'var' => $var, + 'result' => $method->invoke( $instance, $var ), + ); +} + +echo json_encode( $results ); From b217da2d099edfce7cbd7a83d52cf66fd200c904 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 13:50:41 +0000 Subject: [PATCH 02/20] test: guard cross-impl PHP call with an upfront availability check Matches scripts/lint-php.js's existing convention so a missing php binary fails with a clear message instead of an opaque ENOENT from execFileSync. Also caps the harness call with a timeout so a stuck php process can't hang the test runner. --- tests/color-model-cross-impl.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/color-model-cross-impl.test.js b/tests/color-model-cross-impl.test.js index d697e56a..723d7c92 100644 --- a/tests/color-model-cross-impl.test.js +++ b/tests/color-model-cross-impl.test.js @@ -51,9 +51,16 @@ const FIXTURE_VARS = [ let phpResultsByVar; before(() => { + try { + execFileSync('php', ['--version'], { stdio: 'ignore' }); + } catch { + throw new Error('php not found on PATH — install PHP to run tests/color-model-cross-impl.test.js'); + } + const output = execFileSync('php', [PHP_HARNESS], { input: JSON.stringify(FIXTURE_VARS), encoding: 'utf8', + timeout: 10_000, }); const phpResults = JSON.parse(output); phpResultsByVar = new Map(phpResults.map((r) => [r.var, r.result])); From a5d930b01eac8cde107b373bb43567a8ab19e150 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 13:54:59 +0000 Subject: [PATCH 03/20] fix(admin-app): update AppOverlay.svelte for upstream codec/lucide renames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SLASHED's SL-016 (codec.ts's `fa` → `generateCSS`) and SL-022 (lucide-svelte → @lucide/svelte) landed in main via #474. AppOverlay.svelte is plugin-specific and not vendored, so it kept referencing the old names and broke `vite build` as soon as CI's prebuild sync pulled the renamed exports from slashed@main — failing on every open plugin PR, not just the one that triggered it. Swaps the import/call site to generateCSS and updates package.json/ package-lock.json to depend on @lucide/svelte instead of the deprecated lucide-svelte package. --- SLASHED-for-WP/admin-app/package-lock.json | 21 +++++++++---------- SLASHED-for-WP/admin-app/package.json | 2 +- .../admin-app/src/AppOverlay.svelte | 6 +++--- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/SLASHED-for-WP/admin-app/package-lock.json b/SLASHED-for-WP/admin-app/package-lock.json index a76c5a4f..34a3e9df 100644 --- a/SLASHED-for-WP/admin-app/package-lock.json +++ b/SLASHED-for-WP/admin-app/package-lock.json @@ -8,8 +8,8 @@ "name": "slashed-admin-app", "version": "0.1.0", "dependencies": { + "@lucide/svelte": "^1.23.0", "fflate": "^0.8.3", - "lucide-svelte": "^1.0.1", "motion": "^12.23.24" }, "devDependencies": { @@ -102,6 +102,15 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@lucide/svelte": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.23.0.tgz", + "integrity": "sha512-3LQbKXx9vId6Nx4E2Nu2qwgJfdmr5+CVeVJbxe5cy+HcnCRd9QVVtZXqvgBYAV1OJrPmQAf9/3gJWLCpASC/Ng==", + "license": "ISC", + "peerDependencies": { + "svelte": "^5" + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", @@ -1216,16 +1225,6 @@ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "license": "MIT" }, - "node_modules/lucide-svelte": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lucide-svelte/-/lucide-svelte-1.0.1.tgz", - "integrity": "sha512-WvzZgk0pqzgda+AErLvgWxHkfg/+GgUwqKMRHvzt0IqyMdmyEDzDCk3Z+Wo/3y753oIgx8u9Q4eUbWkghFa8Jg==", - "deprecated": "Package deprecated. Please use @lucide/svelte instead.", - "license": "ISC", - "peerDependencies": { - "svelte": "^3 || ^4 || ^5.0.0-next.42" - } - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", diff --git a/SLASHED-for-WP/admin-app/package.json b/SLASHED-for-WP/admin-app/package.json index f5c18787..4a2d8c71 100644 --- a/SLASHED-for-WP/admin-app/package.json +++ b/SLASHED-for-WP/admin-app/package.json @@ -13,8 +13,8 @@ "check": "svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { + "@lucide/svelte": "^1.23.0", "fflate": "^0.8.3", - "lucide-svelte": "^1.0.1", "motion": "^12.23.24" }, "devDependencies": { diff --git a/SLASHED-for-WP/admin-app/src/AppOverlay.svelte b/SLASHED-for-WP/admin-app/src/AppOverlay.svelte index 12264494..2bdd3dc8 100644 --- a/SLASHED-for-WP/admin-app/src/AppOverlay.svelte +++ b/SLASHED-for-WP/admin-app/src/AppOverlay.svelte @@ -4,14 +4,14 @@ import SidebarNav from './components/shell/SidebarNav.svelte'; import DomainPanel from './components/DomainPanel.svelte'; import CommandPalette from './components/CommandPalette.svelte'; - import { fa } from './lib/codec'; + import { generateCSS } from './lib/codec'; import { loadInitialOverrides, injectLivePreview, saveOverrides } from './lib/persistence'; import { registerPreviewDoc } from './lib/previewResolver.svelte'; import { domainOf } from './lib/domains'; import tokensRaw from './data/api-index.generated.json'; import { ChevronRight, Undo2, Redo2, Trash2, FolderOpen, Download, Save, Check, Loader2, - } from 'lucide-svelte'; + } from '@lucide/svelte'; const ALL_TOKENS = ((tokensRaw as any).tokens ?? tokensRaw) as SlashedToken[]; @@ -200,7 +200,7 @@ } function handleExport() { - const css = fa(overrides, { mode: 'layer', banner: true }); + const css = generateCSS(overrides, { mode: 'layer', banner: true }); const blob = new Blob([css], { type: 'text/css' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); From 7e0a50b498c0a5911635e51c1243e83a69ffe2dc Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 13:58:37 +0000 Subject: [PATCH 04/20] feat(scripts): add --check mode to sync-core.mjs and a check orchestrator PL-025: sync-core.mjs now supports --check/--dry-run, reporting missing/ stale/orphaned vendored files against the framework source without ever writing to disk. All writes are routed through a single writeFile() helper so the never-write invariant only needs to hold in one place. Adds scripts/check.js (npm run check) to run the class-hints, variables- hints, and admin-app sync checks together and aggregate their exit status. Also: PL-036 fixes CLAUDE.md's npm run sync location (it's defined in admin-app/package.json, not the root), PL-033 trims .syncignore's stale historical PR reference, and PL-037 adds the missing assets/, data/, tests/, and docs/ directories to CLAUDE.md's structure diagram. --- CLAUDE.md | 19 +- SLASHED-for-WP/admin-app/.syncignore | 5 - .../admin-app/scripts/sync-core.mjs | 247 +++++++++++++----- package.json | 1 + scripts/check.js | 44 ++++ 5 files changed, 237 insertions(+), 79 deletions(-) create mode 100644 scripts/check.js diff --git a/CLAUDE.md b/CLAUDE.md index 7bd28c5d..a44ab9bb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,12 +7,16 @@ SLASHED-for-WP/ WordPress plugin admin-app/ Svelte SPA — configurator UI embedded in WP admin + frontend overlay src/ ⚠️ VENDORED — see below framework-css/ Vendored framework CSS (chrome layers + full bundle) + assets/ Built SPA output (admin-app/, editor-app/ — committed build artifacts) + data/ Generated inventories/hints (class-hints.json, variables-hints.json…) integrations/ bricks/editor-app/ Bricks Builder panel — independent, NOT vendored gutenberg/ Gutenberg integration includes/ PHP backend (REST API, CSS generator, token store…) dist/ Framework CSS bundles (updated by npm run update-framework) scripts/ Plugin-level build/sync scripts +tests/ Node --test suite + Playwright admin smoke test +docs/ Project docs ``` ## ⚠️ Vendored files — DO NOT edit in this repo @@ -64,13 +68,19 @@ These are plugin-specific and never overwritten by sync: ## Syncing the framework into the plugin +`npm run sync` is defined in `SLASHED-for-WP/admin-app/package.json`, not the +root `package.json` — run it from that directory (or via `npm run +build:admin-app` at the root, which runs it as a `prebuild` step): + ```bash -npm run sync # pull latest configurator/src from framework (local sibling or GitHub) -npm run build:apps # rebuild admin SPA + bricks editor app +cd SLASHED-for-WP/admin-app +npm run sync # pull latest configurator/src from framework (local sibling or GitHub) +cd ../../.. +npm run build:apps # rebuild admin SPA + bricks editor app ``` `SLASHED_CONFIGURATOR_SRC=/path/to/SLASHED/configurator/src npm run sync` -forces a specific local checkout. +(run from `SLASHED-for-WP/admin-app`) forces a specific local checkout. ## Updating the bundled framework CSS @@ -91,4 +101,5 @@ Downloads release CSS bundles, shallow-clones framework source, regenerates | `npm run build` | Full build: data + sync-dist + SPA apps + zip | | `npm run build:apps` | Build admin SPA + Bricks editor app | | `npm test` | Run test suite | -| `npm run verify` | Verify sync consistency | +| `npm run verify` | Verify version metadata is in sync | +| `npm run check` | Verify generated artifacts (class hints, variables hints, vendored admin-app core) aren't stale — exits non-zero on drift, never writes | diff --git a/SLASHED-for-WP/admin-app/.syncignore b/SLASHED-for-WP/admin-app/.syncignore index 3fef6930..bb91a978 100644 --- a/SLASHED-for-WP/admin-app/.syncignore +++ b/SLASHED-for-WP/admin-app/.syncignore @@ -3,11 +3,6 @@ # Plugin-specific build wiring lives OUTSIDE src/ (vite.config.js, package.json, # svelte.config.js, tsconfig.json) and is never touched by the sync. -# codeslash-dev/slashed#443 (the companion upstream PR that added @framework-css -# aliases + the WP persistence seam) merged to main on 2026-06-28. main.ts, -# App.svelte, PreviewPanel.svelte, vite-env.d.ts, lib/persistence.ts, and -# StudioHeader.svelte are no longer plugin-divergent — they sync normally now. - # Plugin-specific: frontend overlay (not in upstream configurator). src/plugin-main.ts src/AppOverlay.svelte diff --git a/SLASHED-for-WP/admin-app/scripts/sync-core.mjs b/SLASHED-for-WP/admin-app/scripts/sync-core.mjs index 73a0ff72..a4d95218 100644 --- a/SLASHED-for-WP/admin-app/scripts/sync-core.mjs +++ b/SLASHED-for-WP/admin-app/scripts/sync-core.mjs @@ -19,6 +19,13 @@ * to diverge — `.syncignore` is empty by default. Plugin build wiring lives * outside src/ (vite.config.js, package.json, svelte.config.js, tsconfig.json) * and is never touched by this script. + * + * --check / --dry-run: reports drift against the framework source (files that + * would change, be added, or are vendored locally but no longer exist upstream) + * without writing anything. Used by `npm run check` (PL-025) to catch admin-app + * vendoring drift in CI. See writeFile() below — every write in this script + * routes through it, so the "never touch disk in check mode" invariant only + * has to hold in one place. */ import { @@ -29,10 +36,13 @@ import { import { resolve, dirname, join, relative, sep } from 'node:path'; import { fileURLToPath } from 'node:url'; +const CHECK_MODE = process.argv.includes('--check') || process.argv.includes('--dry-run'); + // ── Vendored manifest ───────────────────────────────────────────────────────── -// Written after every sync so editors / AI tools can tell at a glance which -// files in src/ originate from the framework and must NOT be edited here. -// Edit those files in codeslash-dev/SLASHED → configurator/src/ instead. +// Written after every real sync so editors / AI tools can tell at a glance +// which files in src/ originate from the framework and must NOT be edited +// here. Edit those files in codeslash-dev/SLASHED → configurator/src/ instead. +// Skipped entirely in --check mode (no sync happened, nothing to record). const MANIFEST_PATH = resolve(resolve(dirname(fileURLToPath(import.meta.url)), '..'), '.vendored-manifest.json'); const _vendoredFiles = []; @@ -125,18 +135,92 @@ function isIgnored(relFromSrc) { return syncIgnore.has(posix) || syncIgnore.has('src/' + posix); } +// ── --check mode: drift tracking + the single write call site ───────────────── + +const driftFindings = []; +// Relative (posix, from SRC) paths this run actually resolved against the +// framework source — used in --check mode to detect files vendored locally +// that no longer exist upstream ("orphans"). +const visitedSrcRel = new Set(); + +function reportDrift(kind, label, detail) { + driftFindings.push(` ${kind.padEnd(8)} ${label}${detail ? ` (${detail})` : ''}`); +} + +/** + * Writes `content` (string or Buffer) to `destPath` — or, in --check mode, + * compares it against the existing file and records drift instead of + * touching disk. This is the *only* place either the real sync or the check + * mode writes a file, so "never write in --check mode" only needs to be true + * here rather than in every call site separately. + */ +function writeFile(destPath, content, label) { + if (!CHECK_MODE) { + mkdirSync(dirname(destPath), { recursive: true }); + writeFileSync(destPath, content); + return; + } + const next = Buffer.isBuffer(content) ? content : Buffer.from(content, 'utf8'); + if (!existsSync(destPath)) { + reportDrift('missing', label, 'present upstream, not vendored locally'); + return; + } + const existing = readFileSync(destPath); + if (!existing.equals(next)) { + reportDrift('stale', label, 'vendored copy differs from upstream source'); + } +} + +/** Recursively list every file under `dir`, relative (posix) to `base`. Read-only. */ +function listRelFiles(dir, base, out = []) { + if (!existsSync(dir)) return out; + for (const entry of readdirSync(dir)) { + const p = join(dir, entry); + if (statSync(p).isDirectory()) { + listRelFiles(p, base, out); + } else { + out.push(toPosix(relative(base, p))); + } + } + return out; +} + +/** In --check mode, flag src/ files that are vendored locally but no longer resolved from upstream. */ +function reportOrphans() { + if (!CHECK_MODE) return; + for (const rel of listRelFiles(SRC, SRC)) { + if (isIgnored(rel) || visitedSrcRel.has(rel)) continue; + reportDrift('orphan', `src/${rel}`, 'vendored locally, no longer present upstream'); + } +} + +/** Print the check result and set the process exit code. Never used outside --check mode. */ +function finishCheck(sourceLabel) { + console.log(` source: ${sourceLabel}`); + if (driftFindings.length === 0) { + console.log('OK — admin-app/src/ (and vendored framework-css/) match the framework configurator.'); + return; + } + console.error('Drift detected against the framework configurator:'); + for (const line of driftFindings) console.error(line); + console.error(`\n${driftFindings.length} finding(s) — run npm run sync to update.`); + process.exitCode = 1; +} + // ── Framework CSS vendoring (shared) ─────────────────────────────────────────── /** Copy the plugin's full bundle into the vendored badges/ dir for the preview. */ function vendorFullBundle() { - mkdirSync(VENDOR_BADGES, { recursive: true }); + const label = 'framework-css/badges/slashed.full.css'; + const dest = join(VENDOR_BADGES, 'slashed.full.css'); if (existsSync(PLUGIN_FULL_CSS)) { - copyFileSync(PLUGIN_FULL_CSS, join(VENDOR_BADGES, 'slashed.full.css')); - process.stdout.write(' copy framework-css/badges/slashed.full.css (from dist/)\n'); - } else if (existsSync(join(VENDOR_BADGES, 'slashed.full.css'))) { - process.stdout.write(' keep framework-css/badges/slashed.full.css (dist/ bundle missing)\n'); + if (!CHECK_MODE) mkdirSync(VENDOR_BADGES, { recursive: true }); + writeFile(dest, readFileSync(PLUGIN_FULL_CSS), label); + if (!CHECK_MODE) process.stdout.write(` copy ${label} (from dist/)\n`); + } else if (existsSync(dest)) { + if (!CHECK_MODE) process.stdout.write(` keep ${label} (dist/ bundle missing)\n`); } else { - process.stderr.write(' WARN dist/slashed.full.css not found — preview will be unstyled until the framework CSS is installed.\n'); + process.stderr.write(` WARN dist/slashed.full.css not found — preview will be unstyled until the framework CSS is installed.\n`); } } @@ -171,29 +255,34 @@ function copyLocalDir(srcDir, srcBase) { copyLocalDir(srcPath, srcBase); } else { if (isIgnored(rel)) { - process.stdout.write(` skip src/${rel} (syncignore)\n`); + if (!CHECK_MODE) process.stdout.write(` skip src/${rel} (syncignore)\n`); continue; } const destPath = join(SRC, rel); assertWithinSrc(destPath); - mkdirSync(dirname(destPath), { recursive: true }); - copyFileSync(srcPath, destPath); - trackVendored(rel, `local:configurator/src/${rel}`); - process.stdout.write(` copy src/${rel}\n`); + const relPosix = toPosix(rel); + visitedSrcRel.add(relPosix); + writeFile(destPath, readFileSync(srcPath), `src/${relPosix}`); + if (!CHECK_MODE) { + trackVendored(rel, `local:configurator/src/${rel}`); + process.stdout.write(` copy src/${rel}\n`); + } } } } function vendorChromeLocal(repoRoot) { const coreDir = resolve(repoRoot, 'core'); - mkdirSync(VENDOR_CORE, { recursive: true }); + if (!CHECK_MODE) mkdirSync(VENDOR_CORE, { recursive: true }); for (const name of CHROME_LAYERS) { const from = join(coreDir, name); if (!existsSync(from)) { throw new Error(`Framework chrome layer missing: ${from}`); } - copyFileSync(from, join(VENDOR_CORE, name)); - process.stdout.write(` copy framework-css/core/${name}\n`); + const dest = join(VENDOR_CORE, name); + const label = `framework-css/core/${name}`; + writeFile(dest, readFileSync(from), label); + if (!CHECK_MODE) process.stdout.write(` copy ${label}\n`); } } @@ -228,24 +317,27 @@ async function ghFetchContent(ghPath) { async function syncGhFile(ghPath, destPath) { assertWithinSrc(destPath); const rel = relative(SRC, destPath); + const relPosix = toPosix(rel); if (isIgnored(rel)) { - process.stdout.write(` skip src/${rel} (syncignore)\n`); + if (!CHECK_MODE) process.stdout.write(` skip src/${rel} (syncignore)\n`); return; } + visitedSrcRel.add(relPosix); let content; try { content = await ghFetchContent(ghPath); } catch (err) { if ((err.status === 403 || err.status === 404) && existsSync(destPath)) { - process.stdout.write(` keep src/${rel} (GitHub API ${err.status} — keeping vendored copy)\n`); + if (!CHECK_MODE) process.stdout.write(` keep src/${rel} (GitHub API ${err.status} — keeping vendored copy)\n`); return; } throw err; } - mkdirSync(dirname(destPath), { recursive: true }); - writeFileSync(destPath, content, { encoding: 'utf8' }); - trackVendored(rel, `github:${SLASHED_REPO}/${ghPath}@${REF}`); - process.stdout.write(` fetch src/${rel}\n`); + writeFile(destPath, content, `src/${relPosix}`); + if (!CHECK_MODE) { + trackVendored(rel, `github:${SLASHED_REPO}/${ghPath}@${REF}`); + process.stdout.write(` fetch src/${rel}\n`); + } } async function syncGhDir(ghDir, destDir) { @@ -266,18 +358,17 @@ async function syncGhDir(ghDir, destDir) { } async function vendorChromeRemote() { - mkdirSync(VENDOR_CORE, { recursive: true }); + if (!CHECK_MODE) mkdirSync(VENDOR_CORE, { recursive: true }); for (const name of CHROME_LAYERS) { const dest = join(VENDOR_CORE, name); + const label = `framework-css/core/${name}`; try { const content = await ghFetchContent(`core/${name}`); - // lgtm[js/path-injection] -- dest is join(VENDOR_CORE, name) where name - // is from the hardcoded CHROME_LAYERS array, not from network data. - writeFileSync(dest, content, 'utf8'); - process.stdout.write(` fetch framework-css/core/${name}\n`); + writeFile(dest, content, label); + if (!CHECK_MODE) process.stdout.write(` fetch ${label}\n`); } catch (err) { if ((err.status === 403 || err.status === 404) && existsSync(dest)) { - process.stdout.write(` keep framework-css/core/${name} (GitHub API ${err.status})\n`); + if (!CHECK_MODE) process.stdout.write(` keep ${label} (GitHub API ${err.status})\n`); continue; } throw err; @@ -288,23 +379,68 @@ async function vendorChromeRemote() { // ── Main ───────────────────────────────────────────────────────────────────── async function main() { - console.log('Syncing configurator core...'); + console.log(CHECK_MODE ? 'Checking configurator core sync...' : 'Syncing configurator core...'); const local = findLocalCfgSrc(); if (local) { - console.log(` source: local ${local}`); - // Fresh tree: drop any stale files from the previous fork before copying, - // but preserve syncignored plugin-specific files across the wipe (mirrors - // the same logic used in GitHub API mode). + if (!CHECK_MODE) { + console.log(` source: local ${local}`); + // Fresh tree: drop any stale files from the previous fork before copying, + // but preserve syncignored plugin-specific files across the wipe (mirrors + // the same logic used in GitHub API mode). + const preserved = []; + if (existsSync(SRC)) { + for (const entry of syncIgnore) { + const rel = entry.startsWith('src/') ? entry.slice(4) : entry; + const srcPath = resolve(join(SRC, rel)); + if (!srcPath.startsWith(SRC_ROOT)) continue; + // O_NOFOLLOW rejects symlinks at open time without a TOCTOU-prone pre-check. + let fd; + try { fd = openSync(srcPath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0)); } catch { continue; } + try { + if (!fstatSync(fd).isFile()) continue; + preserved.push({ rel, content: readFileSync(fd) }); + process.stdout.write(` keep src/${rel} (syncignore — saved across wipe)\n`); + } finally { closeSync(fd); } + } + rmSync(SRC, { recursive: true, force: true }); + } + mkdirSync(SRC, { recursive: true }); + for (const { rel, content } of preserved) { + const destPath = resolve(join(SRC, rel)); + if (!destPath.startsWith(SRC_ROOT)) continue; + mkdirSync(dirname(destPath), { recursive: true }); + writeFileSync(destPath, content); + } + } + // --check mode never wipes/preserves — SRC is left untouched; copyLocalDir + // below only reads from it (via writeFile()'s compare branch). + copyLocalDir(local, local); + vendorChromeLocal(resolve(local, '../..')); // configurator/src -> repo root + vendorFullBundle(); + if (CHECK_MODE) { + reportOrphans(); + finishCheck(`local ${local}`); + return; + } + writeManifest(process.env.SLASHED_CONFIGURATOR_SRC ? 'local:SLASHED_CONFIGURATOR_SRC' : 'local'); + console.log('Done (local).'); + return; + } + + if (!CHECK_MODE) { + console.log(` source: GitHub ${SLASHED_REPO}@${REF}`); + // Fresh tree: drop stale files before fetching, but preserve any syncignored + // files so plugin-specific overrides survive the wipe. const preserved = []; if (existsSync(SRC)) { for (const entry of syncIgnore) { const rel = entry.startsWith('src/') ? entry.slice(4) : entry; const srcPath = resolve(join(SRC, rel)); if (!srcPath.startsWith(SRC_ROOT)) continue; - // O_NOFOLLOW rejects symlinks at open time without a TOCTOU-prone pre-check. + // Open the fd first so stat + read operate on the same inode (no TOCTOU). let fd; - try { fd = openSync(srcPath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0)); } catch { continue; } + try { fd = openSync(srcPath, 'r'); } catch { continue; } try { if (!fstatSync(fd).isFile()) continue; preserved.push({ rel, content: readFileSync(fd) }); @@ -320,46 +456,17 @@ async function main() { mkdirSync(dirname(destPath), { recursive: true }); writeFileSync(destPath, content); } - copyLocalDir(local, local); - vendorChromeLocal(resolve(local, '../..')); // configurator/src -> repo root - vendorFullBundle(); - writeManifest(process.env.SLASHED_CONFIGURATOR_SRC ? 'local:SLASHED_CONFIGURATOR_SRC' : 'local'); - console.log('Done (local).'); - return; - } - - console.log(` source: GitHub ${SLASHED_REPO}@${REF}`); - // Fresh tree: drop stale files before fetching, but preserve any syncignored - // files so plugin-specific overrides survive the wipe. - const preserved = []; - if (existsSync(SRC)) { - for (const entry of syncIgnore) { - const rel = entry.startsWith('src/') ? entry.slice(4) : entry; - const srcPath = resolve(join(SRC, rel)); - if (!srcPath.startsWith(SRC_ROOT)) continue; - // Open the fd first so stat + read operate on the same inode (no TOCTOU). - let fd; - try { fd = openSync(srcPath, 'r'); } catch { continue; } - try { - if (!fstatSync(fd).isFile()) continue; - preserved.push({ rel, content: readFileSync(fd) }); - process.stdout.write(` keep src/${rel} (syncignore — saved across wipe)\n`); - } finally { closeSync(fd); } - } - rmSync(SRC, { recursive: true, force: true }); - } - mkdirSync(SRC, { recursive: true }); - for (const { rel, content } of preserved) { - const destPath = resolve(join(SRC, rel)); - if (!destPath.startsWith(SRC_ROOT)) continue; - mkdirSync(dirname(destPath), { recursive: true }); - writeFileSync(destPath, content); } // Recursively vendor the entire configurator/src tree (components, lib, data, // and root files: App.svelte, main.ts, types.ts, app.css, vite-env.d.ts). await syncGhDir(CFG_SRC, SRC); await vendorChromeRemote(); vendorFullBundle(); + if (CHECK_MODE) { + reportOrphans(); + finishCheck(`GitHub ${SLASHED_REPO}@${REF}`); + return; + } writeManifest(`github:${SLASHED_REPO}@${REF}`); console.log('Done (remote).'); } diff --git a/package.json b/package.json index 60f7f19c..43e7721e 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "version-sync": "node scripts/version-sync.js", "changelog": "node scripts/changelog-release.js", "verify": "node scripts/verify-sync.js", + "check": "node scripts/check.js", "lint:css": "stylelint \"SLASHED-for-WP/**/*.css\"", "lint:css:fix": "stylelint \"SLASHED-for-WP/**/*.css\" --fix", "lint:php": "node scripts/lint-php.js", diff --git a/scripts/check.js b/scripts/check.js new file mode 100644 index 00000000..072119b9 --- /dev/null +++ b/scripts/check.js @@ -0,0 +1,44 @@ +#!/usr/bin/env node +/** + * Runs every generated-artifact drift check in one command: class hints, + * variables hints, and the vendored admin-app configurator core/CSS. Each + * sub-check already knows how to report and exit non-zero on its own — + * this just runs them all and aggregates the exit status, so CI (or a + * pre-commit hook) has one command to gate on instead of three. + * + * Usage: + * node scripts/check.js (npm run check) + */ + +import { execFileSync } from 'node:child_process'; +import path from 'node:path'; + +const ROOT = path.resolve(import.meta.dirname, '..'); + +const CHECKS = [ + { label: 'class-hints', file: 'scripts/gen-class-hints.js', cwd: ROOT }, + { label: 'variables-hints', file: 'scripts/gen-variables-hints.js', cwd: ROOT }, + { + label: 'admin-app sync', + file: 'scripts/sync-core.mjs', + cwd: path.join(ROOT, 'SLASHED-for-WP', 'admin-app'), + }, +]; + +let failed = false; + +for (const { label, file, cwd } of CHECKS) { + console.log(`\n[check] running ${label}...`); + try { + execFileSync(process.execPath, [file, '--check'], { cwd, stdio: 'inherit' }); + } catch { + failed = true; + } +} + +if (failed) { + console.error('\n[check] one or more drift checks failed — see output above.'); + process.exit(1); +} + +console.log('\n[check] all drift checks passed.'); From 3a93aed268a64bc9799a20c77fd5bb0be6ea37cb Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 14:03:06 +0000 Subject: [PATCH 05/20] fix(admin-app): run sync before svelte-check via a precheck hook npm run check (svelte-check) had no equivalent of dev/build's predev/prebuild sync hook, so it type-checked whatever was already on disk. On a fresh checkout with the committed vendored src/ still predating the lucide-svelte rename, that meant a stale module-resolution error instead of an accurate check against the current framework source. --- SLASHED-for-WP/admin-app/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/SLASHED-for-WP/admin-app/package.json b/SLASHED-for-WP/admin-app/package.json index 4a2d8c71..9b225418 100644 --- a/SLASHED-for-WP/admin-app/package.json +++ b/SLASHED-for-WP/admin-app/package.json @@ -10,6 +10,7 @@ "dev": "vite", "prebuild": "node scripts/sync-core.mjs", "build": "vite build", + "precheck": "node scripts/sync-core.mjs", "check": "svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { From 126e1b8c31ff81e86972efe97db9c01b695b8be1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 14:06:17 +0000 Subject: [PATCH 06/20] fix(sync-core): close TOCTOU/symlink gaps flagged by CodeQL and Qodo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - copyLocalDir: open the fd once and reuse it for both the isDirectory check and the file read (CodeQL: potential file system race condition) instead of a separate statSync + readFileSync on the path. - GitHub-mode syncignore preservation: use O_NOFOLLOW like the local-mode block already does, instead of a plain 'r' open that would follow symlinks (Qodo). - reportOrphans(): also scan framework-css/core/ for files outside the fixed CHROME_LAYERS set, not just src/ (Qodo). - Document the accepted trust boundary for the GitHub-fetch-to-disk write path (CodeQL: network data written to file) — hardcoded repo/ ref, HTTPS transport, and destination paths already confined to SRC regardless of fetched content. --- .../admin-app/scripts/sync-core.mjs | 64 +++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/SLASHED-for-WP/admin-app/scripts/sync-core.mjs b/SLASHED-for-WP/admin-app/scripts/sync-core.mjs index a4d95218..0298ae32 100644 --- a/SLASHED-for-WP/admin-app/scripts/sync-core.mjs +++ b/SLASHED-for-WP/admin-app/scripts/sync-core.mjs @@ -185,13 +185,22 @@ function listRelFiles(dir, base, out = []) { return out; } -/** In --check mode, flag src/ files that are vendored locally but no longer resolved from upstream. */ +/** + * In --check mode, flag files vendored locally but no longer resolved from + * upstream: src/ files not visited this run, and framework-css/core/ files + * outside the fixed CHROME_LAYERS set (the complete, hardcoded list of + * chrome layers this script ever vendors — anything else there is stale). + */ function reportOrphans() { if (!CHECK_MODE) return; for (const rel of listRelFiles(SRC, SRC)) { if (isIgnored(rel) || visitedSrcRel.has(rel)) continue; reportDrift('orphan', `src/${rel}`, 'vendored locally, no longer present upstream'); } + for (const rel of listRelFiles(VENDOR_CORE, VENDOR_CORE)) { + if (CHROME_LAYERS.includes(rel)) continue; + reportDrift('orphan', `framework-css/core/${rel}`, 'vendored locally, no longer a tracked chrome layer'); + } } /** Print the check result and set the process exit code. Never used outside --check mode. */ @@ -251,23 +260,33 @@ function copyLocalDir(srcDir, srcBase) { for (const entry of readdirSync(srcDir)) { const srcPath = join(srcDir, entry); const rel = relative(srcBase, srcPath); - if (statSync(srcPath).isDirectory()) { - copyLocalDir(srcPath, srcBase); - } else { - if (isIgnored(rel)) { - if (!CHECK_MODE) process.stdout.write(` skip src/${rel} (syncignore)\n`); - continue; - } - const destPath = join(SRC, rel); - assertWithinSrc(destPath); - const relPosix = toPosix(rel); - visitedSrcRel.add(relPosix); - writeFile(destPath, readFileSync(srcPath), `src/${relPosix}`); - if (!CHECK_MODE) { - trackVendored(rel, `local:configurator/src/${rel}`); - process.stdout.write(` copy src/${rel}\n`); + // Open first so the isDirectory check and (for files) the read below + // operate on the same fd/inode — no TOCTOU window between checking what + // the entry is and using it, matching the O_NOFOLLOW idiom used elsewhere + // in this file for the syncignore-preservation reads. + const fd = openSync(srcPath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0)); + let isDir; + try { + isDir = fstatSync(fd).isDirectory(); + if (!isDir) { + if (isIgnored(rel)) { + if (!CHECK_MODE) process.stdout.write(` skip src/${rel} (syncignore)\n`); + } else { + const destPath = join(SRC, rel); + assertWithinSrc(destPath); + const relPosix = toPosix(rel); + visitedSrcRel.add(relPosix); + writeFile(destPath, readFileSync(fd), `src/${relPosix}`); + if (!CHECK_MODE) { + trackVendored(rel, `local:configurator/src/${rel}`); + process.stdout.write(` copy src/${rel}\n`); + } + } } + } finally { + closeSync(fd); } + if (isDir) copyLocalDir(srcPath, srcBase); } } @@ -287,6 +306,13 @@ function vendorChromeLocal(repoRoot) { } // ── GitHub API sync ─────────────────────────────────────────────────────────── +// +// Content fetched here is written to disk verbatim by writeFile() (source +// vendoring — there's no meaningful way to "sanitize" a .svelte/.ts file +// without corrupting it). The accepted trust boundary: SLASHED_REPO/REF are +// hardcoded constants (not derived from any input), fetched over HTTPS via +// the official GitHub REST API, and every write destination is confined to +// SRC by assertWithinSrc()/assertSafeName() regardless of fetched content. async function ghFetch(path) { const url = `https://api.github.com/repos/${SLASHED_REPO}/contents/${path}?ref=${REF}`; @@ -438,9 +464,11 @@ async function main() { const rel = entry.startsWith('src/') ? entry.slice(4) : entry; const srcPath = resolve(join(SRC, rel)); if (!srcPath.startsWith(SRC_ROOT)) continue; - // Open the fd first so stat + read operate on the same inode (no TOCTOU). + // Open the fd first so stat + read operate on the same inode (no + // TOCTOU). O_NOFOLLOW rejects symlinks at open time, matching the + // local-source preserve block above. let fd; - try { fd = openSync(srcPath, 'r'); } catch { continue; } + try { fd = openSync(srcPath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0)); } catch { continue; } try { if (!fstatSync(fd).isFile()) continue; preserved.push({ rel, content: readFileSync(fd) }); From b1b9dbef3cc1a519ecb79dfc96a9e3d8ff454a6f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Jul 2026 15:41:18 +0000 Subject: [PATCH 07/20] fix(admin-app): harden frontend overlay's cssUrl injection and live-preview effect PL-029/030: window.slashedApp is a plain global any script on the page can clobber before plugin-main.ts runs. Add a same-origin check before using cssUrl as a stylesheet href, and replace the (window as any) cast with a typed local accessor (mirroring persistence.ts's own window.slashedApp read) instead of widening to any. PL-031: AppOverlay.svelte's live-preview effect (injectLivePreview + registerPreviewDoc) re-ran on every override change with no coalescing, unlike PreviewPanel.svelte's SL-020 fix. A fast-changing control (dragging a slider) could re-run it many times per frame even though the underlying