From 6c49e17ec60c450a6ce3da2dc774693ed4bbb9f1 Mon Sep 17 00:00:00 2001
From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com>
Date: Fri, 5 Jun 2026 09:41:52 +0000
Subject: [PATCH 1/3] fix(bricks): emit brand `base` token in CSS export and
color overrides
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Two spots missed by the partial base->surface rename revert (62b7337) still
read the non-existent `brand_surface` key and emitted a phantom
`--sf-color-surface-light`, silently dropping a user's `brand_base` override:
- admin-app export.js (client-side "Export CSS") — rebuilt the bundle
- class-inventory.php get_admin_color_overrides() — wrong editor swatch preview
(its own docblock says it mirrors the CSS generator, which uses `base`)
Also de-duplicate the ~110-line Bricks font collector: the canonical
implementation now lives once in Slashed_Token_Page::get_bricks_fonts() and the
REST endpoint is a thin wrapper; the shared transient key is a single constant.
No behavioural change.
php -l clean; node --test 64/64; admin SPA rebuilds cleanly.
Co-authored-by: Jack Granatowski
---
CODE-AUDIT.md | 64 ++++++++
.../includes/class-token-page.php | 43 +++++-
.../bricks/admin-app/src/lib/export.js | 5 +-
.../bricks/assets/admin-app/app.js | 2 +-
.../bricks/includes/class-fonts-rest.php | 139 ++----------------
.../bricks/includes/class-inventory.php | 2 +-
6 files changed, 115 insertions(+), 140 deletions(-)
diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md
index a5954f03..e8b7c02f 100644
--- a/CODE-AUDIT.md
+++ b/CODE-AUDIT.md
@@ -5,6 +5,13 @@
> export.js `base → surface` rename). This document reflects the state of the
> codebase at audit time; resolved items are kept for historical context.
+> **2026-06-05 WP-plugin re-audit pass** — a focused re-review of the
+> `plugins/SLASHED-for-WP` tree confirmed most prior High/Medium items were
+> already fixed (CSS-generator allowlist validation, `slashed.php` cleanup +
+> cron moved to the global layer, color defaults consolidated through
+> `Slashed_Token_Defaults`). Two genuine bugs and one duplication remained and
+> were fixed in this pass — see **"Re-audit fixes (2026-06-05)"** below.
+
Whole-repo code review across four domains: build scripts, the WordPress PHP
plugin, the Svelte editor/admin apps, and the CSS source. Overall the codebase
is unusually clean and well-documented — most "odd" patterns are deliberate and
@@ -15,6 +22,63 @@ Date: 2026-06-02
---
+## ✅ Re-audit fixes (2026-06-05)
+
+Applied on branch `audit/wp-plugin-cleanup`. All PHP files pass `php -l`; the
+admin SPA rebuilds cleanly; `node --test` is 64/64 green.
+
+### 1. `surface` → `base` regression fixed in the two remaining stragglers
+
+The framework's only *source* brand token is `--sf-color-base-light`;
+`--sf-color-surface` is a derived semantic alias (`= var(--sf-color-base)`) with
+no `-light`/`-dark` source. Commit `62b7337` partially reverted a
+`base → surface` rename but missed two spots, both of which read the
+non-existent `brand_surface` key and emitted a phantom
+`--sf-color-surface-light`, silently dropping the user's `brand_base` override:
+
+- `integrations/bricks/admin-app/src/lib/export.js:70` — client-side "Export
+ CSS". **Fixed** `'surface'` → `'base'` and rebuilt the bundle
+ (`assets/admin-app/app.js`, one-line diff).
+- `integrations/bricks/includes/class-inventory.php:241`
+ (`get_admin_color_overrides()`) — its own docblock says it mirrors
+ `Slashed_CSS_Generator::generate_color_declarations()` (which uses `base`), so
+ the editor color-swatch preview for the base color was wrong. **Fixed.**
+
+Cross-checked against the source of truth: `class-token-defaults.php`,
+`class-css-generator.php`, `ColorTab.svelte`, `color-model.js`,
+`LivePreview.svelte` all use `base`, as does `tests/color-model.test.js`.
+
+### 2. Bricks font collection de-duplicated
+
+`Slashed_Token_Page::get_bricks_fonts()` and
+`Slashed_Bricks_Fonts_REST::get_fonts()` were ~110-line near-verbatim copies of
+the same option-probing + Font-Manager-CPT query + dedup logic (sharing the
+`slashed_bricks_cpt_fonts` transient) that had already started to drift. The
+collector now lives once in `Slashed_Token_Page::get_bricks_fonts()` (the
+always-loaded canonical owner, in both unified and standalone modes); the REST
+endpoint is a thin wrapper, and the shared transient key is a single constant
+`Slashed_Token_Page::CPT_FONTS_TRANSIENT`. No behavioural change.
+
+### Verified already-resolved since the 2026-06-02 snapshot
+
+CSS-generator allowlist validation (`valid_color`/`valid_dimension`/
+`valid_font_family` + `is_css_safe` + `balanced_parens`); `slashed.php` no-op
+activation hook removed and the version-check cron clean-up moved to the global
+layer; `class-color-resolver.php` default colors derived from
+`Slashed_Token_Defaults`; the "kept for tests" `get_colors()`/`get_classes()`
+wrappers and the empty `slashed_bricks_activation_check()` are gone.
+
+### Still open (documented, not changed this pass)
+
+- `editor-app/src/lib/apply.js` migrate path — the two-siblings-into-one-new-
+ class edge case still reads a pre-batch `globalClasses` snapshot. Lives in the
+ compiled editor bundle and needs a live Bricks editor to verify safely; left
+ as-is to avoid a blind change.
+- `class-css-parser.php` `[^}]*` regex — brittle on `}` inside an
+ `@property` initial-value. Non-fatal (cached, editor-only).
+
+---
+
## 🔴 High priority
### 1. `export.js` drops the `surface` brand color (confirmed regression)
diff --git a/plugins/SLASHED-for-WP/includes/class-token-page.php b/plugins/SLASHED-for-WP/includes/class-token-page.php
index f648625a..669971dd 100644
--- a/plugins/SLASHED-for-WP/includes/class-token-page.php
+++ b/plugins/SLASHED-for-WP/includes/class-token-page.php
@@ -161,13 +161,41 @@ public static function get_class_hints() {
}
/**
- * Collect Bricks-registered fonts for the SPA bootstrap.
+ * Transient key caching the Bricks Font-Manager CPT font list.
*
- * Mirrors the logic in Slashed_Bricks_Fonts_REST::get_fonts() without
- * the REST request overhead. Returns an empty array when Bricks is not
- * active or the integration is disabled.
+ * Shared with Slashed_Bricks_Fonts_REST, which busts it on
+ * save_post_{BRICKS_DB_CUSTOM_FONTS}. Kept here too because this class
+ * is the canonical owner of the collector and is always loaded, whereas
+ * the REST class is only required during REST dispatch.
+ */
+ const CPT_FONTS_TRANSIENT = 'slashed_bricks_cpt_fonts';
+
+ /**
+ * Collect every font Bricks already knows how to serve.
+ *
+ * Canonical implementation shared by the admin SPA bootstrap (here) and
+ * the REST endpoint (Slashed_Bricks_Fonts_REST::get_fonts(), which is a
+ * thin wrapper around this method). SLASHED never loads fonts itself —
+ * Bricks owns that pipeline — so this only enumerates names for the
+ * typography "Bricks fonts" dropdown.
+ *
+ * Bricks does not expose a PHP API for its font registry, so we probe the
+ * WP options it is known to use across versions and skip any unrecognised
+ * shapes gracefully (the SPA falls back to a manual text input):
+ * - bricks_custom_fonts: font_family | family | title | name
+ * - bricks_google_fonts: family | font_family | name | title
+ * - bricks_adobe_fonts: fonts[].font_family | family
+ * - Font Manager CPT (BRICKS_DB_CUSTOM_FONTS): the post title is the
+ * family name. Fonts created via the builder UI may stay in 'draft'
+ * even after the files upload, so both 'publish' and 'draft' are
+ * included. We read titles directly rather than calling
+ * Bricks\Custom_Fonts::get_custom_fonts() (static cache + @font-face
+ * side-effects + publish-only — all unnecessary for a name lookup),
+ * and cache the result in a 1-hour transient busted on CPT save.
+ *
+ * Returns an empty array when the Bricks integration is disabled.
*
- * @return array[]
+ * @return array
*/
public static function get_bricks_fonts() {
if ( class_exists( 'Slashed_Settings' ) && ! Slashed_Settings::is_enabled( 'bricks' ) ) {
@@ -237,8 +265,7 @@ public static function get_bricks_fonts() {
// Fonts uploaded via Bricks Font Manager CPT (includes 'draft' status).
if ( defined( 'BRICKS_DB_CUSTOM_FONTS' ) ) {
- $cache_key = 'slashed_bricks_cpt_fonts';
- $cpt_cached = get_transient( $cache_key );
+ $cpt_cached = get_transient( self::CPT_FONTS_TRANSIENT );
if ( false !== $cpt_cached && is_array( $cpt_cached ) ) {
$fonts = array_merge( $fonts, $cpt_cached );
@@ -264,7 +291,7 @@ public static function get_bricks_fonts() {
'source' => 'custom',
);
}
- set_transient( $cache_key, $cpt_fonts, HOUR_IN_SECONDS );
+ set_transient( self::CPT_FONTS_TRANSIENT, $cpt_fonts, HOUR_IN_SECONDS );
$fonts = array_merge( $fonts, $cpt_fonts );
}
}
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/admin-app/src/lib/export.js b/plugins/SLASHED-for-WP/integrations/bricks/admin-app/src/lib/export.js
index c191eae0..5f761283 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/admin-app/src/lib/export.js
+++ b/plugins/SLASHED-for-WP/integrations/bricks/admin-app/src/lib/export.js
@@ -67,7 +67,10 @@ function generateColorDeclarations(settings) {
const declarations = [];
// Brand colors (light): brand_primary -> --sf-color-primary-light.
- const brandColors = ['primary', 'secondary', 'tertiary', 'action', 'neutral', 'surface'];
+ // The final family is `base` (source token --sf-color-base-light), NOT
+ // `surface` — surface is a derived token with no -light source. Must stay
+ // in sync with class-css-generator.php::generate_color_declarations().
+ const brandColors = ['primary', 'secondary', 'tertiary', 'action', 'neutral', 'base'];
for (const color of brandColors) {
const key = `brand_${color}`;
if (hasValue(settings[key])) {
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.js b/plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.js
index 9208fe9c..e4037520 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.js
+++ b/plugins/SLASHED-for-WP/integrations/bricks/assets/admin-app/app.js
@@ -18,7 +18,7 @@ var Dn=Object.defineProperty;var br=e=>{throw TypeError(e)};var Ln=(e,t,s)=>t in
class autocomplete, and color palette in any active builder integration.
Variables registered
Classes registered
Plugin Settings
Choose which SLASHED CSS bundle to load on the frontend and in builder canvases. Essential is the full core layer (everything in core/). Optimal adds the optional color palette, extended size/spacing scales,
form styling, and legacy fallbacks. Full additionally bundles the
component tokens & styles and the utility classes.
Override the HTML root font-size. Use this when your theme or builder forces a root font-size
- that conflicts with rem-based framework values.
`);function ec(e,t){ze(t,!0);let s=he(Ve(le.pluginSettings?.css_bundle??"optimal")),a=he(Ve(le.pluginSettings?.html_font_size??"")),n=he(Ve(le.pluginSettings?.show_class_hints??!1)),i=he(!1),o=he(!1),u=he(""),c=null;const v=y(()=>le.activeIntegrations?.bricks??!0);async function h(){J(i,!0),J(o,!1),J(u,"");try{await Gl({css_bundle:r(s),html_font_size:r(a),show_class_hints:r(n)}),J(o,!0),c&&clearTimeout(c),c=setTimeout(()=>{J(o,!1),c=null},3e3)}catch(H){J(u,H.message||"Save failed",!0)}finally{J(i,!1)}}var f=Ql(),p=d(l(f),4),m=d(l(p),2),b=l(m),x=d(m,4),_=l(x),w=d(p,4),E=d(l(w),2),A=l(E);A.value=A.__value="essential";var F=d(A);F.value=F.__value="optimal";var Y=d(F);Y.value=Y.__value="full";var T=d(w,2),z=d(l(T),2),D=l(z);D.value=D.__value="";var O=d(D);O.value=O.__value="100";var K=d(O);K.value=K.__value="62.5";var q=d(T,2);{var B=H=>{var se=Yl(),ne=l(se),ae=l(ne);wo(ae,()=>r(n),ie=>J(n,ie)),S(H,se)},$=H=>{var se=Xl();S(H,se)};me(q,H=>{r(v)?H(B):H($,-1)})}var k=d(q,2),R=l(k),G=l(R),Z=d(R,2);{var j=H=>{var se=Zl();S(H,se)};me(Z,H=>{r(o)&&H(j)})}var N=d(Z,2);{var L=H=>{var se=Jl(),ne=l(se);V(()=>P(ne,r(u))),S(H,se)};me(N,H=>{r(u)&&H(L)})}V(()=>{P(b,le.inventory?.variables?.length??0),P(_,(le.inventory?.sf_classes?.length??0)+(le.inventory?.is_classes?.length??0)),R.disabled=r(i),P(G,r(i)?"Saving...":"Save Settings")}),ka(E,()=>r(s),H=>J(s,H)),ka(z,()=>r(a),H=>J(a,H)),ge("click",R,h),S(e,f),Fe()}He(["click"]);const Lr=22.5,tc=95;function qn(e,t){if(e<=0||t<=0)return null;const s=tc-Lr,a=(t-e)/s,n=parseFloat(a.toFixed(6)),i=parseFloat(e.toFixed(4)),o=parseFloat(t.toFixed(4));return`clamp(${i}rem, calc(${n} * (100vw - ${Lr}rem) + ${i}rem), ${o}rem)`}function Ir(e){const t=parseFloat(e);if(isNaN(t))return"0";let s=t.toFixed(6).replace(/0+$/,"").replace(/\.$/,"");return s===""?"0":s}function De(e){return e!=null&&e!==""}function sc(e){const t=[],s=["primary","secondary","tertiary","action","neutral","surface"];for(const i of s){const o=`brand_${i}`;De(e[o])&&t.push(`--sf-color-${i}-light: ${e[o]};`)}const a=["success","warning","error","info","danger"];for(const i of a){const o=`status_${i}`;De(e[o])&&t.push(`--sf-color-${i}-light: ${e[o]};`)}if(e.dark_overrides_enabled!=="0"){for(const i of s){const o=`brand_dark_${i}`;De(e[o])&&t.push(`--sf-color-${i}-dark: ${e[o]};`)}for(const i of a){const o=`status_dark_${i}`;De(e[o])&&t.push(`--sf-color-${i}-dark: ${e[o]};`)}}return t}function ac(e){const t=[],s=["body","heading","mono","display","humanist","geometric","slab"];for(const n of s){const i=`font_${n}`;De(e[i])&&t.push(`--sf-font-${n}: ${e[i]};`)}De(e.text_scale)&&t.push(`--sf-text-scale: ${e.text_scale};`),De(e.text_display_scale)&&t.push(`--sf-text-display-scale: ${e.text_display_scale};`);const a=["2xs","xs","s","m","l","xl","2xl","3xl","4xl","display-s","display-m","display-l"];for(const n of a){const i=`size_${n}_min`,o=`size_${n}_max`,u=e[i],c=e[o];if(De(u)&&De(c)){const v=qn(parseFloat(u),parseFloat(c));v&&t.push(`--sf-text-${n}: ${v};`)}}return t}function rc(e){const t=[];De(e.space_scale)&&t.push(`--sf-space-scale: ${e.space_scale};`);const s=["2xs","xs","s","m","l","xl","2xl","3xl","4xl"];for(const n of s){const i=e[`space_${n}_min`],o=e[`space_${n}_max`];if(De(i)&&De(o)){const u=qn(parseFloat(i),parseFloat(o));u&&t.push(`--sf-space-${n}: calc(${u} * var(--sf-space-scale));`)}}const a={gutter:"--sf-space-gutter",gap:"--sf-gap",content_gap:"--sf-content-gap",component_pad:"--sf-component-pad",section_pad:"--sf-section-pad"};for(const[n,i]of Object.entries(a))De(e[n])&&t.push(`${i}: ${e[n]};`);return t}function nc(e){const t=[];return De(e.radius_scale)&&t.push(`--sf-radius-scale: ${e.radius_scale};`),t}function ic(e){const t=[];return De(e.shadow_strength)&&t.push(`--sf-shadow-strength: calc(${e.shadow_strength} + var(--sf-is-dark) * 0.17);`),De(e.glow_color)&&t.push(`--sf-shadow-glow-color: ${e.glow_color};`),t}function oc(e){const t=[];De(e.motion_scale)&&t.push(`--sf-motion-scale: ${e.motion_scale};`);const s=["instant","fast","normal","slow","slower"];for(const a of s){const n=`duration_${a}`;De(e[n])&&t.push(`--sf-duration-${a}: calc(${e[n]}ms * var(--sf-motion-scale));`)}return t}function lc(e){const t=[],s=["below","base","raised","low","mid","high","top","max"];for(const a of s)De(e[a])&&t.push(`--sf-z-${a}: ${parseInt(e[a],10)};`);return t}function cc(e){const t=[],s={contrast_bias:"--sf-contrast-bias",contrast_threshold:"--sf-contrast-threshold",opacity_disabled:"--sf-opacity-disabled"};for(const[n,i]of Object.entries(s))De(e[n])&&t.push(`${i}: ${Ir(e[n])};`);const a={focus_ring_width:"--sf-focus-ring-width",focus_ring_offset:"--sf-focus-ring-offset"};for(const[n,i]of Object.entries(a))De(e[n])&&t.push(`${i}: ${Ir(e[n])}px;`);return De(e.focus_ring_style)&&["solid","dashed","dotted","double","none"].includes(e.focus_ring_style)&&t.push(`--sf-focus-ring-style: ${e.focus_ring_style};`),t}function mr(e){const t=[];if(e.colors&&typeof e.colors=="object"&&t.push(...sc(e.colors)),e.typography&&typeof e.typography=="object"&&t.push(...ac(e.typography)),e.spacing&&typeof e.spacing=="object"&&t.push(...rc(e.spacing)),e.radius&&typeof e.radius=="object"&&t.push(...nc(e.radius)),e.shadows&&typeof e.shadows=="object"&&t.push(...ic(e.shadows)),e.motion&&typeof e.motion=="object"&&t.push(...oc(e.motion)),e.zindex&&typeof e.zindex=="object"&&t.push(...lc(e.zindex)),e.contrast&&typeof e.contrast=="object"&&t.push(...cc(e.contrast)),t.length===0)return"";let s=`@layer slashed.overrides {
+ that conflicts with rem-based framework values.
`);function ec(e,t){ze(t,!0);let s=he(Ve(le.pluginSettings?.css_bundle??"optimal")),a=he(Ve(le.pluginSettings?.html_font_size??"")),n=he(Ve(le.pluginSettings?.show_class_hints??!1)),i=he(!1),o=he(!1),u=he(""),c=null;const v=y(()=>le.activeIntegrations?.bricks??!0);async function h(){J(i,!0),J(o,!1),J(u,"");try{await Gl({css_bundle:r(s),html_font_size:r(a),show_class_hints:r(n)}),J(o,!0),c&&clearTimeout(c),c=setTimeout(()=>{J(o,!1),c=null},3e3)}catch(H){J(u,H.message||"Save failed",!0)}finally{J(i,!1)}}var f=Ql(),p=d(l(f),4),m=d(l(p),2),b=l(m),x=d(m,4),_=l(x),w=d(p,4),E=d(l(w),2),A=l(E);A.value=A.__value="essential";var F=d(A);F.value=F.__value="optimal";var Y=d(F);Y.value=Y.__value="full";var T=d(w,2),z=d(l(T),2),D=l(z);D.value=D.__value="";var O=d(D);O.value=O.__value="100";var K=d(O);K.value=K.__value="62.5";var q=d(T,2);{var B=H=>{var se=Yl(),ne=l(se),ae=l(ne);wo(ae,()=>r(n),ie=>J(n,ie)),S(H,se)},$=H=>{var se=Xl();S(H,se)};me(q,H=>{r(v)?H(B):H($,-1)})}var k=d(q,2),R=l(k),G=l(R),Z=d(R,2);{var j=H=>{var se=Zl();S(H,se)};me(Z,H=>{r(o)&&H(j)})}var N=d(Z,2);{var L=H=>{var se=Jl(),ne=l(se);V(()=>P(ne,r(u))),S(H,se)};me(N,H=>{r(u)&&H(L)})}V(()=>{P(b,le.inventory?.variables?.length??0),P(_,(le.inventory?.sf_classes?.length??0)+(le.inventory?.is_classes?.length??0)),R.disabled=r(i),P(G,r(i)?"Saving...":"Save Settings")}),ka(E,()=>r(s),H=>J(s,H)),ka(z,()=>r(a),H=>J(a,H)),ge("click",R,h),S(e,f),Fe()}He(["click"]);const Lr=22.5,tc=95;function qn(e,t){if(e<=0||t<=0)return null;const s=tc-Lr,a=(t-e)/s,n=parseFloat(a.toFixed(6)),i=parseFloat(e.toFixed(4)),o=parseFloat(t.toFixed(4));return`clamp(${i}rem, calc(${n} * (100vw - ${Lr}rem) + ${i}rem), ${o}rem)`}function Ir(e){const t=parseFloat(e);if(isNaN(t))return"0";let s=t.toFixed(6).replace(/0+$/,"").replace(/\.$/,"");return s===""?"0":s}function De(e){return e!=null&&e!==""}function sc(e){const t=[],s=["primary","secondary","tertiary","action","neutral","base"];for(const i of s){const o=`brand_${i}`;De(e[o])&&t.push(`--sf-color-${i}-light: ${e[o]};`)}const a=["success","warning","error","info","danger"];for(const i of a){const o=`status_${i}`;De(e[o])&&t.push(`--sf-color-${i}-light: ${e[o]};`)}if(e.dark_overrides_enabled!=="0"){for(const i of s){const o=`brand_dark_${i}`;De(e[o])&&t.push(`--sf-color-${i}-dark: ${e[o]};`)}for(const i of a){const o=`status_dark_${i}`;De(e[o])&&t.push(`--sf-color-${i}-dark: ${e[o]};`)}}return t}function ac(e){const t=[],s=["body","heading","mono","display","humanist","geometric","slab"];for(const n of s){const i=`font_${n}`;De(e[i])&&t.push(`--sf-font-${n}: ${e[i]};`)}De(e.text_scale)&&t.push(`--sf-text-scale: ${e.text_scale};`),De(e.text_display_scale)&&t.push(`--sf-text-display-scale: ${e.text_display_scale};`);const a=["2xs","xs","s","m","l","xl","2xl","3xl","4xl","display-s","display-m","display-l"];for(const n of a){const i=`size_${n}_min`,o=`size_${n}_max`,u=e[i],c=e[o];if(De(u)&&De(c)){const v=qn(parseFloat(u),parseFloat(c));v&&t.push(`--sf-text-${n}: ${v};`)}}return t}function rc(e){const t=[];De(e.space_scale)&&t.push(`--sf-space-scale: ${e.space_scale};`);const s=["2xs","xs","s","m","l","xl","2xl","3xl","4xl"];for(const n of s){const i=e[`space_${n}_min`],o=e[`space_${n}_max`];if(De(i)&&De(o)){const u=qn(parseFloat(i),parseFloat(o));u&&t.push(`--sf-space-${n}: calc(${u} * var(--sf-space-scale));`)}}const a={gutter:"--sf-space-gutter",gap:"--sf-gap",content_gap:"--sf-content-gap",component_pad:"--sf-component-pad",section_pad:"--sf-section-pad"};for(const[n,i]of Object.entries(a))De(e[n])&&t.push(`${i}: ${e[n]};`);return t}function nc(e){const t=[];return De(e.radius_scale)&&t.push(`--sf-radius-scale: ${e.radius_scale};`),t}function ic(e){const t=[];return De(e.shadow_strength)&&t.push(`--sf-shadow-strength: calc(${e.shadow_strength} + var(--sf-is-dark) * 0.17);`),De(e.glow_color)&&t.push(`--sf-shadow-glow-color: ${e.glow_color};`),t}function oc(e){const t=[];De(e.motion_scale)&&t.push(`--sf-motion-scale: ${e.motion_scale};`);const s=["instant","fast","normal","slow","slower"];for(const a of s){const n=`duration_${a}`;De(e[n])&&t.push(`--sf-duration-${a}: calc(${e[n]}ms * var(--sf-motion-scale));`)}return t}function lc(e){const t=[],s=["below","base","raised","low","mid","high","top","max"];for(const a of s)De(e[a])&&t.push(`--sf-z-${a}: ${parseInt(e[a],10)};`);return t}function cc(e){const t=[],s={contrast_bias:"--sf-contrast-bias",contrast_threshold:"--sf-contrast-threshold",opacity_disabled:"--sf-opacity-disabled"};for(const[n,i]of Object.entries(s))De(e[n])&&t.push(`${i}: ${Ir(e[n])};`);const a={focus_ring_width:"--sf-focus-ring-width",focus_ring_offset:"--sf-focus-ring-offset"};for(const[n,i]of Object.entries(a))De(e[n])&&t.push(`${i}: ${Ir(e[n])}px;`);return De(e.focus_ring_style)&&["solid","dashed","dotted","double","none"].includes(e.focus_ring_style)&&t.push(`--sf-focus-ring-style: ${e.focus_ring_style};`),t}function mr(e){const t=[];if(e.colors&&typeof e.colors=="object"&&t.push(...sc(e.colors)),e.typography&&typeof e.typography=="object"&&t.push(...ac(e.typography)),e.spacing&&typeof e.spacing=="object"&&t.push(...rc(e.spacing)),e.radius&&typeof e.radius=="object"&&t.push(...nc(e.radius)),e.shadows&&typeof e.shadows=="object"&&t.push(...ic(e.shadows)),e.motion&&typeof e.motion=="object"&&t.push(...oc(e.motion)),e.zindex&&typeof e.zindex=="object"&&t.push(...lc(e.zindex)),e.contrast&&typeof e.contrast=="object"&&t.push(...cc(e.contrast)),t.length===0)return"";let s=`@layer slashed.overrides {
:root {
`;for(const a of t)s+=` ${a}
`;return s+=` }
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
index f9723f88..d7efe6fa 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
@@ -49,7 +49,7 @@ public function register_routes() {
}
public function bust_cpt_cache() {
- delete_transient( 'slashed_bricks_cpt_fonts' );
+ delete_transient( Slashed_Token_Page::CPT_FONTS_TRANSIENT );
}
public function check_permissions() {
@@ -57,136 +57,17 @@ public function check_permissions() {
}
/**
- * Build the font list from known Bricks option names.
+ * Return the Bricks font list as a REST response.
*
- * Bricks does not publish a PHP API for its font registry, so we probe
- * the WP options it is known to use. Unrecognised shapes are skipped
- * gracefully — the SPA falls back to the Manual text input.
+ * Thin wrapper over the canonical collector
+ * Slashed_Token_Page::get_bricks_fonts(), which is shared with the admin
+ * SPA bootstrap so the dropdown and this endpoint never drift apart. See
+ * that method for the full enumeration/caching notes.
+ *
+ * @param WP_REST_Request $request Unused; the endpoint takes no parameters.
+ * @return WP_REST_Response { "fonts": [ { family, label, source }, … ] }
*/
public function get_fonts( WP_REST_Request $request ) {
- $fonts = array();
-
- // ── Custom fonts uploaded via Bricks > Settings > Custom Fonts ──
- $custom = get_option( 'bricks_custom_fonts', array() );
- if ( is_array( $custom ) ) {
- foreach ( $custom as $font ) {
- if ( ! is_array( $font ) ) {
- continue;
- }
- // Bricks schema variants across versions:
- // font_family — explicit CSS family name (most reliable)
- // family — alternative key used in some versions
- // title — display name; doubles as the CSS family name
- // for fonts downloaded via Bricks' local-Google-
- // Fonts feature (no separate font_family key).
- $family = $font['font_family'] ?? $font['family'] ?? $font['title'] ?? $font['name'] ?? null;
- $label = $font['title'] ?? $font['name'] ?? $family;
- if ( ! $family || ! is_string( $family ) ) {
- continue;
- }
- $fonts[] = array(
- 'family' => sanitize_text_field( $family ),
- 'label' => sanitize_text_field( is_string( $label ) ? $label : $family ),
- 'source' => 'custom',
- );
- }
- }
-
- // ── Google Fonts added via Bricks > Settings > Google Fonts ────
- $google = get_option( 'bricks_google_fonts', array() );
- if ( is_array( $google ) ) {
- foreach ( $google as $font ) {
- if ( ! is_array( $font ) ) {
- continue;
- }
- // Bricks stores the family name in 'family'; 'name' and
- // 'title' are display labels used in schema variants.
- $family = $font['family'] ?? $font['font_family'] ?? $font['name'] ?? $font['title'] ?? null;
- if ( ! $family || ! is_string( $family ) ) {
- continue;
- }
- $fonts[] = array(
- 'family' => sanitize_text_field( $family ),
- 'label' => sanitize_text_field( $font['name'] ?? $family ),
- 'source' => 'google',
- );
- }
- }
-
- // ── Adobe Fonts (Typekit) configured in Bricks ──────────────────
- $adobe = get_option( 'bricks_adobe_fonts', array() );
- if ( is_array( $adobe ) && ! empty( $adobe['fonts'] ) && is_array( $adobe['fonts'] ) ) {
- foreach ( $adobe['fonts'] as $font ) {
- if ( ! is_array( $font ) ) {
- continue;
- }
- $family = $font['font_family'] ?? $font['family'] ?? null;
- $label = $font['label'] ?? $font['name'] ?? $family;
- if ( ! $family || ! is_string( $family ) ) {
- continue;
- }
- $fonts[] = array(
- 'family' => sanitize_text_field( $family ),
- 'label' => sanitize_text_field( is_string( $label ) ? $label : $family ),
- 'source' => 'adobe',
- );
- }
- }
-
- // ── Custom fonts uploaded via Bricks Font Manager (CPT) ────────
- // Bricks stores fonts added via its Font Manager as a CPT. Fonts start
- // as 'draft' when created through the builder UI and may stay in that
- // status even after files are uploaded, so we include both 'publish'
- // and 'draft' posts. We query the CPT title directly rather than
- // calling Bricks\Custom_Fonts::get_custom_fonts() because that method
- // uses a static cache, has side-effects (generates @font-face strings),
- // and only queries 'publish' by default — all unnecessary for a name
- // lookup. Results are cached in a transient (1 hour) and invalidated
- // when any custom-font CPT entry is saved.
- if ( defined( 'BRICKS_DB_CUSTOM_FONTS' ) ) {
- $cache_key = 'slashed_bricks_cpt_fonts';
- $cpt_cached = get_transient( $cache_key );
-
- if ( false !== $cpt_cached && is_array( $cpt_cached ) ) {
- $fonts = array_merge( $fonts, $cpt_cached );
- } else {
- $cpt_fonts = array();
- $cpt_posts = get_posts(
- array(
- 'post_type' => BRICKS_DB_CUSTOM_FONTS,
- 'posts_per_page' => -1,
- 'post_status' => array( 'publish', 'draft' ),
- 'fields' => 'ids',
- 'no_found_rows' => true,
- )
- );
- foreach ( $cpt_posts as $post_id ) {
- $family = html_entity_decode( (string) get_the_title( $post_id ), ENT_QUOTES, 'UTF-8' );
- if ( ! $family ) {
- continue;
- }
- $cpt_fonts[] = array(
- 'family' => sanitize_text_field( $family ),
- 'label' => sanitize_text_field( $family ),
- 'source' => 'custom',
- );
- }
- set_transient( $cache_key, $cpt_fonts, HOUR_IN_SECONDS );
- $fonts = array_merge( $fonts, $cpt_fonts );
- }
- }
-
- // Deduplicate by family name (case-insensitive) keeping first entry.
- $seen = array();
- $unique = array();
- foreach ( $fonts as $font ) {
- $key = strtolower( $font['family'] );
- if ( ! isset( $seen[ $key ] ) ) {
- $seen[ $key ] = true;
- $unique[] = $font;
- }
- }
-
- return rest_ensure_response( array( 'fonts' => $unique ) );
+ return rest_ensure_response( array( 'fonts' => Slashed_Token_Page::get_bricks_fonts() ) );
}
}
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
index d0246d33..be05beb0 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
@@ -238,7 +238,7 @@ private static function get_admin_color_overrides() {
$settings = $tokens['colors'];
$overrides = array();
- $brand_colors = array( 'primary', 'secondary', 'tertiary', 'action', 'neutral', 'surface' );
+ $brand_colors = array( 'primary', 'secondary', 'tertiary', 'action', 'neutral', 'base' );
$status_colors = array( 'success', 'warning', 'error', 'info', 'danger' );
// Light source tokens: brand_primary -> --sf-color-primary-light.
From f36f90d85e20589e939b5687e3b48d52387625f5 Mon Sep 17 00:00:00 2001
From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com>
Date: Fri, 5 Jun 2026 10:17:39 +0000
Subject: [PATCH 2/3] refactor(bricks): editor-app cleanups + dedupe PHP
require_once block
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Behaviour-preserving cleanups found during a full read of editor-app
(~5.4k lines — no functional bugs found, only these nits):
- ColorPanel: remove dead `referenceMode` prop (mode is derived from
`onPickValue`); drop the matching arg in ColorApp.
- ColorPanel: collapse the ~90-line Brand/Status palette duplication into
one `{#snippet familyScanner}` rendered twice. app.css is byte-identical,
confirming a pure structural refactor. Bundle rebuilt.
- color-swatches.js: collapse redundant else-if/else (both appendChild).
- slashed-bricks.php: extract the parser/resolver/inventory require_once
trio shared by both bootstrap paths into slashed_bricks_require_data_classes().
Also expand CODE-AUDIT.md: document these fixes, the verified-already-resolved
items, and a "Remaining — needs a decision" list (triplicated DIST_SHA,
duplicated standalone bootstrap, apply.js migrate edge case, css-parser regex,
migrate-keys dual naming) — each intentional or needing a live-Bricks decision.
php -l clean; node --test 64/64; editor-app rebuilds cleanly.
---
CODE-AUDIT.md | 88 +++++-
.../bricks/assets/editor-app/app.js | 10 +-
.../editor-app/src/components/ColorApp.svelte | 2 +-
.../src/components/ColorPanel.svelte | 297 +++++++-----------
.../editor-app/src/lib/color-swatches.js | 3 +-
.../integrations/bricks/slashed-bricks.php | 23 +-
6 files changed, 207 insertions(+), 216 deletions(-)
diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md
index e8b7c02f..2fa49cad 100644
--- a/CODE-AUDIT.md
+++ b/CODE-AUDIT.md
@@ -9,8 +9,12 @@
> `plugins/SLASHED-for-WP` tree confirmed most prior High/Medium items were
> already fixed (CSS-generator allowlist validation, `slashed.php` cleanup +
> cron moved to the global layer, color defaults consolidated through
-> `Slashed_Token_Defaults`). Two genuine bugs and one duplication remained and
-> were fixed in this pass — see **"Re-audit fixes (2026-06-05)"** below.
+> `Slashed_Token_Defaults`). Two genuine bugs, one PHP duplication, and a set
+> of editor-app cleanups were fixed in this pass — see
+> **"Re-audit fixes (2026-06-05)"** below. A deep read of the entire
+> `editor-app` (~5.4k lines) found **no functional bugs** — only the small
+> cleanups listed. Items that need a product/architecture decision before
+> touching are collected under **"Remaining — needs a decision"**.
Whole-repo code review across four domains: build scripts, the WordPress PHP
plugin, the Svelte editor/admin apps, and the CSS source. Overall the codebase
@@ -59,6 +63,38 @@ always-loaded canonical owner, in both unified and standalone modes); the REST
endpoint is a thin wrapper, and the shared transient key is a single constant
`Slashed_Token_Page::CPT_FONTS_TRANSIENT`. No behavioural change.
+### 3. editor-app cleanups (reBEMer + Color System)
+
+A full read of all ~5.4k lines of `editor-app` confirmed the bundle is in very
+good shape — solid lifecycle teardown (every module wires an `AbortController`
++ `destroy()`), debounced + pre-filtered mutation observers, pure unit-tested
+helpers, and an allowlist-based migrate path with snapshot/rollback. The
+following small, behaviour-preserving cleanups were applied and the bundle
+rebuilt (`assets/editor-app/app.js`):
+
+- **Dead prop `referenceMode` removed.** `ColorPanel.svelte` declared and
+ `ColorApp.svelte` passed `referenceMode`, but the component derives its mode
+ purely from whether `onPickValue` is supplied (`pickerMode`). The prop was
+ never read. Removed from both the prop list and the call site.
+- **`ColorPanel.svelte` Brand/Status duplication collapsed.** The two palette
+ sections were ~90 lines of near-identical markup differing only by the source
+ group list. Extracted into a single `{#snippet familyScanner(groups)}`
+ rendered twice (`brandGroups` / `statusGroups`) so they can't drift. Pure
+ structural refactor — `app.css` is byte-identical, confirming no class/markup
+ change.
+- **Redundant branch in `color-swatches.js`.** `injectSFButton()` had an
+ `else if (varBtn) appendChild` / `else appendChild` pair that both did the
+ same thing; collapsed to a single `else`.
+
+### 4. PHP: duplicated `require_once` block extracted
+
+`slashed-bricks.php` loaded the same parser → resolver → inventory trio in both
+`slashed_bricks_data_init()` (plugins_loaded) and `slashed_bricks_init()`
+(after_setup_theme). The two paths gate on different signals and must each load
+their deps independently, so the calls can't simply be removed — instead the
+shared trio is now `slashed_bricks_require_data_classes()`, called from both.
+Idempotent via `require_once`; no behavioural change.
+
### Verified already-resolved since the 2026-06-02 snapshot
CSS-generator allowlist validation (`valid_color`/`valid_dimension`/
@@ -66,16 +102,44 @@ CSS-generator allowlist validation (`valid_color`/`valid_dimension`/
activation hook removed and the version-check cron clean-up moved to the global
layer; `class-color-resolver.php` default colors derived from
`Slashed_Token_Defaults`; the "kept for tests" `get_colors()`/`get_classes()`
-wrappers and the empty `slashed_bricks_activation_check()` are gone.
-
-### Still open (documented, not changed this pass)
-
-- `editor-app/src/lib/apply.js` migrate path — the two-siblings-into-one-new-
- class edge case still reads a pre-batch `globalClasses` snapshot. Lives in the
- compiled editor bundle and needs a live Bricks editor to verify safely; left
- as-is to avoid a blind change.
-- `class-css-parser.php` `[^}]*` regex — brittle on `}` inside an
- `@property` initial-value. Non-fatal (cached, editor-only).
+wrappers and the empty `slashed_bricks_activation_check()` are gone. In
+`editor-app`: the speculative "shape 3 (hypothetical)" history probe in
+`bricks-api.js` is gone (only two version-verified shapes remain), and
+`color-swatches.js` now pre-filters mutations via `touchesPicker()` + a 50 ms
+debounce rather than running `.closest()` on every mutation.
+
+### Remaining — needs a decision (not changed this pass)
+
+Each of these is either intentional-by-design or carries enough behavioural risk
+that it should be a deliberate choice rather than a drive-by edit:
+
+1. **Triplicated `DIST_SHA` constant** — `slashed.php:41`,
+ `slashed-bricks.php:32`, `slashed-gutenberg.php:32` hand-sync the same SHA.
+ The inline comment says this is **deliberate** so each integration file stays
+ self-contained and distributable standalone; the version-sync workflow keeps
+ them aligned. Decision needed: accept the documented duplication, or add a
+ shared canonical constant with a standalone fallback. *Left as-is.*
+2. **Duplicated `slashed_inject_token_overrides()`** — defined in both
+ `slashed.php` and (guarded by `! defined('SLASHED_VERSION')`) in
+ `slashed-bricks.php`. This is the **standalone-mode bootstrap**: the Bricks
+ plugin must provide the function when the unified plugin isn't present.
+ Removing it would break standalone activation. Decision needed: keep, or
+ factor the shared bootstrap into a common file loaded by both. *Left as-is.*
+3. **`apply.js` migrate edge case** — two siblings migrating into the *same new*
+ class name. Re-reading the full file, the live `getGlobalClasses()` reference
+ + the additive merge block + auto-numbering's uniqueness guarantee appear to
+ cover this, but confirming it needs a live Bricks editor. Decision needed:
+ write an integration test harness, or leave the current (apparently-correct)
+ behaviour documented. *Left as-is — no blind change.*
+4. **`class-css-parser.php` `[^}]*` regex** — breaks on a `}` inside an
+ `@property` initial-value. Non-fatal (cached, editor-only) and CSS parsing
+ via regex is inherently brittle. Decision needed: accept, or move to a small
+ tokeniser. *Left as-is.*
+5. **`migrate-keys.js` allowlist carries both naming conventions** — e.g.
+ `_widthMin`/`_widthMax` *and* `_minWidth`/`_maxWidth`. Harmless (unknown keys
+ are simply never present), but worth confirming which Bricks actually uses
+ and pruning the dead half. Decision needed: verify against a live Bricks
+ build before trimming. *Left as-is.*
---
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
index 30c7e21c..1df16455 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
+++ b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
@@ -1,8 +1,8 @@
-var lo=Object.defineProperty;var ka=e=>{throw TypeError(e)};var co=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>co(e,typeof t!="symbol"?t+"":t,n),Ls=(e,t,n)=>t.has(e)||ka("Cannot "+n);var _=(e,t,n)=>(Ls(e,t,"read from private field"),n?n.call(e):t.get(e)),H=(e,t,n)=>t.has(e)?ka("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),j=(e,t,n,r)=>(Ls(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),J=(e,t,n)=>(Ls(e,t,"access private method"),n);var ca=Array.isArray,uo=Array.prototype.indexOf,En=Array.prototype.includes,ys=Array.from,fo=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,_o=Object.getOwnPropertyDescriptors,vo=Object.prototype,ho=Array.prototype,ti=Object.getPrototypeOf,Sa=Object.isExtensible;const po=()=>{};function mo(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const Ne=2,nr=4,ws=8,ri=1<<24,bt=16,kt=32,un=64,Hs=128,ut=512,Me=1024,Re=2048,Mt=4096,qe=8192,ft=16384,Pn=32768,Ws=1<<25,rr=65536,cs=1<<17,go=1<<18,ur=1<<19,bo=1<<20,It=1<<25,In=65536,us=1<<21,Vn=1<<22,on=1<<23,Cn=Symbol("$state"),yo=Symbol("legacy props"),wo=Symbol(""),Jr=Symbol("attributes"),Us=Symbol("class"),Ks=Symbol("style"),br=Symbol("text"),Qr=Symbol("form reset"),ks=new class extends Error{constructor(){super(...arguments);Ue(this,"name","StaleReactionError");Ue(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function ko(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function So(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Eo(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Co(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function xo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ao(e){throw new Error("https://svelte.dev/e/effect_orphan")}function To(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Oo(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Io(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Mo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Lo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Po(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ro=1,No=2,si=4,Bo=8,Fo=16,Do=1,qo=4,jo=8,Ho=16,Wo=1,Uo=2,Ie=Symbol("uninitialized"),ai="http://www.w3.org/1999/xhtml";function Ko(){console.warn("https://svelte.dev/e/derived_inert")}function $o(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function zo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ii(e){return e===this.v}function Vo(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function oi(e){return!Vo(e,this.v)}let Ye=null;function sr(e){Ye=e}function Rn(e,t=!1,n){Ye={p:Ye,i:!1,c:null,e:null,s:e,x:null,r:$,l:null}}function Nn(e){var t=Ye,n=t.e;if(n!==null){t.e=null;for(var r of n)Ti(r)}return t.i=!0,Ye=t.p,{}}function li(){return!0}let hn=[];function ci(){var e=hn;hn=[],mo(e)}function ln(e){if(hn.length===0&&!Cr){var t=hn;queueMicrotask(()=>{t===hn&&ci()})}hn.push(e)}function Go(){for(;hn.length>0;)ci()}function ui(e){var t=$;if(t===null)return K.f|=on,e;if((t.f&Pn)===0&&(t.f&nr)===0)throw e;an(e,t)}function an(e,t){for(;t!==null;){if((t.f&Hs)!==0){if((t.f&Pn)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Yo=-7169;function ge(e,t){e.f=e.f&Yo|t}function ua(e){(e.f&ut)!==0||e.deps===null?ge(e,Me):ge(e,Mt)}function fi(e){if(e!==null)for(const t of e)(t.f&Ne)===0||(t.f&In)===0||(t.f^=In,fi(t.deps))}function di(e,t,n){(e.f&Re)!==0?t.add(e):(e.f&Mt)!==0&&n.add(e),fi(e.deps),ge(e,Me)}let Kr=!1;function Jo(e){var t=Kr;try{return Kr=!1,[e(),Kr]}finally{Kr=t}}let Ps=null,Wn=null,U=null,$s=null,yt=null,zs=null,Cr=!1,Rs=!1,Kn=null,Xr=null;var Ea=0;let Qo=1;var Jn,nn,gn,Qn,Xn,bn,Zn,jt,Br,Xe,Fr,rn,At,Tt,er,yn,Z,Vs,yr,Gs,_i,vi,Zr,Xo,Ys,Un;const ms=class ms{constructor(){H(this,Z);Ue(this,"id",Qo++);H(this,Jn,!1);Ue(this,"linked",!0);H(this,nn,null);H(this,gn,null);Ue(this,"async_deriveds",new Map);Ue(this,"current",new Map);Ue(this,"previous",new Map);Ue(this,"unblocked",new Set);H(this,Qn,new Set);H(this,Xn,new Set);H(this,bn,new Set);H(this,Zn,0);H(this,jt,new Map);H(this,Br,null);H(this,Xe,[]);H(this,Fr,[]);H(this,rn,new Set);H(this,At,new Set);H(this,Tt,new Map);H(this,er,new Set);Ue(this,"is_fork",!1);H(this,yn,!1)}skip_effect(t){_(this,Tt).has(t)||_(this,Tt).set(t,{d:[],m:[]}),_(this,er).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=_(this,Tt).get(t);if(r){_(this,Tt).delete(t);for(var s of r.d)ge(s,Re),n(s);for(s of r.m)ge(s,Mt),n(s)}_(this,er).add(t)}capture(t,n,r=!1){t.v!==Ie&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&on)===0&&(this.current.set(t,[n,r]),yt?.set(t,n)),this.is_fork||(t.v=n)}activate(){U=this}deactivate(){U=null,yt=null}flush(){try{Rs=!0,U=this,J(this,Z,yr).call(this)}finally{Ea=0,zs=null,Kn=null,Xr=null,Rs=!1,U=null,yt=null,xn.clear()}}discard(){for(const t of _(this,Xn))t(this);_(this,Xn).clear(),_(this,bn).clear(),J(this,Z,Un).call(this)}register_created_effect(t){_(this,Fr).push(t)}increment(t,n){if(j(this,Zn,_(this,Zn)+1),t){let r=_(this,jt).get(n)??0;_(this,jt).set(n,r+1)}}decrement(t,n){if(j(this,Zn,_(this,Zn)-1),t){let r=_(this,jt).get(n)??0;r===1?_(this,jt).delete(n):_(this,jt).set(n,r-1)}_(this,yn)||(j(this,yn,!0),ln(()=>{j(this,yn,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)_(this,rn).add(r);for(const r of n)_(this,At).add(r);t.clear(),n.clear()}oncommit(t){_(this,Qn).add(t)}ondiscard(t){_(this,Xn).add(t)}on_fork_commit(t){_(this,bn).add(t)}run_fork_commit_callbacks(){for(const t of _(this,bn))t(this);_(this,bn).clear()}settled(){return(_(this,Br)??j(this,Br,ni())).promise}static ensure(){var t;if(U===null){const n=U=new ms;J(t=n,Z,Ys).call(t),!Rs&&!Cr&&ln(()=>{_(n,Jn)||n.flush()})}return U}apply(){{yt=null;return}}schedule(t){if(zs=t,t.b?.is_pending&&(t.f&(nr|ws|ri))!==0&&(t.f&Pn)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(Kn!==null&&n===$&&(K===null||(K.f&Ne)===0))return;if((r&(un|kt))!==0){if((r&Me)===0)return;n.f^=Me}}_(this,Xe).push(n)}};Jn=new WeakMap,nn=new WeakMap,gn=new WeakMap,Qn=new WeakMap,Xn=new WeakMap,bn=new WeakMap,Zn=new WeakMap,jt=new WeakMap,Br=new WeakMap,Xe=new WeakMap,Fr=new WeakMap,rn=new WeakMap,At=new WeakMap,Tt=new WeakMap,er=new WeakMap,yn=new WeakMap,Z=new WeakSet,Vs=function(){if(this.is_fork)return!0;for(const r of _(this,jt).keys()){for(var t=r,n=!1;t.parent!==null;){if(_(this,Tt).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},yr=function(){var c,u,d;if(j(this,Jn,!0),Ea++>1e3&&(J(this,Z,Un).call(this),el()),!J(this,Z,Vs).call(this)){for(const f of _(this,rn))_(this,At).delete(f),ge(f,Re),this.schedule(f);for(const f of _(this,At))ge(f,Mt),this.schedule(f)}const t=_(this,Xe);j(this,Xe,[]),this.apply();var n=Kn=[],r=[],s=Xr=[];for(const f of t)try{J(this,Z,Gs).call(this,f,n,r)}catch(v){throw mi(f),v}if(U=null,s.length>0){var i=ms.ensure();for(const f of s)i.schedule(f)}if(Kn=null,Xr=null,J(this,Z,Vs).call(this)){J(this,Z,Zr).call(this,r),J(this,Z,Zr).call(this,n);for(const[f,v]of _(this,Tt))pi(f,v);s.length>0&&J(c=U,Z,yr).call(c);return}const o=J(this,Z,_i).call(this);if(o){J(u=o,Z,vi).call(u,this);return}_(this,rn).clear(),_(this,At).clear();for(const f of _(this,Qn))f(this);_(this,Qn).clear(),$s=this,Ca(r),Ca(n),$s=null,_(this,Br)?.resolve();var l=U;if(this.linked&&_(this,Zn)===0&&J(this,Z,Un).call(this),_(this,Xe).length>0){l===null&&(l=this,J(this,Z,Ys).call(this));const f=l;_(f,Xe).push(..._(this,Xe).filter(v=>!_(f,Xe).includes(v)))}l!==null&&J(d=l,Z,yr).call(d)},Gs=function(t,n,r){t.f^=Me;for(var s=t.first;s!==null;){var i=s.f,o=(i&(kt|un))!==0,l=o&&(i&Me)!==0,c=l||(i&qe)!==0||_(this,Tt).has(s);if(!c&&s.fn!==null){o?s.f^=Me:(i&nr)!==0?n.push(s):Ur(s)&&((i&bt)!==0&&_(this,At).add(s),ir(s));var u=s.first;if(u!==null){s=u;continue}}for(;s!==null;){var d=s.next;if(d!==null){s=d;break}s=s.parent}}},_i=function(){for(var t=_(this,nn);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=_(t,nn)}return null},vi=function(t){var r;for(const[s,i]of t.current)!this.previous.has(s)&&t.previous.has(s)&&this.previous.set(s,t.previous.get(s)),this.current.set(s,i);for(const[s,i]of t.async_deriveds){const o=this.async_deriveds.get(s);o&&i.promise.then(o.resolve)}const n=s=>{var i=s.reactions;if(i!==null)for(const c of i){var o=c.f;if((o&Ne)!==0)n(c);else{var l=c;o&(Vn|bt)&&!this.async_deriveds.has(l)&&(_(this,At).delete(l),ge(l,Re),this.schedule(l))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>t.discard()),J(r=t,Z,Un).call(r),U=this,J(this,Z,yr).call(this)},Zr=function(t){for(var n=0;n!this.current.has(v));if(s.length===0)t&&f.discard();else if(n.length>0){if(t)for(const v of _(this,er))f.unskip_effect(v,h=>{var b;(h.f&(bt|Vn))!==0?f.schedule(h):J(b=f,Z,Zr).call(b,[h])});f.activate();var i=new Set,o=new Map;for(var l of n)hi(l,s,i,o);o=new Map;var c=[...f.current.keys()].filter(v=>this.current.has(v)?this.current.get(v)[0]!==v.v:!0);if(c.length>0)for(const v of _(this,Fr))(v.f&(ft|qe|cs))===0&&fa(v,c,o)&&((v.f&(Vn|bt))!==0?(ge(v,Re),f.schedule(v)):_(f,rn).add(v));if(_(f,Xe).length>0&&!_(f,yn)){f.apply();for(var u of _(f,Xe))J(d=f,Z,Gs).call(d,u,[],[]);j(f,Xe,[])}f.deactivate()}}}},Ys=function(){Wn===null?Ps=Wn=this:(j(Wn,gn,this),j(this,nn,Wn)),Wn=this},Un=function(){var t=_(this,nn),n=_(this,gn);t===null?Ps=n:j(t,gn,n),n===null?Wn=t:j(n,nn,t),this.linked=!1};let Mn=ms;function Zo(e){var t=Cr;Cr=!0;try{for(var n;;){if(Go(),U===null)return n;U.flush()}}finally{Cr=t}}function el(){try{To()}catch(e){an(e,zs)}}let qt=null;function Ca(e){var t=e.length;if(t!==0){for(var n=0;n0)){xn.clear();for(const s of qt){if((s.f&(ft|qe))!==0)continue;const i=[s];let o=s.parent;for(;o!==null;)qt.has(o)&&(qt.delete(o),i.push(o)),o=o.parent;for(let l=i.length-1;l>=0;l--){const c=i[l];(c.f&(ft|qe))===0&&ir(c)}}qt.clear()}}qt=null}}function hi(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const i=s.f;(i&Ne)!==0?hi(s,t,n,r):(i&(Vn|bt))!==0&&(i&Re)===0&&fa(s,t,r)&&(ge(s,Re),da(s))}}function fa(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(En.call(t,s))return!0;if((s.f&Ne)!==0&&fa(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function da(e){U.schedule(e)}function pi(e,t){if(!((e.f&kt)!==0&&(e.f&Me)!==0)){(e.f&Re)!==0?t.d.push(e):(e.f&Mt)!==0&&t.m.push(e),ge(e,Me);for(var n=e.first;n!==null;)pi(n,t),n=n.next}}function mi(e){ge(e,Me);for(var t=e.first;t!==null;)mi(t),t=t.next}function tl(e){let t=0,n=Ln(0),r;return()=>{ha()&&(a(n),Cs(()=>(t===0&&(r=fr(()=>e(()=>xr(n)))),t+=1,()=>{ln(()=>{t-=1,t===0&&(r?.(),r=void 0,xr(n))})})))}}var nl=rr|ur;function rl(e,t,n,r){new sl(e,t,n,r)}var at,la,it,wn,$e,ot,De,Ze,Ht,kn,sn,tr,Dr,qr,Wt,gs,be,al,il,ol,Js,es,ts,Qs,Xs;class sl{constructor(t,n,r,s){H(this,be);Ue(this,"parent");Ue(this,"is_pending",!1);Ue(this,"transform_error");H(this,at);H(this,la,null);H(this,it);H(this,wn);H(this,$e);H(this,ot,null);H(this,De,null);H(this,Ze,null);H(this,Ht,null);H(this,kn,0);H(this,sn,0);H(this,tr,!1);H(this,Dr,new Set);H(this,qr,new Set);H(this,Wt,null);H(this,gs,tl(()=>(j(this,Wt,Ln(_(this,kn))),()=>{j(this,Wt,null)})));j(this,at,t),j(this,it,n),j(this,wn,i=>{var o=$;o.b=this,o.f|=Hs,r(i)}),this.parent=$.b,this.transform_error=s??this.parent?.transform_error??(i=>i),j(this,$e,ma(()=>{J(this,be,Js).call(this)},nl))}defer_effect(t){di(t,_(this,Dr),_(this,qr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!_(this,it).pending}update_pending_count(t,n){J(this,be,Qs).call(this,t,n),j(this,kn,_(this,kn)+t),!(!_(this,Wt)||_(this,tr))&&(j(this,tr,!0),ln(()=>{j(this,tr,!1),_(this,Wt)&&ar(_(this,Wt),_(this,kn))}))}get_effect_pending(){return _(this,gs).call(this),a(_(this,Wt))}error(t){if(!_(this,it).onerror&&!_(this,it).failed)throw t;U?.is_fork?(_(this,ot)&&U.skip_effect(_(this,ot)),_(this,De)&&U.skip_effect(_(this,De)),_(this,Ze)&&U.skip_effect(_(this,Ze)),U.on_fork_commit(()=>{J(this,be,Xs).call(this,t)})):J(this,be,Xs).call(this,t)}}at=new WeakMap,la=new WeakMap,it=new WeakMap,wn=new WeakMap,$e=new WeakMap,ot=new WeakMap,De=new WeakMap,Ze=new WeakMap,Ht=new WeakMap,kn=new WeakMap,sn=new WeakMap,tr=new WeakMap,Dr=new WeakMap,qr=new WeakMap,Wt=new WeakMap,gs=new WeakMap,be=new WeakSet,al=function(){try{j(this,ot,lt(()=>_(this,wn).call(this,_(this,at))))}catch(t){this.error(t)}},il=function(t){const n=_(this,it).failed;n&&j(this,Ze,lt(()=>{n(_(this,at),()=>t,()=>()=>{})}))},ol=function(){const t=_(this,it).pending;t&&(this.is_pending=!0,j(this,De,lt(()=>t(_(this,at)))),ln(()=>{var n=j(this,Ht,document.createDocumentFragment()),r=Vt();n.append(r),j(this,ot,J(this,be,ts).call(this,()=>lt(()=>_(this,wn).call(this,r)))),_(this,sn)===0&&(_(this,at).before(n),j(this,Ht,null),An(_(this,De),()=>{j(this,De,null)}),J(this,be,es).call(this,U))}))},Js=function(){try{if(this.is_pending=this.has_pending_snippet(),j(this,sn,0),j(this,kn,0),j(this,ot,lt(()=>{_(this,wn).call(this,_(this,at))})),_(this,sn)>0){var t=j(this,Ht,document.createDocumentFragment());ya(_(this,ot),t);const n=_(this,it).pending;j(this,De,lt(()=>n(_(this,at))))}else J(this,be,es).call(this,U)}catch(n){this.error(n)}},es=function(t){this.is_pending=!1,t.transfer_effects(_(this,Dr),_(this,qr))},ts=function(t){var n=$,r=K,s=Ye;Lt(_(this,$e)),_t(_(this,$e)),sr(_(this,$e).ctx);try{return Mn.ensure(),t()}catch(i){return ui(i),null}finally{Lt(n),_t(r),sr(s)}},Qs=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&J(r=this.parent,be,Qs).call(r,t,n);return}j(this,sn,_(this,sn)+t),_(this,sn)===0&&(J(this,be,es).call(this,n),_(this,De)&&An(_(this,De),()=>{j(this,De,null)}),_(this,Ht)&&(_(this,at).before(_(this,Ht)),j(this,Ht,null)))},Xs=function(t){_(this,ot)&&(Ge(_(this,ot)),j(this,ot,null)),_(this,De)&&(Ge(_(this,De)),j(this,De,null)),_(this,Ze)&&(Ge(_(this,Ze)),j(this,Ze,null));var n=_(this,it).onerror;let r=_(this,it).failed;var s=!1,i=!1;const o=()=>{if(s){zo();return}s=!0,i&&Po(),_(this,Ze)!==null&&An(_(this,Ze),()=>{j(this,Ze,null)}),J(this,be,ts).call(this,()=>{J(this,be,Js).call(this)})},l=c=>{try{i=!0,n?.(c,o),i=!1}catch(u){an(u,_(this,$e)&&_(this,$e).parent)}r&&j(this,Ze,J(this,be,ts).call(this,()=>{try{return lt(()=>{var u=$;u.b=this,u.f|=Hs,r(_(this,at),()=>c,()=>o)})}catch(u){return an(u,_(this,$e).parent),null}}))};ln(()=>{var c;try{c=this.transform_error(t)}catch(u){an(u,_(this,$e)&&_(this,$e).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(l,u=>an(u,_(this,$e)&&_(this,$e).parent)):l(c)})};function ll(e,t,n,r){const s=Lr;var i=e.filter(v=>!v.settled);if(n.length===0&&i.length===0){r(t.map(s));return}var o=$,l=cl(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(v=>v.promise)):null;function u(v){if((o.f&ft)===0){l();try{r(v)}catch(h){an(h,o)}fs()}}var d=gi();if(n.length===0){c.then(()=>u(t.map(s))).finally(d);return}function f(){Promise.all(n.map(v=>ul(v))).then(v=>u([...t.map(s),...v])).catch(v=>an(v,o)).finally(d)}c?c.then(()=>{l(),f(),fs()}):f()}function cl(){var e=$,t=K,n=Ye,r=U;return function(i=!0){Lt(e),_t(t),sr(n),i&&(e.f&ft)===0&&(r?.activate(),r?.apply())}}function fs(e=!0){Lt(null),_t(null),sr(null),e&&U?.deactivate()}function gi(){var e=$,t=e.b,n=U,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 Lr(e){var t=Ne|Re;return $!==null&&($.f|=ur),{ctx:Ye,deps:null,effects:null,equals:ii,f:t,fn:e,reactions:null,rv:0,v:Ie,wv:0,parent:$,ac:null}}const $r=Symbol("obsolete");function ul(e,t,n){let r=$;r===null&&So();var s=void 0,i=Ln(Ie),o=!K,l=new Set;return Sl(()=>{var c=$,u=ni();s=u.promise;try{Promise.resolve(e()).then(u.resolve,h=>{h!==ks&&u.reject(h)}).finally(fs)}catch(h){u.reject(h),fs()}var d=U;if(o){if((c.f&Pn)!==0)var f=gi();if(r.b.is_rendered())d.async_deriveds.get(c)?.reject($r);else for(const h of l.values())h.reject($r);l.add(u),d.async_deriveds.set(c,u)}const v=(h,b=void 0)=>{f?.(),l.delete(u),b!==$r&&(d.activate(),b?(i.f|=on,ar(i,b)):((i.f&on)!==0&&(i.f^=on),ar(i,h)),d.deactivate())};u.promise.then(v,h=>v(null,h||"unknown"))}),pa(()=>{for(const c of l)c.reject($r)}),new Promise(c=>{function u(d){function f(){d===s?c(i):u(s)}d.then(f,f)}u(s)})}function D(e){const t=Lr(e);return Ri(t),t}function bi(e){const t=Lr(e);return t.equals=oi,t}function fl(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!ki&&vl()}return t}function vl(){ki=!1;for(const e of ds){(e.f&Me)!==0&&ge(e,Mt);let t;try{t=Ur(e)}catch{t=!0}t&&ir(e)}ds.clear()}function xr(e){ne(e,e.v+1)}function Si(e,t,n){var r=e.reactions;if(r!==null)for(var s=r.length,i=0;i{if(Tn===i)return l();var c=K,u=Tn;_t(null),Oa(i);var d=l();return _t(c),Oa(u),d};return r&&n.set("length",Ee(e.length)),new Proxy(e,{defineProperty(l,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Io();var d=n.get(c);return d===void 0?o(()=>{var f=Ee(u.value);return n.set(c,f),f}):ne(d,u.value,!0),!0},deleteProperty(l,c){var u=n.get(c);if(u===void 0){if(c in l){const d=o(()=>Ee(Ie));n.set(c,d),xr(s)}}else ne(u,Ie),xr(s);return!0},get(l,c,u){if(c===Cn)return e;var d=n.get(c),f=c in l;if(d===void 0&&(!f||zn(l,c)?.writable)&&(d=o(()=>{var h=Ut(f?l[c]:Ie),b=Ee(h);return b}),n.set(c,d)),d!==void 0){var v=a(d);return v===Ie?void 0:v}return Reflect.get(l,c,u)},getOwnPropertyDescriptor(l,c){var u=Reflect.getOwnPropertyDescriptor(l,c);if(u&&"value"in u){var d=n.get(c);d&&(u.value=a(d))}else if(u===void 0){var f=n.get(c),v=f?.v;if(f!==void 0&&v!==Ie)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(l,c){if(c===Cn)return!0;var u=n.get(c),d=u!==void 0&&u.v!==Ie||Reflect.has(l,c);if(u!==void 0||$!==null&&(!d||zn(l,c)?.writable)){u===void 0&&(u=o(()=>{var v=d?Ut(l[c]):Ie,h=Ee(v);return h}),n.set(c,u));var f=a(u);if(f===Ie)return!1}return d},set(l,c,u,d){var f=n.get(c),v=c in l;if(r&&c==="length")for(var h=u;hEe(Ie)),n.set(h+"",b))}if(f===void 0)(!v||zn(l,c)?.writable)&&(f=o(()=>Ee(void 0)),ne(f,Ut(u)),n.set(c,f));else{v=f.v!==Ie;var O=o(()=>Ut(u));ne(f,O)}var m=Reflect.getOwnPropertyDescriptor(l,c);if(m?.set&&m.set.call(d,u),!v){if(r&&typeof c=="string"){var A=n.get("length"),x=Number(c);Number.isInteger(x)&&x>=A.v&&ne(A,x+1)}xr(s)}return!0},ownKeys(l){a(s);var c=Reflect.ownKeys(l).filter(f=>{var v=n.get(f);return v===void 0||v.v!==Ie});for(var[u,d]of n)d.v!==Ie&&!(u in l)&&c.push(u);return c},setPrototypeOf(){Mo()}})}function xa(e){try{if(e!==null&&typeof e=="object"&&Cn in e)return e[Cn]}catch{}return e}function hl(e,t){return Object.is(xa(e),xa(t))}var _s,Ei,Ci,xi;function pl(){if(_s===void 0){_s=window,Ei=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ci=zn(t,"firstChild").get,xi=zn(t,"nextSibling").get,Sa(e)&&(e[Us]=void 0,e[Jr]=null,e[Ks]=void 0,e.__e=void 0),Sa(n)&&(n[br]=void 0)}}function Vt(e=""){return document.createTextNode(e)}function vs(e){return Ci.call(e)}function Wr(e){return xi.call(e)}function y(e,t){return vs(e)}function xe(e,t=!1){{var n=vs(e);return n instanceof Comment&&n.data===""?Wr(n):n}}function w(e,t=1,n=!1){let r=e;for(;t--;)r=Wr(r);return r}function ml(e){e.textContent=""}function Ai(){return!1}function gl(e,t,n){return document.createElementNS(ai,e,void 0)}let Aa=!1;function bl(){Aa||(Aa=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Qr]?.()})},{capture:!0}))}function Ss(e){var t=K,n=$;_t(null),Lt(null);try{return e()}finally{_t(t),Lt(n)}}function va(e,t,n,r=n){e.addEventListener(t,()=>Ss(n));const s=e[Qr];s?e[Qr]=()=>{s(),r(!0)}:e[Qr]=()=>r(!0),bl()}function yl(e){$===null&&(K===null&&Ao(),xo()),Yt&&Co()}function wl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Jt(e,t){var n=$;n!==null&&(n.f&qe)!==0&&(e|=qe);var r={ctx:Ye,deps:null,nodes:null,f:e|Re|ut,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};U?.register_created_effect(r);var s=r;if((e&nr)!==0)Kn!==null?Kn.push(r):Mn.ensure().schedule(r);else if(t!==null){try{ir(r)}catch(o){throw Ge(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&ur)===0&&(s=s.first,(e&bt)!==0&&(e&rr)!==0&&s!==null&&(s.f|=rr))}if(s!==null&&(s.parent=n,n!==null&&wl(s,n),K!==null&&(K.f&Ne)!==0&&(e&un)===0)){var i=K;(i.effects??(i.effects=[])).push(s)}return r}function ha(){return K!==null&&!wt}function pa(e){const t=Jt(ws,null);return ge(t,Me),t.teardown=e,t}function Es(e){yl();var t=$.f,n=!K&&(t&kt)!==0&&(t&Pn)===0;if(n){var r=Ye;(r.e??(r.e=[])).push(e)}else return Ti(e)}function Ti(e){return Jt(nr|bo,e)}function kl(e){Mn.ensure();const t=Jt(un|ur,e);return(n={})=>new Promise(r=>{n.outro?An(t,()=>{Ge(t),r(void 0)}):(Ge(t),r(void 0))})}function Oi(e){return Jt(nr,e)}function Sl(e){return Jt(Vn|ur,e)}function Cs(e,t=0){return Jt(ws|t,e)}function P(e,t=[],n=[],r=[]){ll(r,t,n,s=>{Jt(ws,()=>e(...s.map(a)))})}function ma(e,t=0){var n=Jt(bt|t,e);return n}function lt(e){return Jt(kt|ur,e)}function Ii(e){var t=e.teardown;if(t!==null){const n=Yt,r=K;Ta(!0),_t(null);try{t.call(null)}finally{Ta(n),_t(r)}}}function ga(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Ss(()=>{s.abort(ks)});var r=n.next;(n.f&un)!==0?n.parent=null:Ge(n,t),n=r}}function El(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&kt)===0&&Ge(t),t=n}}function Ge(e,t=!0){var n=!1;(t||(e.f&go)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Cl(e.nodes.start,e.nodes.end),n=!0),ge(e,Ws),ga(e,t&&!n),Pr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Ii(e),e.f^=Ws,e.f|=ft;var s=e.parent;s!==null&&s.first!==null&&Mi(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Cl(e,t){for(;e!==null;){var n=e===t?null:Wr(e);e.remove(),e=n}}function Mi(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 An(e,t,n=!0){var r=[];Li(e,r,!0);var s=()=>{n&&Ge(e),t&&t()},i=r.length;if(i>0){var o=()=>--i||s();for(var l of r)l.out(o)}else s()}function Li(e,t,n){if((e.f&qe)===0){e.f^=qe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var i=s.next;if((s.f&un)===0){var o=(s.f&rr)!==0||(s.f&kt)!==0&&(e.f&bt)!==0;Li(s,t,o?n:!1)}s=i}}}function ba(e){Pi(e,!0)}function Pi(e,t){if((e.f&qe)!==0){e.f^=qe,(e.f&Me)===0&&(ge(e,Re),Mn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&rr)!==0||(n.f&kt)!==0;Pi(n,s?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const o of i)(o.is_global||t)&&o.in()}}function ya(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Wr(n);t.append(n),n=s}}let ns=!1,Yt=!1;function Ta(e){Yt=e}let K=null,wt=!1;function _t(e){K=e}let $=null;function Lt(e){$=e}let dt=null;function Ri(e){K!==null&&(dt===null?dt=[e]:dt.push(e))}let ze=null,Qe=0,st=null;function xl(e){st=e}let Ni=1,pn=0,Tn=pn;function Oa(e){Tn=e}function Bi(){return++Ni}function Ur(e){var t=e.f;if((t&Re)!==0)return!0;if(t&Ne&&(e.f&=~In),(t&Mt)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&ut)!==0&&yt===null&&ge(e,Me)}return!1}function Fi(e,t,n=!0){var r=e.reactions;if(r!==null&&!(dt!==null&&En.call(dt,e)))for(var s=0;s{e.ac.abort(ks)}),e.ac=null);try{e.f|=us;var d=e.fn,f=d();e.f|=Pn;var v=e.deps,h=U?.is_fork;if(ze!==null){var b;if(h||Pr(e,Qe),v!==null&&Qe>0)for(v.length=Qe+ze.length,b=0;bn?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ln(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function Wi(e,t,n,r,s){var i={capture:r,passive:s},o=Ml(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&pa(()=>{t.removeEventListener(e,o,i)})}function te(e,t,n){(t[mn]??(t[mn]={}))[e]=n}function Bn(e){for(var t=0;t{throw m});throw v}}finally{e[mn]=t,delete e.currentTarget,_t(d),Lt(f)}}}const Ll=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Pl(e){return Ll?.createHTML(e)??e}function Rl(e){var t=gl("template");return t.innerHTML=Pl(e.replaceAll("","")),t.content}function hs(e,t){var n=$;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function S(e,t){var n=(t&Wo)!==0,r=(t&Uo)!==0,s,i=!e.startsWith("");return()=>{s===void 0&&(s=Rl(i?e:""+e),n||(s=vs(s)));var o=r||Ei?document.importNode(s,!0):s.cloneNode(!0);if(n){var l=vs(o),c=o.lastChild;hs(l,c)}else hs(o,o);return o}}function Nl(e=""){{var t=Vt(e+"");return hs(t,t),t}}function Ui(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Vt();return e.append(t,n),hs(t,n),e}function k(e,t){e!==null&&e.before(t)}function F(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[br]??(e[br]=e.nodeValue))&&(e[br]=n,e.nodeValue=`${n}`)}function xs(e,t){return Bl(e,t)}const zr=new Map;function Bl(e,{target:t,anchor:n,props:r={},events:s,context:i,intro:o=!0,transformError:l}){pl();var c=void 0,u=kl(()=>{var d=n??t.appendChild(Vt());rl(d,{pending:()=>{}},h=>{Rn({});var b=Ye;i&&(b.c=i),s&&(r.$$events=s),c=e(h,r)||{},Nn()},l);var f=new Set,v=h=>{for(var b=0;b{for(var h of f)for(const m of[t,document]){var b=zr.get(m),O=b.get(h);--O==0?(m.removeEventListener(h,ea),b.delete(h),b.size===0&&zr.delete(m)):b.set(h,O)}Zs.delete(v),d!==n&&d.parentNode?.removeChild(d)}});return ta.set(c,u),c}let ta=new WeakMap;function dr(e,t){const n=ta.get(e);return n?(ta.delete(e),n(t)):Promise.resolve()}var gt,Ot,et,Sn,jr,Hr,bs;class Fl{constructor(t,n=!0){Ue(this,"anchor");H(this,gt,new Map);H(this,Ot,new Map);H(this,et,new Map);H(this,Sn,new Set);H(this,jr,!0);H(this,Hr,t=>{if(_(this,gt).has(t)){var n=_(this,gt).get(t),r=_(this,Ot).get(n);if(r)ba(r),_(this,Sn).delete(n);else{var s=_(this,et).get(n);s&&(_(this,Ot).set(n,s.effect),_(this,et).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[i,o]of _(this,gt)){if(_(this,gt).delete(i),i===t)break;const l=_(this,et).get(o);l&&(Ge(l.effect),_(this,et).delete(o))}for(const[i,o]of _(this,Ot)){if(i===n||_(this,Sn).has(i))continue;const l=()=>{if(Array.from(_(this,gt).values()).includes(i)){var u=document.createDocumentFragment();ya(o,u),u.append(Vt()),_(this,et).set(i,{effect:o,fragment:u})}else Ge(o);_(this,Sn).delete(i),_(this,Ot).delete(i)};_(this,jr)||!r?(_(this,Sn).add(i),An(o,l,!1)):l()}}});H(this,bs,t=>{_(this,gt).delete(t);const n=Array.from(_(this,gt).values());for(const[r,s]of _(this,et))n.includes(r)||(Ge(s.effect),_(this,et).delete(r))});this.anchor=t,j(this,jr,n)}ensure(t,n){var r=U,s=Ai();if(n&&!_(this,Ot).has(t)&&!_(this,et).has(t))if(s){var i=document.createDocumentFragment(),o=Vt();i.append(o),_(this,et).set(t,{effect:lt(()=>n(o)),fragment:i})}else _(this,Ot).set(t,lt(()=>n(this.anchor)));if(_(this,gt).set(r,t),s){for(const[l,c]of _(this,Ot))l===t?r.unskip_effect(c):r.skip_effect(c);for(const[l,c]of _(this,et))l===t?r.unskip_effect(c.effect):r.skip_effect(c.effect);r.oncommit(_(this,Hr)),r.ondiscard(_(this,bs))}else _(this,Hr).call(this,r)}}gt=new WeakMap,Ot=new WeakMap,et=new WeakMap,Sn=new WeakMap,jr=new WeakMap,Hr=new WeakMap,bs=new WeakMap;function q(e,t,n=!1){var r=new Fl(e),s=n?rr:0;function i(o,l){r.ensure(o,l)}ma(()=>{var o=!1;t((l,c=0)=>{o=!0,i(c,l)}),o||i(-1,null)},s)}function Vr(e,t){return t}function Dl(e,t,n){for(var r=[],s=t.length,i,o=t.length,l=0;l{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var v=e.outrogroups;na(e,ys(i.done)),v.delete(i),v.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var u=n,d=u.parentNode;ml(d),d.append(u),e.items.clear()}na(e,t,!c)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function na(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const l of o)r.add(e.items.get(l).e)}for(var s=0;s{var R=n();return ca(R)?R:R==null?[]:ys(R)}),v,h=new Map,b=!0;function O(R){(x.effect.f&ft)===0&&(x.pending.delete(R),x.fallback=d,ql(x,v,o,t,r),d!==null&&(v.length===0?(d.f&It)===0?ba(d):(d.f^=It,wr(d,null,o)):An(d,()=>{d=null})))}function m(R){x.pending.delete(R)}var A=ma(()=>{v=a(f);for(var R=v.length,W=new Set,re=U,he=Ai(),ue=0;uei(o)):(d=lt(()=>i(Ma??(Ma=Vt()))),d.f|=It)),R>W.size&&Eo(),!b)if(h.set(re,W),he){for(const[He,St]of l)W.has(He)||re.skip_effect(St.e);re.oncommit(O),re.ondiscard(m)}else O(re);a(f)}),x={effect:A,items:l,pending:h,outrogroups:null,fallback:d};b=!1}function gr(e){for(;e!==null&&(e.f&kt)===0;)e=e.next;return e}function ql(e,t,n,r,s){var i=(r&Bo)!==0,o=t.length,l=e.items,c=gr(e.effect.first),u,d=null,f,v=[],h=[],b,O,m,A;if(i)for(A=0;A0){var je=(r&si)!==0&&o===0?n:null;if(i){for(A=0;A{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function jl(e,t,n,r,s,i,o,l){var c=(o&Ro)!==0?(o&Fo)===0?_l(n,!1,!1):Ln(n):null,u=(o&No)!==0?Ln(s):null;return{v:c,i:u,e:lt(()=>(i(t,c??n,u??s,l),()=>{e.delete(r)}))}}function wr(e,t,n){if(e.nodes)for(var r=e.nodes.start,s=e.nodes.end,i=t&&(t.f&It)===0?t.nodes.start:n;r!==null;){var o=Wr(r);if(i.before(r),r===s)return;r=o}}function tn(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const La=[...`
-\r\f \v\uFEFF`];function Hl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var i=s.length,o=0;(o=r.indexOf(s,o))>=0;){var l=o+i;(o===0||La.includes(r[o-1]))&&(l===r.length||La.includes(r[l]))?r=(o===0?"":r.substring(0,o))+r.substring(l+1):o=l}}return r===""?null:r}function Wl(e,t){return e==null?null:String(e)}function Ve(e,t,n,r,s,i){var o=e[Us];if(o!==n||o===void 0){var l=Hl(n,r,i);l==null?e.removeAttribute("class"):e.className=l,e[Us]=n}else if(i&&s!==i)for(var c in i){var u=!!i[c];(s==null||u!==!!s[c])&&e.classList.toggle(c,u)}return i}function Ke(e,t,n,r){var s=e[Ks];if(s!==t){var i=Wl(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e[Ks]=t}return r}function Ki(e,t,n=!1){if(e.multiple){if(t==null)return;if(!ca(t))return $o();for(var r of e.options)r.selected=t.includes(Ar(r));return}for(r of e.options){var s=Ar(r);if(hl(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Ul(e){var t=new MutationObserver(()=>{Ki(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),pa(()=>{t.disconnect()})}function ra(e,t,n=t){var r=new WeakSet,s=!0;va(e,"change",i=>{var o=i?"[selected]":":checked",l;if(e.multiple)l=[].map.call(e.querySelectorAll(o),Ar);else{var c=e.querySelector(o)??e.querySelector("option:not([disabled])");l=c&&Ar(c)}n(l),e.__value=l,U!==null&&r.add(U)}),Oi(()=>{var i=t();if(e===document.activeElement){var o=U;if(r.has(o))return}if(Ki(e,i,s),s&&i===void 0){var l=e.querySelector(":checked");l!==null&&(i=Ar(l),n(i))}e.__value=i,s=!1}),Ul(e)}function Ar(e){return"__value"in e?e.__value:e.value}const Kl=Symbol("is custom element"),$l=Symbol("is html");function ae(e,t,n,r){var s=zl(e);s[t]!==(s[t]=n)&&(t==="loading"&&(e[wo]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Vl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function zl(e){return e[Jr]??(e[Jr]={[Kl]:e.nodeName.includes("-"),[$l]:e.namespaceURI===ai})}var Pa=new Map;function Vl(e){var t=e.getAttribute("is")||e.nodeName,n=Pa.get(t);if(n)return n;Pa.set(t,n=[]);for(var r,s=e,i=Element.prototype;i!==s;){r=_o(s);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);s=ti(s)}return n}function sa(e,t,n=t){var r=new WeakSet;va(e,"input",async s=>{var i=s?e.defaultValue:e.value;if(i=Ns(e)?Bs(i):i,n(i),U!==null&&r.add(U),await Tl(),i!==(i=t())){var o=e.selectionStart,l=e.selectionEnd,c=e.value.length;if(e.value=i??"",l!==null){var u=e.value.length;o===l&&l===c&&u>c?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=o,e.selectionEnd=Math.min(l,u))}}}),fr(t)==null&&e.value&&(n(Ns(e)?Bs(e.value):e.value),U!==null&&r.add(U)),Cs(()=>{var s=t();if(e===document.activeElement){var i=U;if(r.has(i))return}Ns(e)&&s===Bs(e.value)||e.type==="date"&&!s&&!e.value||s!==e.value&&(e.value=s??"")})}function $i(e,t,n=t){va(e,"change",r=>{var s=r?e.defaultChecked:e.checked;n(s)}),fr(t)==null&&n(e.checked),Cs(()=>{var r=t();e.checked=!!r})}function Ns(e){var t=e.type;return t==="number"||t==="range"}function Bs(e){return e===""?null:+e}function Fs(e,t){return e===t||e?.[Cn]===t}function Gl(e={},t,n,r){var s=Ye.r,i=$;return Oi(()=>{var o,l;return Cs(()=>{o=l,l=[],fr(()=>{Fs(n(...l),e)||(t(e,...l),o&&Fs(n(...o),e)&&t(null,...o))})}),()=>{let c=i;for(;c!==s&&c.parent!==null&&c.parent.f&Ws;)c=c.parent;const u=()=>{l&&Fs(n(...l),e)&&t(null,...l)},d=c.teardown;c.teardown=()=>{u(),d?.()}}}),e}function Kt(e,t,n,r){var s=!0,i=(n&jo)!==0,o=(n&Ho)!==0,l=r,c=!0,u=void 0,d=()=>o&&s?(u??(u=Lr(r)),a(u)):(c&&(c=!1,l=o?fr(r):r),l);let f;if(i){var v=Cn in e||yo in e;f=zn(e,t)?.set??(v&&t in e?W=>e[t]=W:void 0)}var h,b=!1;i?[h,b]=Jo(()=>e[t]):h=e[t],h===void 0&&r!==void 0&&(h=d(),f&&(Oo(),f(h)));var O;if(O=()=>{var W=e[t];return W===void 0?d():(c=!0,W)},(n&qo)===0)return O;if(f){var m=e.$$legacy;return(function(W,re){return arguments.length>0?((!re||m||b)&&f(re?O():W),W):O()})}var A=!1,x=((n&Do)!==0?Lr:bi)(()=>(A=!1,O()));i&&a(x);var R=$;return(function(W,re){if(arguments.length>0){const he=re?a(x):i?Ut(W):W;return ne(x,he),A=!0,l!==void 0&&(l=he),W}return Yt&&A||(R.f&ft)!==0?x.v:a(x)})}function zi(e){Ye===null&&ko(),Es(()=>{const t=fr(e);if(typeof t=="function")return t})}const Vi="[data-v-app]",Yl=["header","content","footer"];let ct=null,Dt=null;function Jl(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Ql(){if(typeof document>"u")return!1;const t=document.querySelector(Vi)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(ct=null,!1):(ct=t,Dt=null,!0)}function Xl(){if(Dt!==null)return Dt;const e=typeof document<"u"?document.querySelector(Vi)?.__vue_app__:null;if(!e)return Dt=!1,!1;const t=e.config?.globalProperties??{};if(typeof ct?.$history?.pause=="function"&&typeof ct?.$history?.resume=="function")return Dt={pause:()=>ct.$history.pause(),resume:()=>ct.$history.resume()},Dt;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(Dt={pause:()=>n.history.pause(),resume:()=>n.history.resume()},Dt):(Dt=!1,!1)}function Zl(e){const t=Xl();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function cn(e){if(!ct||!e)return null;for(const t of Yl){const n=ct[t];if(!Array.isArray(n))continue;const r=n.find(s=>s&&s.id===e);if(r)return r}return null}function ec(e){const t=cn(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Gi(t,1,n),n}function Gi(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const s=cn(r);s&&(n.push({id:s.id,depth:t,label:s.label,name:s.name,settings:s.settings}),Gi(s,t+1,n))}}function Yi(){return ct?ct.globalClasses:[]}function Ds(e,t){if(!ct)throw new Error("rebemer: not ready");const n=ct.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const s=new Set(n.map(o=>o?.id).filter(Boolean)),i=Jl(s);return n.push({id:i,name:e,settings:t||{}}),i}function Ra(e,t){const n=cn(e);if(!n)return;n.settings||(n.settings={});const 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 Na(e,t){const n=cn(e);n&&(n.label=t)}const Ba="slashed-rebemer-host",tc="slashed-class-hint",Ji=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],or="rebemer-class-hint-btn",nc=50;function aa(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;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let lr={},$t=null,Tr=null,Or=null,Gn=null,cr=null;function rc(){if($t&&$t.isConnected)return $t;let e=document.getElementById(Ba);e||(e=document.createElement("div"),e.id=Ba,document.body.appendChild(e));const t=document.createElement("div");return t.id=tc,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='',e.appendChild(t),$t=t,t}function sc(e,t){const n=t.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight,i=8,o=document.documentElement.clientWidth,l=document.documentElement.clientHeight;let c=n.bottom+i;c+s>l&&n.top-i-s>=0&&(c=n.top-i-s);let u=n.left+n.width/2-r/2;u+r>o-4&&(u=Math.max(4,o-4-r)),u<4&&(u=4),e.style.top=`${Math.round(c)}px`,e.style.left=`${Math.round(u)}px`}function ac(e){const t=e.dataset.sfClass,n=t?aa(t,lr):null;if(!n)return;const r=rc();r.querySelector(".rebemer-class-hint__name").textContent=`.${n.name}`;const s=r.querySelector(".rebemer-class-hint__cat");s.textContent=n.category||"",s.hidden=!n.category,r.querySelector(".rebemer-class-hint__desc").textContent=n.description,r.hidden=!1,sc(r,e),cr=e}function Rr(){$t&&($t.hidden=!0),cr=null}function Fa(e){ac(e.currentTarget)}function Da(){Rr()}function ic(e){e.preventDefault(),e.stopPropagation()}function oc(e){e.key==="Escape"&&Rr()}function qa(e){const t=aa(e.textContent,lr);if(t)return t;const n=e.querySelectorAll("span, [contenteditable], .name, .label, a");for(const r of n){const s=aa(r.textContent,lr);if(s)return s}return null}function lc(e){return e.querySelector('.actions, [class*="action"], [class*="icons"], [class*="controls"]')||e}function cc(){const e=document.createElement("span");return e.className=or,e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","What does this class do?"),e.addEventListener("mouseenter",Fa),e.addEventListener("mouseleave",Da),e.addEventListener("focus",Fa),e.addEventListener("blur",Da),e.addEventListener("click",ic),e}function Qi(){for(const t of document.querySelectorAll("."+or)){const n=t.closest("li"),r=n?qa(n):null;r?t.dataset.sfClass!==r.name&&(t.dataset.sfClass=r.name):(cr===t&&Rr(),t.remove())}const e=document.querySelectorAll(Ji.join(","));for(const t of e)for(const n of t.querySelectorAll("li")){if(n.querySelector("."+or)||n.querySelector("li"))continue;const r=qa(n);if(!r)continue;const s=cc();s.dataset.sfClass=r.name,lc(n).appendChild(s)}}function uc(){Gn===null&&(Gn=setTimeout(()=>{Gn=null,Qi()},nc))}function fc(e){const t=Ji.join(",");for(const n of e){const r=n.target;if(r&&r.nodeType===1){if(r.classList&&r.classList.contains(or))continue;if(r.closest&&r.closest(t))return!0}for(const s of n.addedNodes)if(s.nodeType===1&&!(s.classList&&s.classList.contains(or))&&(s.matches&&s.matches(t)||s.closest&&s.closest(t)||s.querySelector&&s.querySelector(t)))return!0}return!1}function dc(e,t,n={}){if(rs(),lr=t&&typeof t=="object"?t:{},!e||Object.keys(lr).length===0)return;Tr=new AbortController;const{signal:r}=Tr;document.addEventListener("keydown",oc,{passive:!0,signal:r}),window.addEventListener("scroll",Rr,{capture:!0,passive:!0,signal:r}),Or=new MutationObserver(s=>{cr&&!cr.isConnected&&Rr(),fc(s)&&uc()}),Or.observe(document.body,{childList:!0,subtree:!0}),Qi(),n.signal&&(n.signal.aborted?rs():n.signal.addEventListener("abort",rs,{once:!0}))}function rs(){Gn!==null&&(clearTimeout(Gn),Gn=null),Or&&(Or.disconnect(),Or=null),Tr&&(Tr.abort(),Tr=null);try{document.querySelectorAll("."+or).forEach(e=>e.remove())}catch{}$t&&($t.remove(),$t=null),cr=null,lr={}}const ss="li.variable-picker-item",as="slashed-var-swatch",kr="slashed-sf-color-btn",_c=50,ja=(e,...t)=>console[e]("[slashed-swatches]",...t);function vc(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;const r=t[n];return typeof r=="string"&&r?r:null}let ia=!1,Nr={},Gt=null,Ir=null,Yn=null,is=null;function hc(e){if(!Gt)return;const t=e.querySelector('[data-control="text"].color-input');if(!t||t.querySelector("."+kr))return;const n=document.createElement("div");n.className=kr,n.setAttribute("data-balloon","SLASHED Colors"),n.setAttribute("data-balloon-pos","top-right"),n.setAttribute("role","button"),n.setAttribute("tabindex","0");const r=document.createElement("span");r.className=kr+"__dot",r.setAttribute("aria-hidden","true"),n.appendChild(r),n.addEventListener("click",u=>{u.stopPropagation(),Gt&&Gt(t)}),n.addEventListener("keydown",u=>{u.key===" "?(u.preventDefault(),n.click()):u.key==="Enter"&&n.click()});const s=t.querySelector(".variable-picker-button");s&&s.nextSibling?t.insertBefore(n,s.nextSibling):t.appendChild(n);const l=((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],c=l?Nr[l]??null:null;c&&(r.style.background=c,r.style.removeProperty("box-shadow"),n.classList.add(kr+"--active"))}function pc(e){const t=e.querySelector(":scope > span[title]")||e.querySelector(":scope > span");if(t){const n=t.getAttribute("title");return n&&n.trim()?n.trim():(t.textContent||"").trim()}return(e.textContent||"").trim()}function mc(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+as);r&&r.remove();return}const t=vc(pc(e),Nr);let n=e.querySelector(":scope > ."+as);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=as,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 Xi(){try{const e=document.querySelectorAll(ss);for(const t of e)mc(t)}catch(e){ja("warn","swatch pass failed",e)}if(Gt)try{document.querySelectorAll('[data-control="color"]').forEach(hc)}catch(e){ja("warn","SF button inject failed",e)}}function gc(){Yn===null&&(Yn=setTimeout(()=>{Yn=null,Xi()},_c))}function bc(e){for(const t of e){const n=t.target;if(n&&n.nodeType===1&&n.closest&&(n.closest(ss)||Gt&&n.closest('[data-control="color"]')))return!0;for(const r of t.addedNodes)if(r.nodeType===1&&(r.matches&&r.matches(ss)||r.querySelector&&r.querySelector(ss)||Gt&&(r.matches&&r.matches('[data-control="color"]')||r.querySelector&&r.querySelector('[data-control="color"]'))))return!0}return!1}function yc(e,t,n={}){os(),ia=!!e,Nr=t&&typeof t=="object"?t:{},Gt=typeof n.onOpenPanel=="function"?n.onOpenPanel:null,!(!(ia&&Object.keys(Nr).length>0)&&!Gt)&&(is=new AbortController,Ir=new MutationObserver(s=>{bc(s)&&gc()}),Ir.observe(document.body,{childList:!0,subtree:!0}),Xi(),n.signal&&(n.signal.aborted?os():n.signal.addEventListener("abort",os,{once:!0})))}function os(){Yn!==null&&(clearTimeout(Yn),Yn=null),Ir&&(Ir.disconnect(),Ir=null),is&&(is.abort(),is=null);try{document.querySelectorAll("."+as).forEach(e=>e.remove()),document.querySelectorAll("."+kr).forEach(e=>e.remove())}catch{}ia=!1,Nr={},Gt=null}const wc="5";var ei;typeof window<"u"&&((ei=window.__svelte??(window.__svelte={})).v??(ei.v=new Set)).add(wc);var kc=S('reBEM');function Sc(e,t){Rn(t,!0);function n(s){s.stopPropagation(),s.preventDefault(),t.onActivate?.(t.elementId)}var r=kc();P(()=>{ae(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),ae(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),te("click",r,n),te("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&n(s)),k(e,r),Nn()}Bn(["click","keydown"]);function zt(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,""):""}const Ec=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,Cc=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function Ha(e){return e?Cc.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:Ec.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const As=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"]);function xc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))As.has(n)&&t.push(n);return t.sort(),t}const Ac=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function Tc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))As.has(n)||Ac.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const Oc=new Set(["add","rename","replace","migrate","mixed"]),Wa=new Set(["user","label"]);function Zi(e,t){const n=new Map,r=[];for(const s of e){for(;r.length&&r[r.length-1].depth>=s.depth;)r.pop();const i=s.id===t,o=!i&&s.isBlockRoot===!0;if(i||o){const l=zt(s.name);l&&s.include!==!1&&(r.push({depth:s.depth,blockName:l}),n.set(s.id,l))}else{const l=r.length?r[r.length-1].blockName:"";l&&n.set(s.id,l)}}return n}function eo({rootId:e,rows:t,mode:n}){if(!Oc.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(u=>u.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};if(!zt(r.name))return{ok:!1,ops:[],error:"Block name is empty."};const i=[];for(const u of t)!u.isBlockRoot||!u.include||u.id===e||zt(u.name)||i.push(u.originalLabel||u.id);if(i.length>0)return{ok:!1,ops:[],error:`Block name is empty for: ${i.join(", ")}.`};const o=Zi(t,e),l=[];for(const u of t){if(!u.include)continue;const d=u.id===e,f=!d&&u.isBlockRoot===!0,v=o.get(u.id);if(!v)continue;let h;if(d||f)h=v;else{const b=zt(u.name);if(!b)continue;h=`${v}__${b}`}l.push({row:u,isRoot:d||f,blockName:v,finalClass:h,modifierSlugs:[],suggestedFrom:u.suggestedFrom||"fallback"})}if(l.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const c=Lc(l);if(!c.ok)return{ok:!1,ops:[],error:c.error};if(n!=="migrate")for(const u of l){const d=Array.isArray(u.row.modifiers)?u.row.modifiers:[];u.modifierSlugs=d.map(f=>zt(f)).filter(Boolean)}return{ok:!0,ops:l}}function Ic({rootId:e,rows:t,mode:n,syncLabels:r}){const s=eo({rootId:e,rows:t,mode:n});if(!s.ok)return{ok:!1,error:s.error};const i=s.ops,o=Yi();if(n==="migrate"){const u=Mc(i,o);if(!u.ok)return u}const l=new Map;for(const u of i){if(l.has(u.row.id))continue;const d=cn(u.row.id);if(!d)continue;const f={classIds:Ua(d.settings).slice(),label:r?d.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const h of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(d.settings||{},h)&&(v[h]=JSON.parse(JSON.stringify(d.settings[h])));f.migrateKeys=v}l.set(u.row.id,f)}let c=0;try{Zl(()=>{for(const u of i){const d=cn(u.row.id);if(!d)continue;const f=Ua(d.settings),v=u.row.op??"add",h=n==="mixed"?["add","rename","replace"].includes(v)?v:"add":n;let b={};if(h==="rename"&&f.length>0){const A=n==="mixed"&&u.row.renameFamilyId||f[0],x=o.find(R=>R&&R.id===A);x&&x.settings&&(b=JSON.parse(JSON.stringify(x.settings)))}else h==="migrate"&&(b=to(d.settings,u.row.migrateKeys));if(h==="migrate"){const A=o.find(x=>x&&x.name===u.finalClass);if(A){(!A.settings||typeof A.settings!="object")&&(A.settings={});for(const[x,R]of Object.entries(b))Object.prototype.hasOwnProperty.call(A.settings,x)||(A.settings[x]=R)}}const O=Ds(u.finalClass,b);let m;switch(h){case"add":case"migrate":m=f.includes(O)?f:[...f,O];break;case"rename":{const A=n==="mixed"&&u.row.renameFamilyId||(f[0]??null),x=[O],R=A?o.find(W=>W&&W.id===A):null;if(R){const W=R.name+"--";for(const re of f){if(re===A)continue;const he=o.find(ue=>ue&&ue.id===re);if(he)if(he.name.startsWith(W)){const ue=he.name.slice(R.name.length),le=he.settings?JSON.parse(JSON.stringify(he.settings)):{};x.push(Ds(u.finalClass+ue,le))}else x.push(re)}}m=x;break}case"replace":if(n==="mixed"&&u.row.renameFamilyId){const A=o.find(x=>x&&x.id===u.row.renameFamilyId);if(A){const x=A.name+"--",R=f.filter(W=>{if(W===u.row.renameFamilyId)return!1;const re=o.find(he=>he&&he.id===W);return!re||!re.name.startsWith(x)});m=[O,...R]}else m=[O]}else m=[O];break}for(const A of u.modifierSlugs){const x=`${u.finalClass}--${A}`,R=Ds(x,{});m.includes(R)||m.push(R)}if(Ra(u.row.id,m),h==="migrate"&&Pc(d.settings,u.row.migrateKeys),r){const A=Rc(u.finalClass,u.blockName);A&&Na(u.row.id,A)}c++}})}catch(u){for(const[f,v]of l)try{if(Ra(f,v.classIds),v.migrateKeys){const h=cn(f);h&&h.settings&&Object.assign(h.settings,v.migrateKeys)}v.label!==null&&Na(f,v.label)}catch{}const d=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",c,"mutation(s), rolled back:",d),{ok:!1,error:`Operation failed and was rolled back: ${d}`}}return c===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:c}}function Mc(e,t){for(const n of e){const r=t.find(c=>c&&c.name===n.finalClass);if(!r)continue;const s=cn(n.row.id);if(!s)continue;const i=to(s.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},l=[];for(const[c,u]of Object.entries(i))Object.prototype.hasOwnProperty.call(o,c)&&JSON.stringify(o[c])!==JSON.stringify(u)&&l.push(c.replace(/^_/,""));if(l.length>0){const c=l.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${c}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Lc(e){const t=new Map;for(const r of e){const s=t.get(r.finalClass)||[];s.push(r),t.set(r.finalClass,s)}for(const[r,s]of t){if(s.length===1)continue;const i=s.filter(l=>Wa.has(l.suggestedFrom));if(i.length>1)return{ok:!1,error:`"${r}" is used by ${i.length} rows. Edit one to make it unique.`};let o=1;for(const l of s)Wa.has(l.suggestedFrom)||(l.finalClass=`${r}-${o++}`,l.suggestedFrom="auto-number")}const n=new Map;for(const r of e){const s=n.get(r.finalClass);if(s)return{ok:!1,error:`"${r.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${r.suggestedFrom}). Pick a different name for one of them.`};n.set(r.finalClass,r.suggestedFrom)}return{ok:!0}}function to(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)As.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Pc(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)As.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function Ua(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function Rc(e,t){let n=e;return n===t?Ka(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),Ka(n.replace(/-/g," ")))}function Ka(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const Nc=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),no=new Set(["section","container","block","div"]);function Bc(e,t="item"){return!e||typeof e!="string"||no.has(e)?t:Nc[e]||t}function qs(e){return typeof e=="string"&&no.has(e)}const Fc=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function Dc(e,t,n){const r=new Set(e.filter(Boolean)),s=(...h)=>h.some(b=>r.has(b)),i=s("button","button-group"),o=s("heading"),l=s("text-basic","text"),c=s("image"),u=s("nav-nested","nav-menu"),d=s("form"),f=s("icon","icon-box"),v=s("list");return d?"form":u?"nav":i&&!o&&!l?"actions":c&&!l&&!o&&!i?"media":o&&!l&&!i?"header":l&&!o&&!i?"body":o&&l?"content":o&&i?"header":f&&!l&&!o?"icon-group":v?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var qc=S(''),jc=S('BLOCK'),Hc=S('suggested'),Wc=S(''),Uc=S(''),Kc=S('
'),$c=S(''),zc=S('
'),Vc=S('
No existing classes — a new class will be added instead.
'),Gc=S(""),Yc=S('
Family
'),Jc=S('
Will rename
'),Qc=S(""),Xc=S('
Family
'),Zc=S('
Will remove the selected family and replace with the new class (empty settings). Other classes kept.
'),eu=S('
No existing classes — a new class will be created.
'),tu=S('
All existing classes will be removed from this element.
'),nu=S(" ",1),ru=S('
',1),su=S('
This element has no existing classes. Rename will create a new class instead.
'),au=S('
'),iu=S(`A class named already exists.
+var ii=Object.defineProperty;var ga=e=>{throw TypeError(e)};var li=(e,t,n)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>li(e,typeof t!="symbol"?t+"":t,n),As=(e,t,n)=>t.has(e)||ga("Cannot "+n);var d=(e,t,n)=>(As(e,t,"read from private field"),n?n.call(e):t.get(e)),D=(e,t,n)=>t.has(e)?ga("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(As(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Y=(e,t,n)=>(As(e,t,"access private method"),n);var aa=Array.isArray,ci=Array.prototype.indexOf,gn=Array.prototype.includes,ms=Array.from,ui=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,fi=Object.getOwnPropertyDescriptors,di=Object.prototype,hi=Array.prototype,Qa=Object.getPrototypeOf,ba=Object.isExtensible;const Xa=()=>{};function vi(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const Ce=2,Jn=4,gs=8,eo=1<<24,it=16,ut=32,Xt=64,Fs=128,Ze=512,be=1024,Ee=2048,yt=4096,Oe=8192,et=16384,An=32768,Ds=1<<25,Qn=65536,os=1<<17,_i=1<<18,sr=1<<19,pi=1<<20,bt=1<<25,En=65536,is=1<<21,Hn=1<<22,$t=1<<23,bn=Symbol("$state"),mi=Symbol("legacy props"),gi=Symbol(""),Gr=Symbol("attributes"),qs=Symbol("class"),js=Symbol("style"),hr=Symbol("text"),Yr=Symbol("form reset"),bs=new class extends Error{constructor(){super(...arguments);Pe(this,"name","StaleReactionError");Pe(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function bi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function yi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function wi(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ki(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Si(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ei(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ci(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ai(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ti(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Oi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ii(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Mi=1,Li=2,to=4,Pi=8,Ri=16,Ni=1,Bi=4,Fi=8,Di=16,qi=1,ji=2,ge=Symbol("uninitialized"),no="http://www.w3.org/1999/xhtml";function Hi(){console.warn("https://svelte.dev/e/derived_inert")}function Wi(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ui(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ro(e){return e===this.v}function Ki(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function so(e){return!Ki(e,this.v)}let Fe=null;function Xn(e){Fe=e}function Tn(e,t=!1,n){Fe={p:Fe,i:!1,c:null,e:null,s:e,x:null,r:z,l:null}}function On(e){var t=Fe,n=t.e;if(n!==null){t.e=null;for(var r of n)xo(r)}return t.i=!0,Fe=t.p,{}}function ao(){return!0}let cn=[];function oo(){var e=cn;cn=[],vi(e)}function Jt(e){if(cn.length===0&&!br){var t=cn;queueMicrotask(()=>{t===cn&&oo()})}cn.push(e)}function zi(){for(;cn.length>0;)oo()}function io(e){var t=z;if(t===null)return K.f|=$t,e;if((t.f&An)===0&&(t.f&Jn)===0)throw e;Gt(e,t)}function Gt(e,t){for(;t!==null;){if((t.f&Fs)!==0){if((t.f&An)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Vi=-7169;function ue(e,t){e.f=e.f&Vi|t}function oa(e){(e.f&Ze)!==0||e.deps===null?ue(e,be):ue(e,yt)}function lo(e){if(e!==null)for(const t of e)(t.f&Ce)===0||(t.f&En)===0||(t.f^=En,lo(t.deps))}function co(e,t,n){(e.f&Ee)!==0?t.add(e):(e.f&yt)!==0&&n.add(e),lo(e.deps),ue(e,be)}let Wr=!1;function Gi(e){var t=Wr;try{return Wr=!1,[e(),Wr]}finally{Wr=t}}let Ts=null,Bn=null,q=null,Hs=null,lt=null,Ws=null,br=!1,Os=!1,Dn=null,$r=null;var ya=0;let Yi=1;var Kn,Kt,dn,zn,Vn,hn,Gn,Ot,Ir,je,Mr,zt,pt,mt,Yn,vn,J,Us,vr,Ks,uo,fo,Jr,$i,zs,Fn;const vs=class vs{constructor(){D(this,J);Pe(this,"id",Yi++);D(this,Kn,!1);Pe(this,"linked",!0);D(this,Kt,null);D(this,dn,null);Pe(this,"async_deriveds",new Map);Pe(this,"current",new Map);Pe(this,"previous",new Map);Pe(this,"unblocked",new Set);D(this,zn,new Set);D(this,Vn,new Set);D(this,hn,new Set);D(this,Gn,0);D(this,Ot,new Map);D(this,Ir,null);D(this,je,[]);D(this,Mr,[]);D(this,zt,new Set);D(this,pt,new Set);D(this,mt,new Map);D(this,Yn,new Set);Pe(this,"is_fork",!1);D(this,vn,!1)}skip_effect(t){d(this,mt).has(t)||d(this,mt).set(t,{d:[],m:[]}),d(this,Yn).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=d(this,mt).get(t);if(r){d(this,mt).delete(t);for(var s of r.d)ue(s,Ee),n(s);for(s of r.m)ue(s,yt),n(s)}d(this,Yn).add(t)}capture(t,n,r=!1){t.v!==ge&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&$t)===0&&(this.current.set(t,[n,r]),lt?.set(t,n)),this.is_fork||(t.v=n)}activate(){q=this}deactivate(){q=null,lt=null}flush(){try{Os=!0,q=this,Y(this,J,vr).call(this)}finally{ya=0,Ws=null,Dn=null,$r=null,Os=!1,q=null,lt=null,yn.clear()}}discard(){for(const t of d(this,Vn))t(this);d(this,Vn).clear(),d(this,hn).clear(),Y(this,J,Fn).call(this)}register_created_effect(t){d(this,Mr).push(t)}increment(t,n){if(N(this,Gn,d(this,Gn)+1),t){let r=d(this,Ot).get(n)??0;d(this,Ot).set(n,r+1)}}decrement(t,n){if(N(this,Gn,d(this,Gn)-1),t){let r=d(this,Ot).get(n)??0;r===1?d(this,Ot).delete(n):d(this,Ot).set(n,r-1)}d(this,vn)||(N(this,vn,!0),Jt(()=>{N(this,vn,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)d(this,zt).add(r);for(const r of n)d(this,pt).add(r);t.clear(),n.clear()}oncommit(t){d(this,zn).add(t)}ondiscard(t){d(this,Vn).add(t)}on_fork_commit(t){d(this,hn).add(t)}run_fork_commit_callbacks(){for(const t of d(this,hn))t(this);d(this,hn).clear()}settled(){return(d(this,Ir)??N(this,Ir,Za())).promise}static ensure(){var t;if(q===null){const n=q=new vs;Y(t=n,J,zs).call(t),!Os&&!br&&Jt(()=>{d(n,Kn)||n.flush()})}return q}apply(){{lt=null;return}}schedule(t){if(Ws=t,t.b?.is_pending&&(t.f&(Jn|gs|eo))!==0&&(t.f&An)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(Dn!==null&&n===z&&(K===null||(K.f&Ce)===0))return;if((r&(Xt|ut))!==0){if((r&be)===0)return;n.f^=be}}d(this,je).push(n)}};Kn=new WeakMap,Kt=new WeakMap,dn=new WeakMap,zn=new WeakMap,Vn=new WeakMap,hn=new WeakMap,Gn=new WeakMap,Ot=new WeakMap,Ir=new WeakMap,je=new WeakMap,Mr=new WeakMap,zt=new WeakMap,pt=new WeakMap,mt=new WeakMap,Yn=new WeakMap,vn=new WeakMap,J=new WeakSet,Us=function(){if(this.is_fork)return!0;for(const r of d(this,Ot).keys()){for(var t=r,n=!1;t.parent!==null;){if(d(this,mt).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},vr=function(){var u,c,h;if(N(this,Kn,!0),ya++>1e3&&(Y(this,J,Fn).call(this),Qi()),!Y(this,J,Us).call(this)){for(const f of d(this,zt))d(this,pt).delete(f),ue(f,Ee),this.schedule(f);for(const f of d(this,pt))ue(f,yt),this.schedule(f)}const t=d(this,je);N(this,je,[]),this.apply();var n=Dn=[],r=[],s=$r=[];for(const f of t)try{Y(this,J,Ks).call(this,f,n,r)}catch(v){throw _o(f),v}if(q=null,s.length>0){var a=vs.ensure();for(const f of s)a.schedule(f)}if(Dn=null,$r=null,Y(this,J,Us).call(this)){Y(this,J,Jr).call(this,r),Y(this,J,Jr).call(this,n);for(const[f,v]of d(this,mt))vo(f,v);s.length>0&&Y(u=q,J,vr).call(u);return}const o=Y(this,J,uo).call(this);if(o){Y(c=o,J,fo).call(c,this);return}d(this,zt).clear(),d(this,pt).clear();for(const f of d(this,zn))f(this);d(this,zn).clear(),Hs=this,wa(r),wa(n),Hs=null,d(this,Ir)?.resolve();var i=q;if(this.linked&&d(this,Gn)===0&&Y(this,J,Fn).call(this),d(this,je).length>0){i===null&&(i=this,Y(this,J,zs).call(this));const f=i;d(f,je).push(...d(this,je).filter(v=>!d(f,je).includes(v)))}i!==null&&Y(h=i,J,vr).call(h)},Ks=function(t,n,r){t.f^=be;for(var s=t.first;s!==null;){var a=s.f,o=(a&(ut|Xt))!==0,i=o&&(a&be)!==0,u=i||(a&Oe)!==0||d(this,mt).has(s);if(!u&&s.fn!==null){o?s.f^=be:(a&Jn)!==0?n.push(s):Fr(s)&&((a&it)!==0&&d(this,pt).add(s),er(s));var c=s.first;if(c!==null){s=c;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},uo=function(){for(var t=d(this,Kt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=d(t,Kt)}return null},fo=function(t){var r;for(const[s,a]of t.current)!this.previous.has(s)&&t.previous.has(s)&&this.previous.set(s,t.previous.get(s)),this.current.set(s,a);for(const[s,a]of t.async_deriveds){const o=this.async_deriveds.get(s);o&&a.promise.then(o.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const u of a){var o=u.f;if((o&Ce)!==0)n(u);else{var i=u;o&(Hn|it)&&!this.async_deriveds.has(i)&&(d(this,pt).delete(i),ue(i,Ee),this.schedule(i))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>t.discard()),Y(r=t,J,Fn).call(r),q=this,Y(this,J,vr).call(this)},Jr=function(t){for(var n=0;n!this.current.has(v));if(s.length===0)t&&f.discard();else if(n.length>0){if(t)for(const v of d(this,Yn))f.unskip_effect(v,_=>{var b;(_.f&(it|Hn))!==0?f.schedule(_):Y(b=f,J,Jr).call(b,[_])});f.activate();var a=new Set,o=new Map;for(var i of n)ho(i,s,a,o);o=new Map;var u=[...f.current.keys()].filter(v=>this.current.has(v)?this.current.get(v)[0]!==v.v:!0);if(u.length>0)for(const v of d(this,Mr))(v.f&(et|Oe|os))===0&&ia(v,u,o)&&((v.f&(Hn|it))!==0?(ue(v,Ee),f.schedule(v)):d(f,zt).add(v));if(d(f,je).length>0&&!d(f,vn)){f.apply();for(var c of d(f,je))Y(h=f,J,Ks).call(h,c,[],[]);N(f,je,[])}f.deactivate()}}}},zs=function(){Bn===null?Ts=Bn=this:(N(Bn,dn,this),N(this,Kt,Bn)),Bn=this},Fn=function(){var t=d(this,Kt),n=d(this,dn);t===null?Ts=n:N(t,dn,n),n===null?Bn=t:N(n,Kt,t),this.linked=!1};let Cn=vs;function Ji(e){var t=br;br=!0;try{for(var n;;){if(zi(),q===null)return n;q.flush()}}finally{br=t}}function Qi(){try{Ci()}catch(e){Gt(e,Ws)}}let At=null;function wa(e){var t=e.length;if(t!==0){for(var n=0;n0)){yn.clear();for(const s of At){if((s.f&(et|Oe))!==0)continue;const a=[s];let o=s.parent;for(;o!==null;)At.has(o)&&(At.delete(o),a.push(o)),o=o.parent;for(let i=a.length-1;i>=0;i--){const u=a[i];(u.f&(et|Oe))===0&&er(u)}}At.clear()}}At=null}}function ho(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const a=s.f;(a&Ce)!==0?ho(s,t,n,r):(a&(Hn|it))!==0&&(a&Ee)===0&&ia(s,t,r)&&(ue(s,Ee),la(s))}}function ia(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(gn.call(t,s))return!0;if((s.f&Ce)!==0&&ia(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function la(e){q.schedule(e)}function vo(e,t){if(!((e.f&ut)!==0&&(e.f&be)!==0)){(e.f&Ee)!==0?t.d.push(e):(e.f&yt)!==0&&t.m.push(e),ue(e,be);for(var n=e.first;n!==null;)vo(n,t),n=n.next}}function _o(e){ue(e,be);for(var t=e.first;t!==null;)_o(t),t=t.next}function Xi(e){let t=0,n=xn(0),r;return()=>{fa()&&(l(n),ks(()=>(t===0&&(r=ar(()=>e(()=>yr(n)))),t+=1,()=>{Jt(()=>{t-=1,t===0&&(r?.(),r=void 0,yr(n))})})))}}var Zi=Qn|sr;function el(e,t,n,r){new tl(e,t,n,r)}var Ye,sa,$e,_n,Re,Je,Te,He,It,pn,Vt,$n,Lr,Pr,Mt,_s,fe,nl,rl,sl,Vs,Qr,Xr,Gs,Ys;class tl{constructor(t,n,r,s){D(this,fe);Pe(this,"parent");Pe(this,"is_pending",!1);Pe(this,"transform_error");D(this,Ye);D(this,sa,null);D(this,$e);D(this,_n);D(this,Re);D(this,Je,null);D(this,Te,null);D(this,He,null);D(this,It,null);D(this,pn,0);D(this,Vt,0);D(this,$n,!1);D(this,Lr,new Set);D(this,Pr,new Set);D(this,Mt,null);D(this,_s,Xi(()=>(N(this,Mt,xn(d(this,pn))),()=>{N(this,Mt,null)})));N(this,Ye,t),N(this,$e,n),N(this,_n,a=>{var o=z;o.b=this,o.f|=Fs,r(a)}),this.parent=z.b,this.transform_error=s??this.parent?.transform_error??(a=>a),N(this,Re,ha(()=>{Y(this,fe,Vs).call(this)},Zi))}defer_effect(t){co(t,d(this,Lr),d(this,Pr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!d(this,$e).pending}update_pending_count(t,n){Y(this,fe,Gs).call(this,t,n),N(this,pn,d(this,pn)+t),!(!d(this,Mt)||d(this,$n))&&(N(this,$n,!0),Jt(()=>{N(this,$n,!1),d(this,Mt)&&Zn(d(this,Mt),d(this,pn))}))}get_effect_pending(){return d(this,_s).call(this),l(d(this,Mt))}error(t){if(!d(this,$e).onerror&&!d(this,$e).failed)throw t;q?.is_fork?(d(this,Je)&&q.skip_effect(d(this,Je)),d(this,Te)&&q.skip_effect(d(this,Te)),d(this,He)&&q.skip_effect(d(this,He)),q.on_fork_commit(()=>{Y(this,fe,Ys).call(this,t)})):Y(this,fe,Ys).call(this,t)}}Ye=new WeakMap,sa=new WeakMap,$e=new WeakMap,_n=new WeakMap,Re=new WeakMap,Je=new WeakMap,Te=new WeakMap,He=new WeakMap,It=new WeakMap,pn=new WeakMap,Vt=new WeakMap,$n=new WeakMap,Lr=new WeakMap,Pr=new WeakMap,Mt=new WeakMap,_s=new WeakMap,fe=new WeakSet,nl=function(){try{N(this,Je,Qe(()=>d(this,_n).call(this,d(this,Ye))))}catch(t){this.error(t)}},rl=function(t){const n=d(this,$e).failed;n&&N(this,He,Qe(()=>{n(d(this,Ye),()=>t,()=>()=>{})}))},sl=function(){const t=d(this,$e).pending;t&&(this.is_pending=!0,N(this,Te,Qe(()=>t(d(this,Ye)))),Jt(()=>{var n=N(this,It,document.createDocumentFragment()),r=Nt();n.append(r),N(this,Je,Y(this,fe,Xr).call(this,()=>Qe(()=>d(this,_n).call(this,r)))),d(this,Vt)===0&&(d(this,Ye).before(n),N(this,It,null),wn(d(this,Te),()=>{N(this,Te,null)}),Y(this,fe,Qr).call(this,q))}))},Vs=function(){try{if(this.is_pending=this.has_pending_snippet(),N(this,Vt,0),N(this,pn,0),N(this,Je,Qe(()=>{d(this,_n).call(this,d(this,Ye))})),d(this,Vt)>0){var t=N(this,It,document.createDocumentFragment());pa(d(this,Je),t);const n=d(this,$e).pending;N(this,Te,Qe(()=>n(d(this,Ye))))}else Y(this,fe,Qr).call(this,q)}catch(n){this.error(n)}},Qr=function(t){this.is_pending=!1,t.transfer_effects(d(this,Lr),d(this,Pr))},Xr=function(t){var n=z,r=K,s=Fe;wt(d(this,Re)),nt(d(this,Re)),Xn(d(this,Re).ctx);try{return Cn.ensure(),t()}catch(a){return io(a),null}finally{wt(n),nt(r),Xn(s)}},Gs=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&Y(r=this.parent,fe,Gs).call(r,t,n);return}N(this,Vt,d(this,Vt)+t),d(this,Vt)===0&&(Y(this,fe,Qr).call(this,n),d(this,Te)&&wn(d(this,Te),()=>{N(this,Te,null)}),d(this,It)&&(d(this,Ye).before(d(this,It)),N(this,It,null)))},Ys=function(t){d(this,Je)&&(Be(d(this,Je)),N(this,Je,null)),d(this,Te)&&(Be(d(this,Te)),N(this,Te,null)),d(this,He)&&(Be(d(this,He)),N(this,He,null));var n=d(this,$e).onerror;let r=d(this,$e).failed;var s=!1,a=!1;const o=()=>{if(s){Ui();return}s=!0,a&&Ii(),d(this,He)!==null&&wn(d(this,He),()=>{N(this,He,null)}),Y(this,fe,Xr).call(this,()=>{Y(this,fe,Vs).call(this)})},i=u=>{try{a=!0,n?.(u,o),a=!1}catch(c){Gt(c,d(this,Re)&&d(this,Re).parent)}r&&N(this,He,Y(this,fe,Xr).call(this,()=>{try{return Qe(()=>{var c=z;c.b=this,c.f|=Fs,r(d(this,Ye),()=>u,()=>o)})}catch(c){return Gt(c,d(this,Re).parent),null}}))};Jt(()=>{var u;try{u=this.transform_error(t)}catch(c){Gt(c,d(this,Re)&&d(this,Re).parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(i,c=>Gt(c,d(this,Re)&&d(this,Re).parent)):i(u)})};function al(e,t,n,r){const s=xr;var a=e.filter(v=>!v.settled);if(n.length===0&&a.length===0){r(t.map(s));return}var o=z,i=ol(),u=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(v=>v.promise)):null;function c(v){if((o.f&et)===0){i();try{r(v)}catch(_){Gt(_,o)}ls()}}var h=po();if(n.length===0){u.then(()=>c(t.map(s))).finally(h);return}function f(){Promise.all(n.map(v=>il(v))).then(v=>c([...t.map(s),...v])).catch(v=>Gt(v,o)).finally(h)}u?u.then(()=>{i(),f(),ls()}):f()}function ol(){var e=z,t=K,n=Fe,r=q;return function(a=!0){wt(e),nt(t),Xn(n),a&&(e.f&et)===0&&(r?.activate(),r?.apply())}}function ls(e=!0){wt(null),nt(null),Xn(null),e&&q?.deactivate()}function po(){var e=z,t=e.b,n=q,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 xr(e){var t=Ce|Ee;return z!==null&&(z.f|=sr),{ctx:Fe,deps:null,effects:null,equals:ro,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:z,ac:null}}const Ur=Symbol("obsolete");function il(e,t,n){let r=z;r===null&&yi();var s=void 0,a=xn(ge),o=!K,i=new Set;return yl(()=>{var u=z,c=Za();s=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==bs&&c.reject(_)}).finally(ls)}catch(_){c.reject(_),ls()}var h=q;if(o){if((u.f&An)!==0)var f=po();if(r.b.is_rendered())h.async_deriveds.get(u)?.reject(Ur);else for(const _ of i.values())_.reject(Ur);i.add(c),h.async_deriveds.set(u,c)}const v=(_,b=void 0)=>{f?.(),i.delete(c),b!==Ur&&(h.activate(),b?(a.f|=$t,Zn(a,b)):((a.f&$t)!==0&&(a.f^=$t),Zn(a,_)),h.deactivate())};c.promise.then(v,_=>v(null,_||"unknown"))}),da(()=>{for(const u of i)u.reject(Ur)}),new Promise(u=>{function c(h){function f(){h===s?u(a):c(s)}h.then(f,f)}c(s)})}function U(e){const t=xr(e);return Lo(t),t}function mo(e){const t=xr(e);return t.equals=so,t}function ll(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!yo&&fl()}return t}function fl(){yo=!1;for(const e of cs){(e.f&be)!==0&&ue(e,yt);let t;try{t=Fr(e)}catch{t=!0}t&&er(e)}cs.clear()}function yr(e){X(e,e.v+1)}function wo(e,t,n){var r=e.reactions;if(r!==null)for(var s=r.length,a=0;a{if(kn===a)return i();var u=K,c=kn;nt(null),Ca(a);var h=i();return nt(u),Ca(c),h};return r&&n.set("length",de(e.length)),new Proxy(e,{defineProperty(i,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ai();var h=n.get(u);return h===void 0?o(()=>{var f=de(c.value);return n.set(u,f),f}):X(h,c.value,!0),!0},deleteProperty(i,u){var c=n.get(u);if(c===void 0){if(u in i){const h=o(()=>de(ge));n.set(u,h),yr(s)}}else X(c,ge),yr(s);return!0},get(i,u,c){if(u===bn)return e;var h=n.get(u),f=u in i;if(h===void 0&&(!f||jn(i,u)?.writable)&&(h=o(()=>{var _=Lt(f?i[u]:ge),b=de(_);return b}),n.set(u,h)),h!==void 0){var v=l(h);return v===ge?void 0:v}return Reflect.get(i,u,c)},getOwnPropertyDescriptor(i,u){var c=Reflect.getOwnPropertyDescriptor(i,u);if(c&&"value"in c){var h=n.get(u);h&&(c.value=l(h))}else if(c===void 0){var f=n.get(u),v=f?.v;if(f!==void 0&&v!==ge)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return c},has(i,u){if(u===bn)return!0;var c=n.get(u),h=c!==void 0&&c.v!==ge||Reflect.has(i,u);if(c!==void 0||z!==null&&(!h||jn(i,u)?.writable)){c===void 0&&(c=o(()=>{var v=h?Lt(i[u]):ge,_=de(v);return _}),n.set(u,c));var f=l(c);if(f===ge)return!1}return h},set(i,u,c,h){var f=n.get(u),v=u in i;if(r&&u==="length")for(var _=c;_de(ge)),n.set(_+"",b))}if(f===void 0)(!v||jn(i,u)?.writable)&&(f=o(()=>de(void 0)),X(f,Lt(c)),n.set(u,f));else{v=f.v!==ge;var O=o(()=>Lt(c));X(f,O)}var m=Reflect.getOwnPropertyDescriptor(i,u);if(m?.set&&m.set.call(h,c),!v){if(r&&typeof u=="string"){var A=n.get("length"),T=Number(u);Number.isInteger(T)&&T>=A.v&&X(A,T+1)}yr(s)}return!0},ownKeys(i){l(s);var u=Reflect.ownKeys(i).filter(f=>{var v=n.get(f);return v===void 0||v.v!==ge});for(var[c,h]of n)h.v!==ge&&!(c in i)&&u.push(c);return u},setPrototypeOf(){Ti()}})}function ka(e){try{if(e!==null&&typeof e=="object"&&bn in e)return e[bn]}catch{}return e}function dl(e,t){return Object.is(ka(e),ka(t))}var us,ko,So,Eo;function hl(){if(us===void 0){us=window,ko=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;So=jn(t,"firstChild").get,Eo=jn(t,"nextSibling").get,ba(e)&&(e[qs]=void 0,e[Gr]=null,e[js]=void 0,e.__e=void 0),ba(n)&&(n[hr]=void 0)}}function Nt(e=""){return document.createTextNode(e)}function fs(e){return So.call(e)}function Br(e){return Eo.call(e)}function w(e,t){return fs(e)}function Se(e,t=!1){{var n=fs(e);return n instanceof Comment&&n.data===""?Br(n):n}}function k(e,t=1,n=!1){let r=e;for(;t--;)r=Br(r);return r}function vl(e){e.textContent=""}function Co(){return!1}function _l(e,t,n){return document.createElementNS(no,e,void 0)}let Sa=!1;function pl(){Sa||(Sa=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Yr]?.()})},{capture:!0}))}function ys(e){var t=K,n=z;nt(null),wt(null);try{return e()}finally{nt(t),wt(n)}}function ua(e,t,n,r=n){e.addEventListener(t,()=>ys(n));const s=e[Yr];s?e[Yr]=()=>{s(),r(!0)}:e[Yr]=()=>r(!0),pl()}function ml(e){z===null&&(K===null&&Ei(),Si()),Ft&&ki()}function gl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Dt(e,t){var n=z;n!==null&&(n.f&Oe)!==0&&(e|=Oe);var r={ctx:Fe,deps:null,nodes:null,f:e|Ee|Ze,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};q?.register_created_effect(r);var s=r;if((e&Jn)!==0)Dn!==null?Dn.push(r):Cn.ensure().schedule(r);else if(t!==null){try{er(r)}catch(o){throw Be(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&sr)===0&&(s=s.first,(e&it)!==0&&(e&Qn)!==0&&s!==null&&(s.f|=Qn))}if(s!==null&&(s.parent=n,n!==null&&gl(s,n),K!==null&&(K.f&Ce)!==0&&(e&Xt)===0)){var a=K;(a.effects??(a.effects=[])).push(s)}return r}function fa(){return K!==null&&!ct}function da(e){const t=Dt(gs,null);return ue(t,be),t.teardown=e,t}function ws(e){ml();var t=z.f,n=!K&&(t&ut)!==0&&(t&An)===0;if(n){var r=Fe;(r.e??(r.e=[])).push(e)}else return xo(e)}function xo(e){return Dt(Jn|pi,e)}function bl(e){Cn.ensure();const t=Dt(Xt|sr,e);return(n={})=>new Promise(r=>{n.outro?wn(t,()=>{Be(t),r(void 0)}):(Be(t),r(void 0))})}function Ao(e){return Dt(Jn,e)}function yl(e){return Dt(Hn|sr,e)}function ks(e,t=0){return Dt(gs|t,e)}function B(e,t=[],n=[],r=[]){al(r,t,n,s=>{Dt(gs,()=>e(...s.map(l)))})}function ha(e,t=0){var n=Dt(it|t,e);return n}function Qe(e){return Dt(ut|sr,e)}function To(e){var t=e.teardown;if(t!==null){const n=Ft,r=K;Ea(!0),nt(null);try{t.call(null)}finally{Ea(n),nt(r)}}}function va(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&ys(()=>{s.abort(bs)});var r=n.next;(n.f&Xt)!==0?n.parent=null:Be(n,t),n=r}}function wl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ut)===0&&Be(t),t=n}}function Be(e,t=!0){var n=!1;(t||(e.f&_i)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(kl(e.nodes.start,e.nodes.end),n=!0),ue(e,Ds),va(e,t&&!n),Ar(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)a.stop();To(e),e.f^=Ds,e.f|=et;var s=e.parent;s!==null&&s.first!==null&&Oo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function kl(e,t){for(;e!==null;){var n=e===t?null:Br(e);e.remove(),e=n}}function Oo(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 wn(e,t,n=!0){var r=[];Io(e,r,!0);var s=()=>{n&&Be(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||s();for(var i of r)i.out(o)}else s()}function Io(e,t,n){if((e.f&Oe)===0){e.f^=Oe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)(i.is_global||n)&&t.push(i);for(var s=e.first;s!==null;){var a=s.next;if((s.f&Xt)===0){var o=(s.f&Qn)!==0||(s.f&ut)!==0&&(e.f&it)!==0;Io(s,t,o?n:!1)}s=a}}}function _a(e){Mo(e,!0)}function Mo(e,t){if((e.f&Oe)!==0){e.f^=Oe,(e.f&be)===0&&(ue(e,Ee),Cn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Qn)!==0||(n.f&ut)!==0;Mo(n,s?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(const o of a)(o.is_global||t)&&o.in()}}function pa(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Br(n);t.append(n),n=s}}let Zr=!1,Ft=!1;function Ea(e){Ft=e}let K=null,ct=!1;function nt(e){K=e}let z=null;function wt(e){z=e}let tt=null;function Lo(e){K!==null&&(tt===null?tt=[e]:tt.push(e))}let Ne=null,qe=0,Ge=null;function Sl(e){Ge=e}let Po=1,un=0,kn=un;function Ca(e){kn=e}function Ro(){return++Po}function Fr(e){var t=e.f;if((t&Ee)!==0)return!0;if(t&Ce&&(e.f&=~En),(t&yt)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&Ze)!==0&<===null&&ue(e,be)}return!1}function No(e,t,n=!0){var r=e.reactions;if(r!==null&&!(tt!==null&&gn.call(tt,e)))for(var s=0;s{e.ac.abort(bs)}),e.ac=null);try{e.f|=is;var h=e.fn,f=h();e.f|=An;var v=e.deps,_=q?.is_fork;if(Ne!==null){var b;if(_||Ar(e,qe),v!==null&&qe>0)for(v.length=qe+Ne.length,b=0;bn?.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Jt(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function jo(e,t,n,r,s){var a={capture:r,passive:s},o=Tl(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&da(()=>{t.removeEventListener(e,o,a)})}function se(e,t,n){(t[fn]??(t[fn]={}))[e]=n}function In(e){for(var t=0;t{throw m});throw v}}finally{e[fn]=t,delete e.currentTarget,nt(h),wt(f)}}}const Ol=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Il(e){return Ol?.createHTML(e)??e}function Ml(e){var t=_l("template");return t.innerHTML=Il(e.replaceAll("","")),t.content}function ds(e,t){var n=z;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function x(e,t){var n=(t&qi)!==0,r=(t&ji)!==0,s,a=!e.startsWith("");return()=>{s===void 0&&(s=Ml(a?e:""+e),n||(s=fs(s)));var o=r||ko?document.importNode(s,!0):s.cloneNode(!0);if(n){var i=fs(o),u=o.lastChild;ds(i,u)}else ds(o,o);return o}}function Ll(e=""){{var t=Nt(e+"");return ds(t,t),t}}function Ho(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Nt();return e.append(t,n),ds(t,n),e}function S(e,t){e!==null&&e.before(t)}function H(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[hr]??(e[hr]=e.nodeValue))&&(e[hr]=n,e.nodeValue=`${n}`)}function Ss(e,t){return Pl(e,t)}const Kr=new Map;function Pl(e,{target:t,anchor:n,props:r={},events:s,context:a,intro:o=!0,transformError:i}){hl();var u=void 0,c=bl(()=>{var h=n??t.appendChild(Nt());el(h,{pending:()=>{}},_=>{Tn({});var b=Fe;a&&(b.c=a),s&&(r.$$events=s),u=e(_,r)||{},On()},i);var f=new Set,v=_=>{for(var b=0;b<_.length;b++){var O=_[b];if(!f.has(O)){f.add(O);var m=Al(O);for(const M of[t,document]){var A=Kr.get(M);A===void 0&&(A=new Map,Kr.set(M,A));var T=A.get(O);T===void 0?(M.addEventListener(O,Js,{passive:m}),A.set(O,1)):A.set(O,T+1)}}}};return v(ms(qo)),$s.add(v),()=>{for(var _ of f)for(const m of[t,document]){var b=Kr.get(m),O=b.get(_);--O==0?(m.removeEventListener(_,Js),b.delete(_),b.size===0&&Kr.delete(m)):b.set(_,O)}$s.delete(v),h!==n&&h.parentNode?.removeChild(h)}});return Qs.set(u,c),u}let Qs=new WeakMap;function or(e,t){const n=Qs.get(e);return n?(Qs.delete(e),n(t)):Promise.resolve()}var ot,gt,We,mn,Rr,Nr,ps;class Rl{constructor(t,n=!0){Pe(this,"anchor");D(this,ot,new Map);D(this,gt,new Map);D(this,We,new Map);D(this,mn,new Set);D(this,Rr,!0);D(this,Nr,t=>{if(d(this,ot).has(t)){var n=d(this,ot).get(t),r=d(this,gt).get(n);if(r)_a(r),d(this,mn).delete(n);else{var s=d(this,We).get(n);s&&(d(this,gt).set(n,s.effect),d(this,We).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,o]of d(this,ot)){if(d(this,ot).delete(a),a===t)break;const i=d(this,We).get(o);i&&(Be(i.effect),d(this,We).delete(o))}for(const[a,o]of d(this,gt)){if(a===n||d(this,mn).has(a))continue;const i=()=>{if(Array.from(d(this,ot).values()).includes(a)){var c=document.createDocumentFragment();pa(o,c),c.append(Nt()),d(this,We).set(a,{effect:o,fragment:c})}else Be(o);d(this,mn).delete(a),d(this,gt).delete(a)};d(this,Rr)||!r?(d(this,mn).add(a),wn(o,i,!1)):i()}}});D(this,ps,t=>{d(this,ot).delete(t);const n=Array.from(d(this,ot).values());for(const[r,s]of d(this,We))n.includes(r)||(Be(s.effect),d(this,We).delete(r))});this.anchor=t,N(this,Rr,n)}ensure(t,n){var r=q,s=Co();if(n&&!d(this,gt).has(t)&&!d(this,We).has(t))if(s){var a=document.createDocumentFragment(),o=Nt();a.append(o),d(this,We).set(t,{effect:Qe(()=>n(o)),fragment:a})}else d(this,gt).set(t,Qe(()=>n(this.anchor)));if(d(this,ot).set(r,t),s){for(const[i,u]of d(this,gt))i===t?r.unskip_effect(u):r.skip_effect(u);for(const[i,u]of d(this,We))i===t?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(d(this,Nr)),r.ondiscard(d(this,ps))}else d(this,Nr).call(this,r)}}ot=new WeakMap,gt=new WeakMap,We=new WeakMap,mn=new WeakMap,Rr=new WeakMap,Nr=new WeakMap,ps=new WeakMap;function W(e,t,n=!1){var r=new Rl(e),s=n?Qn:0;function a(o,i){r.ensure(o,i)}ha(()=>{var o=!1;t((i,u=0)=>{o=!0,a(u,i)}),o||a(-1,null)},s)}function zr(e,t){return t}function Nl(e,t,n){for(var r=[],s=t.length,a,o=t.length,i=0;i{if(a){if(a.pending.delete(f),a.done.add(f),a.pending.size===0){var v=e.outrogroups;Xs(e,ms(a.done)),v.delete(a),v.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=r.length===0&&n!==null;if(u){var c=n,h=c.parentNode;vl(h),h.append(c),e.items.clear()}Xs(e,t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(a)}function Xs(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const i of o)r.add(e.items.get(i).e)}for(var s=0;s{var M=n();return aa(M)?M:M==null?[]:ms(M)}),v,_=new Map,b=!0;function O(M){(T.effect.f&et)===0&&(T.pending.delete(M),T.fallback=h,Bl(T,v,o,t,r),h!==null&&(v.length===0?(h.f&bt)===0?_a(h):(h.f^=bt,_r(h,null,o)):wn(h,()=>{h=null})))}function m(M){T.pending.delete(M)}var A=ha(()=>{v=l(f);for(var M=v.length,F=new Set,Z=q,ae=Co(),re=0;rea(o)):(h=Qe(()=>a(Aa??(Aa=Nt()))),h.f|=bt)),M>F.size&&wi(),!b)if(_.set(Z,F),ae){for(const[qt,De]of i)F.has(qt)||Z.skip_effect(De.e);Z.oncommit(O),Z.ondiscard(m)}else O(Z);l(f)}),T={effect:A,items:i,pending:_,outrogroups:null,fallback:h};b=!1}function dr(e){for(;e!==null&&(e.f&ut)===0;)e=e.next;return e}function Bl(e,t,n,r,s){var a=(r&Pi)!==0,o=t.length,i=e.items,u=dr(e.effect.first),c,h=null,f,v=[],_=[],b,O,m,A;if(a)for(A=0;A0){var pe=(r&to)!==0&&o===0?n:null;if(a){for(A=0;A{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function Fl(e,t,n,r,s,a,o,i){var u=(o&Mi)!==0?(o&Ri)===0?ul(n,!1,!1):xn(n):null,c=(o&Li)!==0?xn(s):null;return{v:u,i:c,e:Qe(()=>(a(t,u??n,c??s,i),()=>{e.delete(r)}))}}function _r(e,t,n){if(e.nodes)for(var r=e.nodes.start,s=e.nodes.end,a=t&&(t.f&bt)===0?t.nodes.start:n;r!==null;){var o=Br(r);if(a.before(r),r===s)return;r=o}}function Ut(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const Ta=[...`
+\r\f \v\uFEFF`];function Dl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,o=0;(o=r.indexOf(s,o))>=0;){var i=o+a;(o===0||Ta.includes(r[o-1]))&&(i===r.length||Ta.includes(r[i]))?r=(o===0?"":r.substring(0,o))+r.substring(i+1):o=i}}return r===""?null:r}function ql(e,t){return e==null?null:String(e)}function Ke(e,t,n,r,s,a){var o=e[qs];if(o!==n||o===void 0){var i=Dl(n,r,a);i==null?e.removeAttribute("class"):e.className=i,e[qs]=n}else if(a&&s!==a)for(var u in a){var c=!!a[u];(s==null||c!==!!s[u])&&e.classList.toggle(u,c)}return a}function Tt(e,t,n,r){var s=e[js];if(s!==t){var a=ql(t);a==null?e.removeAttribute("style"):e.style.cssText=a,e[js]=t}return r}function Wo(e,t,n=!1){if(e.multiple){if(t==null)return;if(!aa(t))return Wi();for(var r of e.options)r.selected=t.includes(wr(r));return}for(r of e.options){var s=wr(r);if(dl(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function jl(e){var t=new MutationObserver(()=>{Wo(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),da(()=>{t.disconnect()})}function Zs(e,t,n=t){var r=new WeakSet,s=!0;ua(e,"change",a=>{var o=a?"[selected]":":checked",i;if(e.multiple)i=[].map.call(e.querySelectorAll(o),wr);else{var u=e.querySelector(o)??e.querySelector("option:not([disabled])");i=u&&wr(u)}n(i),e.__value=i,q!==null&&r.add(q)}),Ao(()=>{var a=t();if(e===document.activeElement){var o=q;if(r.has(o))return}if(Wo(e,a,s),s&&a===void 0){var i=e.querySelector(":checked");i!==null&&(a=wr(i),n(a))}e.__value=a,s=!1}),jl(e)}function wr(e){return"__value"in e?e.__value:e.value}const Hl=Symbol("is custom element"),Wl=Symbol("is html");function ie(e,t,n,r){var s=Ul(e);s[t]!==(s[t]=n)&&(t==="loading"&&(e[gi]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Kl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ul(e){return e[Gr]??(e[Gr]={[Hl]:e.nodeName.includes("-"),[Wl]:e.namespaceURI===no})}var Oa=new Map;function Kl(e){var t=e.getAttribute("is")||e.nodeName,n=Oa.get(t);if(n)return n;Oa.set(t,n=[]);for(var r,s=e,a=Element.prototype;a!==s;){r=fi(s);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);s=Qa(s)}return n}function ea(e,t,n=t){var r=new WeakSet;ua(e,"input",async s=>{var a=s?e.defaultValue:e.value;if(a=Is(e)?Ms(a):a,n(a),q!==null&&r.add(q),await Cl(),a!==(a=t())){var o=e.selectionStart,i=e.selectionEnd,u=e.value.length;if(e.value=a??"",i!==null){var c=e.value.length;o===i&&i===u&&c>u?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(i,c))}}}),ar(t)==null&&e.value&&(n(Is(e)?Ms(e.value):e.value),q!==null&&r.add(q)),ks(()=>{var s=t();if(e===document.activeElement){var a=q;if(r.has(a))return}Is(e)&&s===Ms(e.value)||e.type==="date"&&!s&&!e.value||s!==e.value&&(e.value=s??"")})}function Uo(e,t,n=t){ua(e,"change",r=>{var s=r?e.defaultChecked:e.checked;n(s)}),ar(t)==null&&n(e.checked),ks(()=>{var r=t();e.checked=!!r})}function Is(e){var t=e.type;return t==="number"||t==="range"}function Ms(e){return e===""?null:+e}function Ls(e,t){return e===t||e?.[bn]===t}function zl(e={},t,n,r){var s=Fe.r,a=z;return Ao(()=>{var o,i;return ks(()=>{o=i,i=[],ar(()=>{Ls(n(...i),e)||(t(e,...i),o&&Ls(n(...o),e)&&t(null,...o))})}),()=>{let u=a;for(;u!==s&&u.parent!==null&&u.parent.f&Ds;)u=u.parent;const c=()=>{i&&Ls(n(...i),e)&&t(null,...i)},h=u.teardown;u.teardown=()=>{c(),h?.()}}}),e}function Yt(e,t,n,r){var s=!0,a=(n&Fi)!==0,o=(n&Di)!==0,i=r,u=!0,c=void 0,h=()=>o&&s?(c??(c=xr(r)),l(c)):(u&&(u=!1,i=o?ar(r):r),i);let f;if(a){var v=bn in e||mi in e;f=jn(e,t)?.set??(v&&t in e?F=>e[t]=F:void 0)}var _,b=!1;a?[_,b]=Gi(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),f&&(xi(),f(_)));var O;if(O=()=>{var F=e[t];return F===void 0?h():(u=!0,F)},(n&Bi)===0)return O;if(f){var m=e.$$legacy;return(function(F,Z){return arguments.length>0?((!Z||m||b)&&f(Z?O():F),F):O()})}var A=!1,T=((n&Ni)!==0?xr:mo)(()=>(A=!1,O()));a&&l(T);var M=z;return(function(F,Z){if(arguments.length>0){const ae=Z?l(T):a?Lt(F):F;return X(T,ae),A=!0,i!==void 0&&(i=ae),F}return Ft&&A||(M.f&et)!==0?T.v:l(T)})}function Ko(e){Fe===null&&bi(),ws(()=>{const t=ar(e);if(typeof t=="function")return t})}const zo="[data-v-app]",Vl=["header","content","footer"];let Xe=null,xt=null;function Gl(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Yl(){if(typeof document>"u")return!1;const t=document.querySelector(zo)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Xe=null,!1):(Xe=t,xt=null,!0)}function $l(){if(xt!==null)return xt;const e=typeof document<"u"?document.querySelector(zo)?.__vue_app__:null;if(!e)return xt=!1,!1;const t=e.config?.globalProperties??{};if(typeof Xe?.$history?.pause=="function"&&typeof Xe?.$history?.resume=="function")return xt={pause:()=>Xe.$history.pause(),resume:()=>Xe.$history.resume()},xt;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(xt={pause:()=>n.history.pause(),resume:()=>n.history.resume()},xt):(xt=!1,!1)}function Jl(e){const t=$l();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function Qt(e){if(!Xe||!e)return null;for(const t of Vl){const n=Xe[t];if(!Array.isArray(n))continue;const r=n.find(s=>s&&s.id===e);if(r)return r}return null}function Ql(e){const t=Qt(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Vo(t,1,n),n}function Vo(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const s=Qt(r);s&&(n.push({id:s.id,depth:t,label:s.label,name:s.name,settings:s.settings}),Vo(s,t+1,n))}}function Go(){return Xe?Xe.globalClasses:[]}function Ps(e,t){if(!Xe)throw new Error("rebemer: not ready");const n=Xe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const s=new Set(n.map(o=>o?.id).filter(Boolean)),a=Gl(s);return n.push({id:a,name:e,settings:t||{}}),a}function Ia(e,t){const n=Qt(e);if(!n)return;n.settings||(n.settings={});const 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 Ma(e,t){const n=Qt(e);n&&(n.label=t)}const La="slashed-rebemer-host",Xl="slashed-class-hint",Yo=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],tr="rebemer-class-hint-btn",Zl=50;function ta(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;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let nr={},Pt=null,kr=null,Sr=null,Wn=null,rr=null;function ec(){if(Pt&&Pt.isConnected)return Pt;let e=document.getElementById(La);e||(e=document.createElement("div"),e.id=La,document.body.appendChild(e));const t=document.createElement("div");return t.id=Xl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='',e.appendChild(t),Pt=t,t}function tc(e,t){const n=t.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight,a=8,o=document.documentElement.clientWidth,i=document.documentElement.clientHeight;let u=n.bottom+a;u+s>i&&n.top-a-s>=0&&(u=n.top-a-s);let c=n.left+n.width/2-r/2;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(u)}px`,e.style.left=`${Math.round(c)}px`}function nc(e){const t=e.dataset.sfClass,n=t?ta(t,nr):null;if(!n)return;const r=ec();r.querySelector(".rebemer-class-hint__name").textContent=`.${n.name}`;const s=r.querySelector(".rebemer-class-hint__cat");s.textContent=n.category||"",s.hidden=!n.category,r.querySelector(".rebemer-class-hint__desc").textContent=n.description,r.hidden=!1,tc(r,e),rr=e}function Tr(){Pt&&(Pt.hidden=!0),rr=null}function Pa(e){nc(e.currentTarget)}function Ra(){Tr()}function rc(e){e.preventDefault(),e.stopPropagation()}function sc(e){e.key==="Escape"&&Tr()}function Na(e){const t=ta(e.textContent,nr);if(t)return t;const n=e.querySelectorAll("span, [contenteditable], .name, .label, a");for(const r of n){const s=ta(r.textContent,nr);if(s)return s}return null}function ac(e){return e.querySelector('.actions, [class*="action"], [class*="icons"], [class*="controls"]')||e}function oc(){const e=document.createElement("span");return e.className=tr,e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","What does this class do?"),e.addEventListener("mouseenter",Pa),e.addEventListener("mouseleave",Ra),e.addEventListener("focus",Pa),e.addEventListener("blur",Ra),e.addEventListener("click",rc),e}function $o(){for(const t of document.querySelectorAll("."+tr)){const n=t.closest("li"),r=n?Na(n):null;r?t.dataset.sfClass!==r.name&&(t.dataset.sfClass=r.name):(rr===t&&Tr(),t.remove())}const e=document.querySelectorAll(Yo.join(","));for(const t of e)for(const n of t.querySelectorAll("li")){if(n.querySelector("."+tr)||n.querySelector("li"))continue;const r=Na(n);if(!r)continue;const s=oc();s.dataset.sfClass=r.name,ac(n).appendChild(s)}}function ic(){Wn===null&&(Wn=setTimeout(()=>{Wn=null,$o()},Zl))}function lc(e){const t=Yo.join(",");for(const n of e){const r=n.target;if(r&&r.nodeType===1){if(r.classList&&r.classList.contains(tr))continue;if(r.closest&&r.closest(t))return!0}for(const s of n.addedNodes)if(s.nodeType===1&&!(s.classList&&s.classList.contains(tr))&&(s.matches&&s.matches(t)||s.closest&&s.closest(t)||s.querySelector&&s.querySelector(t)))return!0}return!1}function cc(e,t,n={}){if(es(),nr=t&&typeof t=="object"?t:{},!e||Object.keys(nr).length===0)return;kr=new AbortController;const{signal:r}=kr;document.addEventListener("keydown",sc,{passive:!0,signal:r}),window.addEventListener("scroll",Tr,{capture:!0,passive:!0,signal:r}),Sr=new MutationObserver(s=>{rr&&!rr.isConnected&&Tr(),lc(s)&&ic()}),Sr.observe(document.body,{childList:!0,subtree:!0}),$o(),n.signal&&(n.signal.aborted?es():n.signal.addEventListener("abort",es,{once:!0}))}function es(){Wn!==null&&(clearTimeout(Wn),Wn=null),Sr&&(Sr.disconnect(),Sr=null),kr&&(kr.abort(),kr=null);try{document.querySelectorAll("."+tr).forEach(e=>e.remove())}catch{}Pt&&(Pt.remove(),Pt=null),rr=null,nr={}}const ts="li.variable-picker-item",ns="slashed-var-swatch",pr="slashed-sf-color-btn",uc=50,Ba=(e,...t)=>console[e]("[slashed-swatches]",...t);function fc(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;const r=t[n];return typeof r=="string"&&r?r:null}let na=!1,Or={},Bt=null,Er=null,Un=null,rs=null;function dc(e){if(!Bt)return;const t=e.querySelector('[data-control="text"].color-input');if(!t||t.querySelector("."+pr))return;const n=document.createElement("div");n.className=pr,n.setAttribute("data-balloon","SLASHED Colors"),n.setAttribute("data-balloon-pos","top-right"),n.setAttribute("role","button"),n.setAttribute("tabindex","0");const r=document.createElement("span");r.className=pr+"__dot",r.setAttribute("aria-hidden","true"),n.appendChild(r),n.addEventListener("click",c=>{c.stopPropagation(),Bt&&Bt(t)}),n.addEventListener("keydown",c=>{c.key===" "?(c.preventDefault(),n.click()):c.key==="Enter"&&n.click()});const s=t.querySelector(".variable-picker-button");s&&s.nextSibling?t.insertBefore(n,s.nextSibling):t.appendChild(n);const i=((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],u=i?Or[i]??null:null;u&&(r.style.background=u,r.style.removeProperty("box-shadow"),n.classList.add(pr+"--active"))}function hc(e){const t=e.querySelector(":scope > span[title]")||e.querySelector(":scope > span");if(t){const n=t.getAttribute("title");return n&&n.trim()?n.trim():(t.textContent||"").trim()}return(e.textContent||"").trim()}function vc(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+ns);r&&r.remove();return}const t=fc(hc(e),Or);let n=e.querySelector(":scope > ."+ns);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=ns,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 Jo(){try{const e=document.querySelectorAll(ts);for(const t of e)vc(t)}catch(e){Ba("warn","swatch pass failed",e)}if(Bt)try{document.querySelectorAll('[data-control="color"]').forEach(dc)}catch(e){Ba("warn","SF button inject failed",e)}}function _c(){Un===null&&(Un=setTimeout(()=>{Un=null,Jo()},uc))}function pc(e){for(const t of e){const n=t.target;if(n&&n.nodeType===1&&n.closest&&(n.closest(ts)||Bt&&n.closest('[data-control="color"]')))return!0;for(const r of t.addedNodes)if(r.nodeType===1&&(r.matches&&r.matches(ts)||r.querySelector&&r.querySelector(ts)||Bt&&(r.matches&&r.matches('[data-control="color"]')||r.querySelector&&r.querySelector('[data-control="color"]'))))return!0}return!1}function mc(e,t,n={}){ss(),na=!!e,Or=t&&typeof t=="object"?t:{},Bt=typeof n.onOpenPanel=="function"?n.onOpenPanel:null,!(!(na&&Object.keys(Or).length>0)&&!Bt)&&(rs=new AbortController,Er=new MutationObserver(s=>{pc(s)&&_c()}),Er.observe(document.body,{childList:!0,subtree:!0}),Jo(),n.signal&&(n.signal.aborted?ss():n.signal.addEventListener("abort",ss,{once:!0})))}function ss(){Un!==null&&(clearTimeout(Un),Un=null),Er&&(Er.disconnect(),Er=null),rs&&(rs.abort(),rs=null);try{document.querySelectorAll("."+ns).forEach(e=>e.remove()),document.querySelectorAll("."+pr).forEach(e=>e.remove())}catch{}na=!1,Or={},Bt=null}const gc="5";var Ja;typeof window<"u"&&((Ja=window.__svelte??(window.__svelte={})).v??(Ja.v=new Set)).add(gc);var bc=x('reBEM');function yc(e,t){Tn(t,!0);function n(s){s.stopPropagation(),s.preventDefault(),t.onActivate?.(t.elementId)}var r=bc();B(()=>{ie(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),ie(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),se("click",r,n),se("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&n(s)),S(e,r),On()}In(["click","keydown"]);function Rt(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,""):""}const wc=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,kc=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function Fa(e){return e?kc.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:wc.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const Es=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"]);function Sc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)&&t.push(n);return t.sort(),t}const Ec=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function Cc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)||Ec.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const xc=new Set(["add","rename","replace","migrate","mixed"]),Da=new Set(["user","label"]);function Qo(e,t){const n=new Map,r=[];for(const s of e){for(;r.length&&r[r.length-1].depth>=s.depth;)r.pop();const a=s.id===t,o=!a&&s.isBlockRoot===!0;if(a||o){const i=Rt(s.name);i&&s.include!==!1&&(r.push({depth:s.depth,blockName:i}),n.set(s.id,i))}else{const i=r.length?r[r.length-1].blockName:"";i&&n.set(s.id,i)}}return n}function Xo({rootId:e,rows:t,mode:n}){if(!xc.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(c=>c.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};if(!Rt(r.name))return{ok:!1,ops:[],error:"Block name is empty."};const a=[];for(const c of t)!c.isBlockRoot||!c.include||c.id===e||Rt(c.name)||a.push(c.originalLabel||c.id);if(a.length>0)return{ok:!1,ops:[],error:`Block name is empty for: ${a.join(", ")}.`};const o=Qo(t,e),i=[];for(const c of t){if(!c.include)continue;const h=c.id===e,f=!h&&c.isBlockRoot===!0,v=o.get(c.id);if(!v)continue;let _;if(h||f)_=v;else{const b=Rt(c.name);if(!b)continue;_=`${v}__${b}`}i.push({row:c,isRoot:h||f,blockName:v,finalClass:_,modifierSlugs:[],suggestedFrom:c.suggestedFrom||"fallback"})}if(i.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const u=Oc(i);if(!u.ok)return{ok:!1,ops:[],error:u.error};if(n!=="migrate")for(const c of i){const h=Array.isArray(c.row.modifiers)?c.row.modifiers:[];c.modifierSlugs=h.map(f=>Rt(f)).filter(Boolean)}return{ok:!0,ops:i}}function Ac({rootId:e,rows:t,mode:n,syncLabels:r}){const s=Xo({rootId:e,rows:t,mode:n});if(!s.ok)return{ok:!1,error:s.error};const a=s.ops,o=Go();if(n==="migrate"){const c=Tc(a,o);if(!c.ok)return c}const i=new Map;for(const c of a){if(i.has(c.row.id))continue;const h=Qt(c.row.id);if(!h)continue;const f={classIds:qa(h.settings).slice(),label:r?h.label??"":null};if(n==="migrate"&&Array.isArray(c.row.migrateKeys)){const v={};for(const _ of c.row.migrateKeys)Object.prototype.hasOwnProperty.call(h.settings||{},_)&&(v[_]=JSON.parse(JSON.stringify(h.settings[_])));f.migrateKeys=v}i.set(c.row.id,f)}let u=0;try{Jl(()=>{for(const c of a){const h=Qt(c.row.id);if(!h)continue;const f=qa(h.settings),v=c.row.op??"add",_=n==="mixed"?["add","rename","replace"].includes(v)?v:"add":n;let b={};if(_==="rename"&&f.length>0){const A=n==="mixed"&&c.row.renameFamilyId||f[0],T=o.find(M=>M&&M.id===A);T&&T.settings&&(b=JSON.parse(JSON.stringify(T.settings)))}else _==="migrate"&&(b=Zo(h.settings,c.row.migrateKeys));if(_==="migrate"){const A=o.find(T=>T&&T.name===c.finalClass);if(A){(!A.settings||typeof A.settings!="object")&&(A.settings={});for(const[T,M]of Object.entries(b))Object.prototype.hasOwnProperty.call(A.settings,T)||(A.settings[T]=M)}}const O=Ps(c.finalClass,b);let m;switch(_){case"add":case"migrate":m=f.includes(O)?f:[...f,O];break;case"rename":{const A=n==="mixed"&&c.row.renameFamilyId||(f[0]??null),T=[O],M=A?o.find(F=>F&&F.id===A):null;if(M){const F=M.name+"--";for(const Z of f){if(Z===A)continue;const ae=o.find(re=>re&&re.id===Z);if(ae)if(ae.name.startsWith(F)){const re=ae.name.slice(M.name.length),xe=ae.settings?JSON.parse(JSON.stringify(ae.settings)):{};T.push(Ps(c.finalClass+re,xe))}else T.push(Z)}}m=T;break}case"replace":if(n==="mixed"&&c.row.renameFamilyId){const A=o.find(T=>T&&T.id===c.row.renameFamilyId);if(A){const T=A.name+"--",M=f.filter(F=>{if(F===c.row.renameFamilyId)return!1;const Z=o.find(ae=>ae&&ae.id===F);return!Z||!Z.name.startsWith(T)});m=[O,...M]}else m=[O]}else m=[O];break}for(const A of c.modifierSlugs){const T=`${c.finalClass}--${A}`,M=Ps(T,{});m.includes(M)||m.push(M)}if(Ia(c.row.id,m),_==="migrate"&&Ic(h.settings,c.row.migrateKeys),r){const A=Mc(c.finalClass,c.blockName);A&&Ma(c.row.id,A)}u++}})}catch(c){for(const[f,v]of i)try{if(Ia(f,v.classIds),v.migrateKeys){const _=Qt(f);_&&_.settings&&Object.assign(_.settings,v.migrateKeys)}v.label!==null&&Ma(f,v.label)}catch{}const h=c instanceof Error?c.message:String(c);return console.warn("[reBEMer] apply failed after",u,"mutation(s), rolled back:",h),{ok:!1,error:`Operation failed and was rolled back: ${h}`}}return u===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:u}}function Tc(e,t){for(const n of e){const r=t.find(u=>u&&u.name===n.finalClass);if(!r)continue;const s=Qt(n.row.id);if(!s)continue;const a=Zo(s.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},i=[];for(const[u,c]of Object.entries(a))Object.prototype.hasOwnProperty.call(o,u)&&JSON.stringify(o[u])!==JSON.stringify(c)&&i.push(u.replace(/^_/,""));if(i.length>0){const u=i.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${u}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Oc(e){const t=new Map;for(const r of e){const s=t.get(r.finalClass)||[];s.push(r),t.set(r.finalClass,s)}for(const[r,s]of t){if(s.length===1)continue;const a=s.filter(i=>Da.has(i.suggestedFrom));if(a.length>1)return{ok:!1,error:`"${r}" is used by ${a.length} rows. Edit one to make it unique.`};let o=1;for(const i of s)Da.has(i.suggestedFrom)||(i.finalClass=`${r}-${o++}`,i.suggestedFrom="auto-number")}const n=new Map;for(const r of e){const s=n.get(r.finalClass);if(s)return{ok:!1,error:`"${r.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${r.suggestedFrom}). Pick a different name for one of them.`};n.set(r.finalClass,r.suggestedFrom)}return{ok:!0}}function Zo(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)Es.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Ic(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)Es.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function qa(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function Mc(e,t){let n=e;return n===t?ja(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),ja(n.replace(/-/g," ")))}function ja(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const Lc=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),ei=new Set(["section","container","block","div"]);function Pc(e,t="item"){return!e||typeof e!="string"||ei.has(e)?t:Lc[e]||t}function Rs(e){return typeof e=="string"&&ei.has(e)}const Rc=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function Nc(e,t,n){const r=new Set(e.filter(Boolean)),s=(..._)=>_.some(b=>r.has(b)),a=s("button","button-group"),o=s("heading"),i=s("text-basic","text"),u=s("image"),c=s("nav-nested","nav-menu"),h=s("form"),f=s("icon","icon-box"),v=s("list");return h?"form":c?"nav":a&&!o&&!i?"actions":u&&!i&&!o&&!a?"media":o&&!i&&!a?"header":i&&!o&&!a?"body":o&&i?"content":o&&a?"header":f&&!i&&!o?"icon-group":v?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var Bc=x(''),Fc=x('BLOCK'),Dc=x('suggested'),qc=x(''),jc=x(''),Hc=x('
'),Wc=x(''),Uc=x('
'),Kc=x('
No existing classes — a new class will be added instead.
'),zc=x(""),Vc=x('
Family
'),Gc=x('
Will rename
'),Yc=x(""),$c=x('
Family
'),Jc=x('
Will remove the selected family and replace with the new class (empty settings). Other classes kept.
'),Qc=x('
No existing classes — a new class will be created.
'),Xc=x('
All existing classes will be removed from this element.
'),Zc=x(" ",1),eu=x('
',1),tu=x('
This element has no existing classes. Rename will create a new class instead.
'),nu=x('
'),ru=x(`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),ou=S(`A class named already exists
+ values block the migration — pick a different name or use Add.`,1),su=x(`A class named already exists
globally. Apply will attach the existing class instead of
- creating a duplicate.`,1),lu=S(''),cu=S(''),uu=S('Migrate: ',1),fu=S('No migratable keys on this element.'),du=S(''),_u=S('
'),vu=S('
');function hu(e,t){Rn(t,!0);let n=Kt(t,"row",15),r=Kt(t,"rootId",3,""),s=Kt(t,"globalClasses",19,()=>[]),i=Kt(t,"finalClassNames",19,()=>[]);const o=D(()=>t.mode!=="migrate"),l=D(()=>t.mode==="migrate"),c=D(()=>t.mode==="rename"),u=D(()=>t.mode==="mixed"),d=D(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),f=D(()=>{if(!a(u)||!Array.isArray(n().currentClassIds))return[];const g=[];for(const C of n().currentClassIds){const I=s().find(p=>p?.id===C);if(!I||I.name.includes("--"))continue;const ee=n().currentClassIds.filter(p=>s().find(T=>T?.id===p)?.name.startsWith(I.name+"--")).length;g.push({id:I.id,name:I.name,modCount:ee})}for(const C of n().currentClassIds){const I=s().find(p=>p?.id===C);if(!I||!I.name.includes("--"))continue;const ee=I.name.slice(0,I.name.indexOf("--"));g.some(p=>p.name===ee)||g.push({id:I.id,name:I.name,modCount:0})}return g});Es(()=>{!a(u)||n().op!=="rename"||!a(f).length||a(f).some(g=>g.id===n().renameFamilyId)||n(n().renameFamilyId=a(f)[0].id,!0)});const v=D(()=>n().isBlockRoot===!0&&n().id!==r()),h=D(()=>n().id!==r()),b=D(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),O=D(()=>{if(!i().length||!n().include||!Array.isArray(s()))return null;for(const g of i()){const C=s().find(I=>I&&I.name===g);if(C)return C}return null}),m=D(()=>!Array.isArray(n().modifiers)||n().modifiers.every(g=>!zt(g)));function A(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function x(g){return g.startsWith("_")?g.slice(1):g}var R=vu();let W;var re=y(R),he=y(re),ue=w(re,2),le=y(ue),je=y(le),fe=w(le,2);{var He=g=>{var C=qc();let I;var ee=y(C);P(p=>{I=Ve(C,1,"rebemer-row__type rebemer-row__type--toggle",null,I,{"rebemer-row__type--block":a(v)}),ae(C,"title",a(v)?"Sub-block root — click to revert to element":"Click to promote to block root"),C.disabled=!n().include,F(ee,p)},[()=>a(v)?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),te("click",C,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),k(g,C)},St=g=>{var C=jc();k(g,C)};q(fe,g=>{a(h)?g(He):g(St,-1)})}var Qt=w(fe,2);{var Xt=g=>{var C=Hc();P(()=>ae(C,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),k(g,C)};q(Qt,g=>{a(b)&&n().include&&g(Xt)})}var Zt=w(ue,2),en=y(Zt),nt=y(en);{var Fn=g=>{var C=Wc(),I=y(C);P(()=>F(I,a(d))),k(g,C)};q(nt,g=>{a(d)&&g(Fn)})}var Et=w(nt,2),Dn=w(en,2);{var qn=g=>{var C=zc(),I=y(C);me(I,17,()=>n().modifiers,Vr,(E,T,M)=>{var B=Kc(),oe=y(B),de=w(oe,2);{var _e=L=>{var V=Uc();P(()=>V.disabled=!n().include),te("click",V,()=>{n(n().modifiers=n().modifiers.filter((Le,Ce)=>Ce!==M),!0)}),k(L,V)};q(de,L=>{n().modifiers.length>1&&L(_e)})}P(()=>oe.disabled=!n().include),sa(oe,()=>n().modifiers[M],L=>n(n().modifiers[M]=L,!0)),k(E,B)});var ee=w(I,2);{var p=E=>{var T=$c();P(()=>T.disabled=!n().include),te("click",T,()=>{n(n().modifiers=[...n().modifiers,""],!0)}),k(E,T)};q(ee,E=>{a(m)||E(p)})}k(g,C)};q(Dn,g=>{a(o)&&g(qn)})}var fn=w(Zt,2);{var dn=g=>{var C=ru(),I=xe(C),ee=y(I);let p;var E=w(ee,2);let T;var M=w(E,2);let B;var oe=w(I,2);{var de=L=>{var V=Ui(),Le=xe(V);{var Ce=ce=>{var ve=Vc();k(ce,ve)},Je=ce=>{var ve=Yc(),G=w(y(ve),2);me(G,21,()=>a(f),Vr,(Q,pe)=>{var we=Gc(),vt=y(we),We={};P(()=>{F(vt,`${a(pe).name??""}${a(pe).modCount>0?` (+ ${a(pe).modCount} modifier${a(pe).modCount>1?"s":""})`:""}`),We!==(We=a(pe).id)&&(we.value=(we.__value=a(pe).id)??"")}),k(Q,we)}),ra(G,()=>n().renameFamilyId,Q=>n(n().renameFamilyId=Q,!0)),k(ce,ve)},ye=ce=>{const ve=D(()=>a(f)[0]),G=D(()=>1+a(ve).modCount);var Q=Jc(),pe=w(y(Q)),we=y(pe),vt=w(pe);P(()=>{F(we,a(ve).name),F(vt,`${a(ve).modCount>0?` (+ ${a(ve).modCount} modifier${a(ve).modCount>1?"s":""})`:""}${(n().currentClassIds?.length??0)>a(G)?" Other classes kept.":""}`)}),k(ce,Q)};q(Le,ce=>{a(f).length===0?ce(Ce):a(f).length>1?ce(Je,1):ce(ye,-1)})}k(L,V)},_e=L=>{var V=nu(),Le=xe(V);{var Ce=G=>{var Q=Xc(),pe=w(y(Q),2),we=y(pe);we.value=we.__value="";var vt=w(we);me(vt,17,()=>a(f),Vr,(We,rt)=>{var Ct=Qc(),Be=y(Ct),Fe={};P(()=>{F(Be,`${a(rt).name??""}${a(rt).modCount>0?` (+ ${a(rt).modCount} modifier${a(rt).modCount>1?"s":""})`:""}`),Fe!==(Fe=a(rt).id)&&(Ct.value=(Ct.__value=a(rt).id)??"")}),k(We,Ct)}),ra(pe,()=>n().renameFamilyId,We=>n(n().renameFamilyId=We,!0)),k(G,Q)};q(Le,G=>{a(f).length>1&&G(Ce)})}var Je=w(Le,2);{var ye=G=>{var Q=Zc();k(G,Q)},ce=G=>{var Q=eu();k(G,Q)},ve=G=>{var Q=tu();k(G,Q)};q(Je,G=>{n().renameFamilyId?G(ye):a(f).length===0?G(ce,1):G(ve,-1)})}k(L,V)};q(oe,L=>{n().op==="rename"?L(de):n().op==="replace"&&L(_e,1)})}P(()=>{p=Ve(ee,1,"rebemer-row__op-btn",null,p,{"rebemer-row__op-btn--on":n().op==="add"}),ae(ee,"aria-pressed",n().op==="add"),T=Ve(E,1,"rebemer-row__op-btn",null,T,{"rebemer-row__op-btn--on":n().op==="rename"}),ae(E,"aria-pressed",n().op==="rename"),B=Ve(M,1,"rebemer-row__op-btn",null,B,{"rebemer-row__op-btn--on":n().op==="replace"}),ae(M,"aria-pressed",n().op==="replace")}),te("click",ee,()=>{n(n().op="add",!0)}),te("click",E,()=>{n(n().op="rename",!0),!n().renameFamilyId&&a(f).length&&n(n().renameFamilyId=a(f)[0].id,!0)}),te("click",M,()=>{n(n().op="replace",!0),n(n().renameFamilyId="",!0)}),k(g,C)};q(fn,g=>{a(u)&&n().include&&g(dn)})}var _n=w(fn,2);{var jn=g=>{var C=su();k(g,C)},vr=g=>{var C=au(),I=y(C);P(()=>F(I,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),k(g,C)};q(_n,g=>{a(c)&&n().include&&n().currentClassCount===0?g(jn):a(c)&&n().include&&n().currentClassCount>1&&g(vr,1)})}var Hn=w(_n,2);{var hr=g=>{var C=lu(),I=y(C);{var ee=E=>{var T=iu(),M=w(xe(T)),B=y(M);P(()=>F(B,a(O).name)),k(E,T)},p=E=>{var T=ou(),M=w(xe(T)),B=y(M);P(()=>F(B,a(O).name)),k(E,T)};q(I,E=>{a(l)?E(ee):E(p,-1)})}k(g,C)};q(Hn,g=>{a(O)&&g(hr)})}var N=w(Hn,2);{var z=g=>{var C=_u(),I=y(C);{var ee=M=>{var B=uu(),oe=w(xe(B),2);me(oe,17,()=>n().migrateKeys,Vr,(de,_e)=>{var L=cu(),V=y(L);P(Le=>{ae(L,"title",`Will be lifted into ${(i()[0]||"the new class")??""}`),F(V,Le)},[()=>x(a(_e))]),k(de,L)}),k(M,B)},p=M=>{var B=fu();k(M,B)};q(I,M=>{n().migrateKeys?.length?M(ee):M(p,-1)})}var E=w(I,2);{var T=M=>{var B=du(),oe=y(B);P(()=>F(oe,`${n().skippedKeys.length??""} skipped`)),k(M,B)};q(E,M=>{n().skippedKeys?.length&&M(T)})}k(g,C)};q(N,g=>{a(l)&&n().include&&g(z)})}P(()=>{W=Ve(R,1,"rebemer-row",null,W,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":a(b)}),Ke(R,`--rebemer-row-depth: ${n().depth??0??""}`),F(je,n().originalLabel),ae(Et,"placeholder",t.isRoot?"block-name":"element-name"),Et.disabled=!n().include}),$i(he,()=>n().include,g=>n(n().include=g,!0)),te("input",Et,A),sa(Et,()=>n().name,g=>n(n().name=g,!0)),k(e,R),Nn()}Bn(["click","input"]);var pu=S("");function ro(e,t){Rn(t,!0);let n=Kt(t,"kind",3,"info"),r=Kt(t,"duration",3,3e3),s=Ee(!0);Es(()=>{if(!a(s)||r()<=0)return;const u=setTimeout(()=>{ne(s,!1),t.onDismiss?.()},r());return()=>clearTimeout(u)});const i=D(()=>n()==="error"?"alert":"status");var o=Ui(),l=xe(o);{var c=u=>{var d=pu(),f=y(d);P(()=>{Ve(d,1,`rebemer-toast rebemer-toast--${n()??""}`),ae(d,"role",a(i)),ae(d,"aria-live",n()==="error"?"assertive":"polite"),F(f,t.message)}),te("click",d,()=>{ne(s,!1),t.onDismiss?.()}),k(u,d)};q(l,u=>{a(s)&&u(c)})}k(e,o),Nn()}Bn(["click"]);var mu=S("Will migrate ",1),gu=S(''),bu=S(''),yu=S('
reBEMer ·
',1);function wu(e,t){Rn(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",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 (strips all existing classes, or just a selected family)."};function r(N){const z=N?._cssGlobalClasses;return z?(Array.isArray(z)?z:Object.values(z)).filter(C=>typeof C=="string"&&C.length>0):[]}function s(N,z){const g=r(N);for(const C of g){const I=z.find(ee=>ee&&ee.id===C);if(I&&!I.name.includes("--"))return C}return g[0]??""}let i=Ee("add"),o=Ee(!0),l=Ee(Ut([])),c=Ee(Ut([])),u=Ee(null),d=Ee(null);const f=D(()=>a(l)[0]?.originalLabel??""),v=D(()=>a(l).length===0?new Map:Zi(a(l),t.rootId)),h=D(()=>{if(a(i)!=="migrate")return null;let N=0,z=0;for(const g of a(l))g.include&&(N+=g.migrateKeys?.length??0,z+=g.skippedKeys?.length??0);return{willMigrate:N,willSkip:z}}),b=D(()=>{if(a(l).length===0)return new Map;const N=eo({rootId:t.rootId,rows:a(l),mode:a(i)}),z=new Map;if(!N.ok)return z;for(const g of N.ops){const C=[g.finalClass];for(const I of g.modifierSlugs??[])C.push(`${g.finalClass}--${I}`);z.set(g.row.id,C)}return z});zi(()=>{const N=ec(t.rootId);ne(c,Yi().slice(),!0);const z=N.map((g,C)=>{const I=C===0,ee=g.label||"",p=zt(ee),E=g.name||"";let T,M;p?(T=p,M="label"):I?(T="block",M="fallback"):E&&!qs(E)?(T=Bc(E,"item"),M="element-type"):(T="item",M="fallback");const B=r(g.settings);return{id:g.id,depth:g.depth,bricksType:E,originalLabel:ee||(I?"block":"element"),name:T,modifiers:[""],isBlockRoot:!1,include:!0,suggestedFrom:M,migrateKeys:xc(g.settings),skippedKeys:Tc(g.settings),currentClassCount:B.length,currentClassIds:B,op:"add",renameFamilyId:s(g.settings,a(c))}});if(z.length>1){const g=new Map(N.map(p=>[p.id,[]])),C=[];for(const p of N){for(;C.length&&C[C.length-1].depth>=p.depth;)C.pop();C.length&&g.get(C[C.length-1].id).push(p.id),C.push(p)}const I=new Map(N.map(p=>[p.id,p])),ee=new Map(z.map(p=>[p.id,p]));for(const[,p]of g){if(!p.length)continue;const E=new Map;for(const M of p){const B=I.get(M)?.name;B&&E.set(B,(E.get(B)??0)+1)}const T=p.filter(M=>qs(I.get(M)?.name??""));for(const M of p){const B=ee.get(M),oe=I.get(M);if(!(!B||!oe||B.suggestedFrom==="label")){if(qs(oe.name)){const de=(g.get(M)??[]).map(L=>I.get(L)?.name??"").filter(Boolean),_e=T.indexOf(M);B.name=Dc(de,_e,T.length),B.suggestedFrom="element-type"}else if((E.get(oe.name)??0)===1){const de=Fc[oe.name];de&&(B.name=de,B.suggestedFrom="element-type")}}}}}ne(l,z,!0)});function O(N){if(N.key==="Escape"){t.onClose?.();return}a(d)&&N.target instanceof Node&&a(d).contains(N.target)&&N.key==="Enter"&&(N.target?.tagName==="INPUT"||N.target?.tagName==="SELECT")&&(N.preventDefault(),A())}let m=null;function A(){const N=zt(a(l)[0]?.name??""),z=Ha(N);if(!z.ok){ne(u,{kind:"error",message:z.reason},!0);return}for(const C of a(l)){if(!C.isBlockRoot||!C.include)continue;const I=Ha(zt(C.name??""));if(!I.ok){ne(u,{kind:"error",message:`Sub-block "${C.originalLabel}": ${I.reason}`},!0);return}}const g=Ic({rootId:t.rootId,rows:a(l),mode:a(i),syncLabels:a(o)});g.ok?(ne(u,{kind:"success",message:`Applied to ${g.count} element${g.count!==1?"s":""}.`},!0),m&&clearTimeout(m),m=setTimeout(()=>t.onClose?.(),800)):ne(u,{kind:"error",message:g.error},!0)}Es(()=>()=>{m&&clearTimeout(m)});var x=yu();Wi("keydown",_s,O);var R=xe(x),W=y(R),re=y(W),he=w(y(re)),ue=y(he),le=w(re,2),je=w(W,2),fe=y(je),He=w(y(fe),2),St=y(He);St.value=St.__value="add";var Qt=w(St);Qt.value=Qt.__value="rename";var Xt=w(Qt);Xt.value=Xt.__value="replace";var Zt=w(Xt);Zt.value=Zt.__value="migrate";var en=w(Zt);en.value=en.__value="mixed";var nt=w(fe,2),Fn=y(nt),Et=w(je,2),Dn=y(Et),qn=w(Et,2);{var fn=N=>{var z=bu();let g;var C=y(z);{var I=T=>{var M=Nl("No migratable style keys found on any included element. Apply will attach empty classes.");k(T,M)},ee=T=>{var M=mu(),B=w(xe(M)),oe=y(B),de=w(B);P(()=>{F(oe,a(h).willMigrate),F(de,` style key${a(h).willMigrate===1?"":"s"} into new classes.`)}),k(T,M)};q(C,T=>{a(h).willMigrate===0?T(I):T(ee,-1)})}var p=w(C,2);{var E=T=>{var M=gu(),B=y(M);P(()=>F(B,`${a(h).willSkip??""} key${a(h).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),k(T,M)};q(p,T=>{a(h).willSkip>0&&T(E)})}P(()=>g=Ve(z,1,"rebemer-panel__notice",null,g,{"rebemer-panel__notice--warn":a(h).willSkip>0||a(h).willMigrate===0})),k(N,z)};q(qn,N=>{a(h)&&N(fn)})}var dn=w(qn,2);me(dn,23,()=>a(l),N=>N.id,(N,z,g)=>{{let C=D(()=>a(v).get(a(z).id)??""),I=D(()=>a(z).id===t.rootId||a(z).isBlockRoot),ee=D(()=>a(b).get(a(z).id)??[]);hu(N,{get mode(){return a(i)},get blockName(){return a(C)},get isRoot(){return a(I)},get rootId(){return t.rootId},get globalClasses(){return a(c)},get finalClassNames(){return a(ee)},get row(){return a(l)[a(g)]},set row(p){a(l)[a(g)]=p}})}});var _n=w(dn,2),jn=y(_n),vr=w(jn,2);Gl(R,N=>ne(d,N),()=>a(d));var Hn=w(R,2);{var hr=N=>{ro(N,{get kind(){return a(u).kind},get message(){return a(u).message},onDismiss:()=>{ne(u,null)}})};q(Hn,N=>{a(u)&&N(hr)})}P(()=>{F(ue,a(f)),F(Dn,n[a(i)])}),te("click",le,()=>t.onClose?.()),ra(He,()=>a(i),N=>ne(i,N)),$i(Fn,()=>a(o),N=>ne(o,N)),te("click",jn,()=>t.onClose?.()),te("click",vr,A),k(e,x),Nn()}Bn(["click"]);var ku=S('');function Su(e,t){var n=ku();let r;P(()=>{r=Ve(n,1,"slashed-cp-launch",null,r,{"slashed-cp-launch--on":t.open}),ae(n,"aria-pressed",t.open)}),te("click",n,function(...s){t.onToggle?.apply(this,s)}),k(e,n)}Bn(["click"]);const $a="--sf-color-",so=["primary","secondary","tertiary","action","neutral","base"],ao=["success","warning","error","info","danger"],za=["a5","a10","a20","a30","a40","a50","a60","a70","a80","a90","a95"],Va=["superlight","xlight","lighter","darker","xdark","superdark","hover","active","strong","subtle","muted","ghost"],Gr=["text","heading","bg","surface","inset","raised","overlay","inverse","border","link","code","selection","mark","dim"],Eu=e=>new Set(e),Cu=Eu([...so,...ao]),Ga={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."}},js=[{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 xu(e){if(typeof e!="string"||e.indexOf($a)!==0)return null;const t=e.slice($a.length);if(!t||t==="scheme")return null;const n=t.indexOf("-"),r=n===-1?t:t.slice(0,n);if(!Cu.has(r))return{family:"semantic",kind:"semantic",step:null,key:t};const s=n===-1?"":t.slice(n+1);return s===""?{family:r,kind:"base",step:null,key:t}:s==="light"?null:/^[0-9]+$/.test(s)?{family:r,kind:"scale",step:Number(s),key:t}:/^a[0-9]+$/.test(s)?{family:r,kind:"alpha",step:s,key:t}:{family:r,kind:"alias",step:s,key:t}}function Au(e){return e.kind==="alpha"?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function Tu(e){switch(e.kind){case"base":return ps(e.family);case"scale":return String(e.step);case"alpha":return String(e.step).toUpperCase();case"alias":return ps(String(e.step));case"semantic":default:return Ou(e.key)}}function ps(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Ou(e){return e.split("--").map(n=>n.split("-").map(ps).join(" ")).join(" · ")}function Iu(e,t,n,r){const s=n[e];if(typeof s!="string"||!s)return null;const i=typeof r[e]=="string"&&r[e]?r[e]:s;return{var:e,name:e.slice(2),label:Tu(t),light:s,dark:i,alpha:Au(t)}}function Mu(e,t){const 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 za.indexOf(e.info.step)-za.indexOf(t.info.step);if(e.info.kind==="alias"){const r=Va.indexOf(e.info.step),s=Va.indexOf(t.info.step),i=r===-1?999:r,o=s===-1?999:s;return i!==o?i-o:String(e.info.step).localeCompare(String(t.info.step))}return 0}function Lu(e,t){const n=Gr.findIndex(o=>e.info.key===o||e.info.key.startsWith(o+"-")),r=Gr.findIndex(o=>t.info.key===o||t.info.key.startsWith(o+"-")),s=n===-1?Gr.length:n,i=r===-1?Gr.length:r;return s!==i?s-i:e.info.key.localeCompare(t.info.key)}function Pu(e,t,n){const r=Array.isArray(e)?e:[],s=t&&typeof t=="object"?t:{},i=n&&typeof n=="object"?n:{},o=new Map,l=[];for(const d of r){const f=xu(d);if(!f)continue;const v=Iu(d,f,s,i);if(!v)continue;const h={swatch:v,info:f};if(f.family==="semantic"){l.push(h);continue}o.has(f.family)||o.set(f.family,[]),o.get(f.family).push(h)}const c=[],u=(d,f)=>{const v=o.get(d);if(!v||v.length===0)return;v.sort(Mu);const h=v.filter(x=>x.info.kind==="base"||x.info.kind==="scale"),b=v.filter(x=>x.info.kind==="alias"),O=v.filter(x=>x.info.kind==="alpha"),m=[];h.length&&m.push({id:"scale",label:"Shades & tints",swatches:h.map(x=>x.swatch)}),O.length&&m.push({id:"alpha",label:"Transparent",swatches:O.map(x=>x.swatch)}),b.length&&m.push({id:"alias",label:"Semantic",swatches:b.map(x=>x.swatch)});const A=Ga[d]||{};c.push({id:d,label:ps(d),type:f,count:v.length,tagline:A.tagline||"",use:A.use||"",sections:m})};for(const d of so)u(d,"brand");for(const d of ao)u(d,"status");if(l.length){l.sort(Lu);const d=new Map(js.map(b=>[b.id,[]])),f=[];for(const b of l){const O=js.find(m=>m.match(b.info.key));O?d.get(O.id).push(b.swatch):f.push(b.swatch)}const v=[];for(const b of js){const O=d.get(b.id);O.length&&v.push({id:b.id,label:b.label,swatches:O})}f.length&&v.push({id:"other",label:"Other",swatches:f});const h=Ga.semantic||{};c.push({id:"semantic",label:"Semantic",type:"semantic",count:l.length,tagline:h.tagline||"",use:h.use||"",sections:v})}return{groups:c}}function Ru(e,t){const n=String(t||"").trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};const r=[];for(const s of e.groups){const i=[];for(const o of s.sections){const l=o.swatches.filter(c=>c.name.toLowerCase().includes(n)||c.label.toLowerCase().includes(n)||s.label.toLowerCase().includes(n));l.length&&i.push({...o,swatches:l})}if(i.length){const o=i.reduce((l,c)=>l+c.swatches.length,0);r.push({...s,sections:i,count:o})}}return{groups:r}}function Nu(e){return`var(${e.var})`}function Bu(e,t){return t==="dark"?e.dark:e.light}const Fu=[{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 Du(e,t,n){const r=t&&typeof t=="object"?t:{},s=n&&typeof n=="object"?n:{},i=[];for(const o of Fu){const l=[];for(const c of o.tokens){const u=r[c.var];if(!u)continue;const d=s[c.var]||u;l.push({var:c.var,name:c.var.slice(2),label:c.label,light:u,dark:d,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(c.var)})}l.length&&i.push({id:o.id,label:o.label,swatches:l})}return{groups:i}}var qu=S('');function Yr(e,t){Rn(t,!0);let n=Kt(t,"onPick",3,void 0);const r=D(()=>`${t.swatch.name}
-light ${t.swatch.light} · dark ${t.swatch.dark}`);var s=qu();let i;P(o=>{i=Ve(s,1,"slashed-cp-swatch",null,i,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode==="both"}),Ke(s,`--cp-l:${t.swatch.light??""}; --cp-d:${t.swatch.dark??""}; --cp-solid:${o??""};`),ae(s,"title",a(r)),ae(s,"aria-label",t.swatch.name)},[()=>Bu(t.swatch,t.mode==="dark"?"dark":"light")]),te("click",s,()=>n()?.(t.swatch)),k(e,s),Nn()}Bn(["click"]);var ju=S(''),Hu=S('
');function du(e,t){Tn(t,!0);let n=Yt(t,"row",15),r=Yt(t,"rootId",3,""),s=Yt(t,"globalClasses",19,()=>[]),a=Yt(t,"finalClassNames",19,()=>[]);const o=U(()=>t.mode!=="migrate"),i=U(()=>t.mode==="migrate"),u=U(()=>t.mode==="rename"),c=U(()=>t.mode==="mixed"),h=U(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),f=U(()=>{if(!l(c)||!Array.isArray(n().currentClassIds))return[];const g=[];for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||I.name.includes("--"))continue;const Q=n().currentClassIds.filter(R=>s().find(y=>y?.id===R)?.name.startsWith(I.name+"--")).length;g.push({id:I.id,name:I.name,modCount:Q})}for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||!I.name.includes("--"))continue;const Q=I.name.slice(0,I.name.indexOf("--"));g.some(R=>R.name===Q)||g.push({id:I.id,name:I.name,modCount:0})}return g});ws(()=>{!l(c)||n().op!=="rename"||!l(f).length||l(f).some(g=>g.id===n().renameFamilyId)||n(n().renameFamilyId=l(f)[0].id,!0)});const v=U(()=>n().isBlockRoot===!0&&n().id!==r()),_=U(()=>n().id!==r()),b=U(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),O=U(()=>{if(!a().length||!n().include||!Array.isArray(s()))return null;for(const g of a()){const E=s().find(I=>I&&I.name===g);if(E)return E}return null}),m=U(()=>!Array.isArray(n().modifiers)||n().modifiers.every(g=>!Rt(g)));function A(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function T(g){return g.startsWith("_")?g.slice(1):g}var M=fu();let F;var Z=w(M),ae=w(Z),re=k(Z,2),xe=w(re),pe=w(xe),oe=k(xe,2);{var qt=g=>{var E=Bc();let I;var Q=w(E);B(R=>{I=Ke(E,1,"rebemer-row__type rebemer-row__type--toggle",null,I,{"rebemer-row__type--block":l(v)}),ie(E,"title",l(v)?"Sub-block root — click to revert to element":"Click to promote to block root"),E.disabled=!n().include,H(Q,R)},[()=>l(v)?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),se("click",E,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),S(g,E)},De=g=>{var E=Fc();S(g,E)};W(oe,g=>{l(_)?g(qt):g(De,-1)})}var Zt=k(oe,2);{var en=g=>{var E=Dc();B(()=>ie(E,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),S(g,E)};W(Zt,g=>{l(b)&&n().include&&g(en)})}var jt=k(re,2),tn=w(jt),nn=w(tn);{var rt=g=>{var E=qc(),I=w(E);B(()=>H(I,l(h))),S(g,E)};W(nn,g=>{l(h)&&g(rt)})}var ft=k(nn,2),Mn=k(tn,2);{var rn=g=>{var E=Uc(),I=w(E);ke(I,17,()=>n().modifiers,zr,(p,y,C)=>{var L=Hc(),j=w(L),$=k(j,2);{var ce=G=>{var he=jc();B(()=>he.disabled=!n().include),se("click",he,()=>{n(n().modifiers=n().modifiers.filter((ye,Ie)=>Ie!==C),!0)}),S(G,he)};W($,G=>{n().modifiers.length>1&&G(ce)})}B(()=>j.disabled=!n().include),ea(j,()=>n().modifiers[C],G=>n(n().modifiers[C]=G,!0)),S(p,L)});var Q=k(I,2);{var R=p=>{var y=Wc();B(()=>y.disabled=!n().include),se("click",y,()=>{n(n().modifiers=[...n().modifiers,""],!0)}),S(p,y)};W(Q,p=>{l(m)||p(R)})}S(g,E)};W(Mn,g=>{l(o)&&g(rn)})}var Ln=k(jt,2);{var sn=g=>{var E=eu(),I=Se(E),Q=w(I);let R;var p=k(Q,2);let y;var C=k(p,2);let L;var j=k(I,2);{var $=G=>{var he=Ho(),ye=Se(he);{var Ie=ve=>{var le=Kc();S(ve,le)},st=ve=>{var le=Vc(),te=k(w(le),2);ke(te,21,()=>l(f),zr,(ee,ne)=>{var me=zc(),ze=w(me),dt={};B(()=>{H(ze,`${l(ne).name??""}${l(ne).modCount>0?` (+ ${l(ne).modCount} modifier${l(ne).modCount>1?"s":""})`:""}`),dt!==(dt=l(ne).id)&&(me.value=(me.__value=l(ne).id)??"")}),S(ee,me)}),Zs(te,()=>n().renameFamilyId,ee=>n(n().renameFamilyId=ee,!0)),S(ve,le)},kt=ve=>{const le=U(()=>l(f)[0]),te=U(()=>1+l(le).modCount);var ee=Gc(),ne=k(w(ee)),me=w(ne),ze=k(ne);B(()=>{H(me,l(le).name),H(ze,`${l(le).modCount>0?` (+ ${l(le).modCount} modifier${l(le).modCount>1?"s":""})`:""}${(n().currentClassIds?.length??0)>l(te)?" Other classes kept.":""}`)}),S(ve,ee)};W(ye,ve=>{l(f).length===0?ve(Ie):l(f).length>1?ve(st,1):ve(kt,-1)})}S(G,he)},ce=G=>{var he=Zc(),ye=Se(he);{var Ie=te=>{var ee=$c(),ne=k(w(ee),2),me=w(ne);me.value=me.__value="";var ze=k(me);ke(ze,17,()=>l(f),zr,(dt,ht)=>{var we=Yc(),Me=w(we),_e={};B(()=>{H(Me,`${l(ht).name??""}${l(ht).modCount>0?` (+ ${l(ht).modCount} modifier${l(ht).modCount>1?"s":""})`:""}`),_e!==(_e=l(ht).id)&&(we.value=(we.__value=l(ht).id)??"")}),S(dt,we)}),Zs(ne,()=>n().renameFamilyId,dt=>n(n().renameFamilyId=dt,!0)),S(te,ee)};W(ye,te=>{l(f).length>1&&te(Ie)})}var st=k(ye,2);{var kt=te=>{var ee=Jc();S(te,ee)},ve=te=>{var ee=Qc();S(te,ee)},le=te=>{var ee=Xc();S(te,ee)};W(st,te=>{n().renameFamilyId?te(kt):l(f).length===0?te(ve,1):te(le,-1)})}S(G,he)};W(j,G=>{n().op==="rename"?G($):n().op==="replace"&&G(ce,1)})}B(()=>{R=Ke(Q,1,"rebemer-row__op-btn",null,R,{"rebemer-row__op-btn--on":n().op==="add"}),ie(Q,"aria-pressed",n().op==="add"),y=Ke(p,1,"rebemer-row__op-btn",null,y,{"rebemer-row__op-btn--on":n().op==="rename"}),ie(p,"aria-pressed",n().op==="rename"),L=Ke(C,1,"rebemer-row__op-btn",null,L,{"rebemer-row__op-btn--on":n().op==="replace"}),ie(C,"aria-pressed",n().op==="replace")}),se("click",Q,()=>{n(n().op="add",!0)}),se("click",p,()=>{n(n().op="rename",!0),!n().renameFamilyId&&l(f).length&&n(n().renameFamilyId=l(f)[0].id,!0)}),se("click",C,()=>{n(n().op="replace",!0),n(n().renameFamilyId="",!0)}),S(g,E)};W(Ln,g=>{l(c)&&n().include&&g(sn)})}var an=k(Ln,2);{var on=g=>{var E=tu();S(g,E)},lr=g=>{var E=nu(),I=w(E);B(()=>H(I,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),S(g,E)};W(an,g=>{l(u)&&n().include&&n().currentClassCount===0?g(on):l(u)&&n().include&&n().currentClassCount>1&&g(lr,1)})}var Pn=k(an,2);{var cr=g=>{var E=au(),I=w(E);{var Q=p=>{var y=ru(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(p,y)},R=p=>{var y=su(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(p,y)};W(I,p=>{l(i)?p(Q):p(R,-1)})}S(g,E)};W(Pn,g=>{l(O)&&g(cr)})}var P=k(Pn,2);{var V=g=>{var E=uu(),I=w(E);{var Q=C=>{var L=iu(),j=k(Se(L),2);ke(j,17,()=>n().migrateKeys,zr,($,ce)=>{var G=ou(),he=w(G);B(ye=>{ie(G,"title",`Will be lifted into ${(a()[0]||"the new class")??""}`),H(he,ye)},[()=>T(l(ce))]),S($,G)}),S(C,L)},R=C=>{var L=lu();S(C,L)};W(I,C=>{n().migrateKeys?.length?C(Q):C(R,-1)})}var p=k(I,2);{var y=C=>{var L=cu(),j=w(L);B(()=>H(j,`${n().skippedKeys.length??""} skipped`)),S(C,L)};W(p,C=>{n().skippedKeys?.length&&C(y)})}S(g,E)};W(P,g=>{l(i)&&n().include&&g(V)})}B(()=>{F=Ke(M,1,"rebemer-row",null,F,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":l(b)}),Tt(M,`--rebemer-row-depth: ${n().depth??0??""}`),H(pe,n().originalLabel),ie(ft,"placeholder",t.isRoot?"block-name":"element-name"),ft.disabled=!n().include}),Uo(ae,()=>n().include,g=>n(n().include=g,!0)),se("input",ft,A),ea(ft,()=>n().name,g=>n(n().name=g,!0)),S(e,M),On()}In(["click","input"]);var hu=x("");function ti(e,t){Tn(t,!0);let n=Yt(t,"kind",3,"info"),r=Yt(t,"duration",3,3e3),s=de(!0);ws(()=>{if(!l(s)||r()<=0)return;const c=setTimeout(()=>{X(s,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const a=U(()=>n()==="error"?"alert":"status");var o=Ho(),i=Se(o);{var u=c=>{var h=hu(),f=w(h);B(()=>{Ke(h,1,`rebemer-toast rebemer-toast--${n()??""}`),ie(h,"role",l(a)),ie(h,"aria-live",n()==="error"?"assertive":"polite"),H(f,t.message)}),se("click",h,()=>{X(s,!1),t.onDismiss?.()}),S(c,h)};W(i,c=>{l(s)&&c(u)})}S(e,o),On()}In(["click"]);var vu=x("Will migrate ",1),_u=x(''),pu=x(''),mu=x('
reBEMer ·
',1);function gu(e,t){Tn(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",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 (strips all existing classes, or just a selected family)."};function r(P){const V=P?._cssGlobalClasses;return V?(Array.isArray(V)?V:Object.values(V)).filter(E=>typeof E=="string"&&E.length>0):[]}function s(P,V){const g=r(P);for(const E of g){const I=V.find(Q=>Q&&Q.id===E);if(I&&!I.name.includes("--"))return E}return g[0]??""}let a=de("add"),o=de(!0),i=de(Lt([])),u=de(Lt([])),c=de(null),h=de(null);const f=U(()=>l(i)[0]?.originalLabel??""),v=U(()=>l(i).length===0?new Map:Qo(l(i),t.rootId)),_=U(()=>{if(l(a)!=="migrate")return null;let P=0,V=0;for(const g of l(i))g.include&&(P+=g.migrateKeys?.length??0,V+=g.skippedKeys?.length??0);return{willMigrate:P,willSkip:V}}),b=U(()=>{if(l(i).length===0)return new Map;const P=Xo({rootId:t.rootId,rows:l(i),mode:l(a)}),V=new Map;if(!P.ok)return V;for(const g of P.ops){const E=[g.finalClass];for(const I of g.modifierSlugs??[])E.push(`${g.finalClass}--${I}`);V.set(g.row.id,E)}return V});Ko(()=>{const P=Ql(t.rootId);X(u,Go().slice(),!0);const V=P.map((g,E)=>{const I=E===0,Q=g.label||"",R=Rt(Q),p=g.name||"";let y,C;R?(y=R,C="label"):I?(y="block",C="fallback"):p&&!Rs(p)?(y=Pc(p,"item"),C="element-type"):(y="item",C="fallback");const L=r(g.settings);return{id:g.id,depth:g.depth,bricksType:p,originalLabel:Q||(I?"block":"element"),name:y,modifiers:[""],isBlockRoot:!1,include:!0,suggestedFrom:C,migrateKeys:Sc(g.settings),skippedKeys:Cc(g.settings),currentClassCount:L.length,currentClassIds:L,op:"add",renameFamilyId:s(g.settings,l(u))}});if(V.length>1){const g=new Map(P.map(R=>[R.id,[]])),E=[];for(const R of P){for(;E.length&&E[E.length-1].depth>=R.depth;)E.pop();E.length&&g.get(E[E.length-1].id).push(R.id),E.push(R)}const I=new Map(P.map(R=>[R.id,R])),Q=new Map(V.map(R=>[R.id,R]));for(const[,R]of g){if(!R.length)continue;const p=new Map;for(const C of R){const L=I.get(C)?.name;L&&p.set(L,(p.get(L)??0)+1)}const y=R.filter(C=>Rs(I.get(C)?.name??""));for(const C of R){const L=Q.get(C),j=I.get(C);if(!(!L||!j||L.suggestedFrom==="label")){if(Rs(j.name)){const $=(g.get(C)??[]).map(G=>I.get(G)?.name??"").filter(Boolean),ce=y.indexOf(C);L.name=Nc($,ce,y.length),L.suggestedFrom="element-type"}else if((p.get(j.name)??0)===1){const $=Rc[j.name];$&&(L.name=$,L.suggestedFrom="element-type")}}}}}X(i,V,!0)});function O(P){if(P.key==="Escape"){t.onClose?.();return}l(h)&&P.target instanceof Node&&l(h).contains(P.target)&&P.key==="Enter"&&(P.target?.tagName==="INPUT"||P.target?.tagName==="SELECT")&&(P.preventDefault(),A())}let m=null;function A(){const P=Rt(l(i)[0]?.name??""),V=Fa(P);if(!V.ok){X(c,{kind:"error",message:V.reason},!0);return}for(const E of l(i)){if(!E.isBlockRoot||!E.include)continue;const I=Fa(Rt(E.name??""));if(!I.ok){X(c,{kind:"error",message:`Sub-block "${E.originalLabel}": ${I.reason}`},!0);return}}const g=Ac({rootId:t.rootId,rows:l(i),mode:l(a),syncLabels:l(o)});g.ok?(X(c,{kind:"success",message:`Applied to ${g.count} element${g.count!==1?"s":""}.`},!0),m&&clearTimeout(m),m=setTimeout(()=>t.onClose?.(),800)):X(c,{kind:"error",message:g.error},!0)}ws(()=>()=>{m&&clearTimeout(m)});var T=mu();jo("keydown",us,O);var M=Se(T),F=w(M),Z=w(F),ae=k(w(Z)),re=w(ae),xe=k(Z,2),pe=k(F,2),oe=w(pe),qt=k(w(oe),2),De=w(qt);De.value=De.__value="add";var Zt=k(De);Zt.value=Zt.__value="rename";var en=k(Zt);en.value=en.__value="replace";var jt=k(en);jt.value=jt.__value="migrate";var tn=k(jt);tn.value=tn.__value="mixed";var nn=k(oe,2),rt=w(nn),ft=k(pe,2),Mn=w(ft),rn=k(ft,2);{var Ln=P=>{var V=pu();let g;var E=w(V);{var I=y=>{var C=Ll("No migratable style keys found on any included element. Apply will attach empty classes.");S(y,C)},Q=y=>{var C=vu(),L=k(Se(C)),j=w(L),$=k(L);B(()=>{H(j,l(_).willMigrate),H($,` style key${l(_).willMigrate===1?"":"s"} into new classes.`)}),S(y,C)};W(E,y=>{l(_).willMigrate===0?y(I):y(Q,-1)})}var R=k(E,2);{var p=y=>{var C=_u(),L=w(C);B(()=>H(L,`${l(_).willSkip??""} key${l(_).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),S(y,C)};W(R,y=>{l(_).willSkip>0&&y(p)})}B(()=>g=Ke(V,1,"rebemer-panel__notice",null,g,{"rebemer-panel__notice--warn":l(_).willSkip>0||l(_).willMigrate===0})),S(P,V)};W(rn,P=>{l(_)&&P(Ln)})}var sn=k(rn,2);ke(sn,23,()=>l(i),P=>P.id,(P,V,g)=>{{let E=U(()=>l(v).get(l(V).id)??""),I=U(()=>l(V).id===t.rootId||l(V).isBlockRoot),Q=U(()=>l(b).get(l(V).id)??[]);du(P,{get mode(){return l(a)},get blockName(){return l(E)},get isRoot(){return l(I)},get rootId(){return t.rootId},get globalClasses(){return l(u)},get finalClassNames(){return l(Q)},get row(){return l(i)[l(g)]},set row(R){l(i)[l(g)]=R}})}});var an=k(sn,2),on=w(an),lr=k(on,2);zl(M,P=>X(h,P),()=>l(h));var Pn=k(M,2);{var cr=P=>{ti(P,{get kind(){return l(c).kind},get message(){return l(c).message},onDismiss:()=>{X(c,null)}})};W(Pn,P=>{l(c)&&P(cr)})}B(()=>{H(re,l(f)),H(Mn,n[l(a)])}),se("click",xe,()=>t.onClose?.()),Zs(qt,()=>l(a),P=>X(a,P)),Uo(rt,()=>l(o),P=>X(o,P)),se("click",on,()=>t.onClose?.()),se("click",lr,A),S(e,T),On()}In(["click"]);var bu=x('');function yu(e,t){var n=bu();let r;B(()=>{r=Ke(n,1,"slashed-cp-launch",null,r,{"slashed-cp-launch--on":t.open}),ie(n,"aria-pressed",t.open)}),se("click",n,function(...s){t.onToggle?.apply(this,s)}),S(e,n)}In(["click"]);const Ha="--sf-color-",ni=["primary","secondary","tertiary","action","neutral","base"],ri=["success","warning","error","info","danger"],Wa=["a5","a10","a20","a30","a40","a50","a60","a70","a80","a90","a95"],Ua=["superlight","xlight","lighter","darker","xdark","superdark","hover","active","strong","subtle","muted","ghost"],Vr=["text","heading","bg","surface","inset","raised","overlay","inverse","border","link","code","selection","mark","dim"],wu=e=>new Set(e),ku=wu([...ni,...ri]),Ka={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."}},Ns=[{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 Su(e){if(typeof e!="string"||e.indexOf(Ha)!==0)return null;const t=e.slice(Ha.length);if(!t||t==="scheme")return null;const n=t.indexOf("-"),r=n===-1?t:t.slice(0,n);if(!ku.has(r))return{family:"semantic",kind:"semantic",step:null,key:t};const s=n===-1?"":t.slice(n+1);return s===""?{family:r,kind:"base",step:null,key:t}:s==="light"?null:/^[0-9]+$/.test(s)?{family:r,kind:"scale",step:Number(s),key:t}:/^a[0-9]+$/.test(s)?{family:r,kind:"alpha",step:s,key:t}:{family:r,kind:"alias",step:s,key:t}}function Eu(e){return e.kind==="alpha"?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function Cu(e){switch(e.kind){case"base":return hs(e.family);case"scale":return String(e.step);case"alpha":return String(e.step).toUpperCase();case"alias":return hs(String(e.step));case"semantic":default:return xu(e.key)}}function hs(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function xu(e){return e.split("--").map(n=>n.split("-").map(hs).join(" ")).join(" · ")}function Au(e,t,n,r){const s=n[e];if(typeof s!="string"||!s)return null;const a=typeof r[e]=="string"&&r[e]?r[e]:s;return{var:e,name:e.slice(2),label:Cu(t),light:s,dark:a,alpha:Eu(t)}}function Tu(e,t){const 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 Wa.indexOf(e.info.step)-Wa.indexOf(t.info.step);if(e.info.kind==="alias"){const r=Ua.indexOf(e.info.step),s=Ua.indexOf(t.info.step),a=r===-1?999:r,o=s===-1?999:s;return a!==o?a-o:String(e.info.step).localeCompare(String(t.info.step))}return 0}function Ou(e,t){const n=Vr.findIndex(o=>e.info.key===o||e.info.key.startsWith(o+"-")),r=Vr.findIndex(o=>t.info.key===o||t.info.key.startsWith(o+"-")),s=n===-1?Vr.length:n,a=r===-1?Vr.length:r;return s!==a?s-a:e.info.key.localeCompare(t.info.key)}function Iu(e,t,n){const r=Array.isArray(e)?e:[],s=t&&typeof t=="object"?t:{},a=n&&typeof n=="object"?n:{},o=new Map,i=[];for(const h of r){const f=Su(h);if(!f)continue;const v=Au(h,f,s,a);if(!v)continue;const _={swatch:v,info:f};if(f.family==="semantic"){i.push(_);continue}o.has(f.family)||o.set(f.family,[]),o.get(f.family).push(_)}const u=[],c=(h,f)=>{const v=o.get(h);if(!v||v.length===0)return;v.sort(Tu);const _=v.filter(T=>T.info.kind==="base"||T.info.kind==="scale"),b=v.filter(T=>T.info.kind==="alias"),O=v.filter(T=>T.info.kind==="alpha"),m=[];_.length&&m.push({id:"scale",label:"Shades & tints",swatches:_.map(T=>T.swatch)}),O.length&&m.push({id:"alpha",label:"Transparent",swatches:O.map(T=>T.swatch)}),b.length&&m.push({id:"alias",label:"Semantic",swatches:b.map(T=>T.swatch)});const A=Ka[h]||{};u.push({id:h,label:hs(h),type:f,count:v.length,tagline:A.tagline||"",use:A.use||"",sections:m})};for(const h of ni)c(h,"brand");for(const h of ri)c(h,"status");if(i.length){i.sort(Ou);const h=new Map(Ns.map(b=>[b.id,[]])),f=[];for(const b of i){const O=Ns.find(m=>m.match(b.info.key));O?h.get(O.id).push(b.swatch):f.push(b.swatch)}const v=[];for(const b of Ns){const O=h.get(b.id);O.length&&v.push({id:b.id,label:b.label,swatches:O})}f.length&&v.push({id:"other",label:"Other",swatches:f});const _=Ka.semantic||{};u.push({id:"semantic",label:"Semantic",type:"semantic",count:i.length,tagline:_.tagline||"",use:_.use||"",sections:v})}return{groups:u}}function Mu(e,t){const n=String(t||"").trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};const r=[];for(const s of e.groups){const a=[];for(const o of s.sections){const i=o.swatches.filter(u=>u.name.toLowerCase().includes(n)||u.label.toLowerCase().includes(n)||s.label.toLowerCase().includes(n));i.length&&a.push({...o,swatches:i})}if(a.length){const o=a.reduce((i,u)=>i+u.swatches.length,0);r.push({...s,sections:a,count:o})}}return{groups:r}}function Lu(e){return`var(${e.var})`}function Pu(e,t){return t==="dark"?e.dark:e.light}const Ru=[{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 Nu(e,t,n){const r=t&&typeof t=="object"?t:{},s=n&&typeof n=="object"?n:{},a=[];for(const o of Ru){const i=[];for(const u of o.tokens){const c=r[u.var];if(!c)continue;const h=s[u.var]||c;i.push({var:u.var,name:u.var.slice(2),label:u.label,light:c,dark:h,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(u.var)})}i.length&&a.push({id:o.id,label:o.label,swatches:i})}return{groups:a}}var Bu=x('');function Bs(e,t){Tn(t,!0);let n=Yt(t,"onPick",3,void 0);const r=U(()=>`${t.swatch.name}
+light ${t.swatch.light} · dark ${t.swatch.dark}`);var s=Bu();let a;B(o=>{a=Ke(s,1,"slashed-cp-swatch",null,a,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode==="both"}),Tt(s,`--cp-l:${t.swatch.light??""}; --cp-d:${t.swatch.dark??""}; --cp-solid:${o??""};`),ie(s,"title",l(r)),ie(s,"aria-label",t.swatch.name)},[()=>Pu(t.swatch,t.mode==="dark"?"dark":"light")]),se("click",s,()=>n()?.(t.swatch)),S(e,s),On()}In(["click"]);var Fu=x(''),Du=x(''),qu=x(''),ju=x('
- {#each alphaSec.swatches as s (s.var)}
-
- {/each}
-
- {/if}
- {/if}
-
- {/if}
-
- {/each}
-
+ {@render familyScanner(statusGroups)}
{/if}
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js
index 8c348399..058ade3e 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js
+++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js
@@ -132,11 +132,10 @@ function injectSFButton(colorControl) {
});
// Insert right after the Variables icon, before Dynamic data (if present).
+ // Falls back to appending when there's no Variables icon or it's the last child.
const varBtn = colorInput.querySelector('.variable-picker-button');
if (varBtn && varBtn.nextSibling) {
colorInput.insertBefore(btn, varBtn.nextSibling);
- } else if (varBtn) {
- colorInput.appendChild(btn);
} else {
colorInput.appendChild(btn);
}
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php b/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
index a6bdb3fc..3cb91901 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
@@ -202,6 +202,21 @@ function slashed_bricks_rest_routes_init() {
}
add_action( 'rest_api_init', 'slashed_bricks_rest_routes_init' );
+/**
+ * Load the shared Bricks data classes (parser → resolver → inventory).
+ *
+ * Required by both bootstrap paths — slashed_bricks_data_init() at
+ * plugins_loaded and slashed_bricks_init() at after_setup_theme. Each calls
+ * this independently because the two paths gate on different signals (the
+ * `template` option vs the live Bricks version), so neither may assume the
+ * other has already run. Idempotent via require_once.
+ */
+function slashed_bricks_require_data_classes() {
+ require_once SLASHED_BRICKS_PATH . 'includes/class-css-parser.php';
+ require_once SLASHED_BRICKS_PATH . 'includes/class-color-resolver.php';
+ require_once SLASHED_BRICKS_PATH . 'includes/class-inventory.php';
+}
+
/**
* Data managers: early initialization at plugins_loaded.
*
@@ -220,9 +235,7 @@ function slashed_bricks_data_init() {
return;
}
- require_once SLASHED_BRICKS_PATH . 'includes/class-css-parser.php';
- require_once SLASHED_BRICKS_PATH . 'includes/class-color-resolver.php';
- require_once SLASHED_BRICKS_PATH . 'includes/class-inventory.php';
+ slashed_bricks_require_data_classes();
require_once SLASHED_BRICKS_PATH . 'includes/class-variables.php';
require_once SLASHED_BRICKS_PATH . 'includes/class-classes.php';
@@ -243,9 +256,7 @@ function slashed_bricks_init() {
return;
}
- require_once SLASHED_BRICKS_PATH . 'includes/class-css-parser.php';
- require_once SLASHED_BRICKS_PATH . 'includes/class-color-resolver.php';
- require_once SLASHED_BRICKS_PATH . 'includes/class-inventory.php';
+ slashed_bricks_require_data_classes();
require_once SLASHED_BRICKS_PATH . 'includes/class-enqueue.php';
new Slashed_Bricks_Enqueue();
From 2cd4947346a81326109b4741e246dee2ef390411 Mon Sep 17 00:00:00 2001
From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com>
Date: Fri, 5 Jun 2026 10:38:15 +0000
Subject: [PATCH 3/3] fix(bricks): bust CPT font cache on all saves, not just
REST requests
Addresses CodeRabbit review on PR #230:
- Real fix: the save_post_{BRICKS_DB_CUSTOM_FONTS} cache-bust hook was
registered inside Slashed_Bricks_Fonts_REST::register_routes(), which only
runs on rest_api_init. A normal admin save of a custom-font post therefore
left the slashed_bricks_cpt_fonts transient stale for up to an hour. Moved
invalidation to Slashed_Token_Page::flush_bricks_fonts_cache() (the
always-loaded canonical owner of the transient) and hooked it from
slashed_bricks_data_init() (plugins_loaded, all request types). REST class
no longer registers the hook.
- Nitpick: added the base/surface explanatory comment in class-inventory.php
to mirror the note in export.js.
php -l clean on all changed files; PHP-only change, no bundle rebuild needed.
---
CODE-AUDIT.md | 16 ++++++++++++++++
.../SLASHED-for-WP/includes/class-token-page.php | 12 ++++++++++++
.../bricks/includes/class-fonts-rest.php | 13 +++++--------
.../bricks/includes/class-inventory.php | 3 +++
.../integrations/bricks/slashed-bricks.php | 12 ++++++++++++
5 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md
index 2fa49cad..4279dd23 100644
--- a/CODE-AUDIT.md
+++ b/CODE-AUDIT.md
@@ -95,6 +95,22 @@ their deps independently, so the calls can't simply be removed — instead the
shared trio is now `slashed_bricks_require_data_classes()`, called from both.
Idempotent via `require_once`; no behavioural change.
+### 5. PR #230 review feedback addressed (CodeRabbit)
+
+- **CPT font-cache invalidation moved to an always-loaded path (real fix).** The
+ `save_post_{BRICKS_DB_CUSTOM_FONTS}` → cache-bust hook was registered inside
+ `Slashed_Bricks_Fonts_REST::register_routes()`, which only runs on
+ `rest_api_init`. A normal (non-REST) admin save of a custom-font post would
+ therefore not invalidate the `slashed_bricks_cpt_fonts` transient, leaving a
+ stale font list for up to an hour. The invalidation now lives on
+ `Slashed_Token_Page::flush_bricks_fonts_cache()` (the always-loaded canonical
+ owner of the transient) and is hooked from `slashed_bricks_data_init()`
+ (`plugins_loaded`, all request types). The REST class no longer registers the
+ hook. Pre-existing bug, surfaced by the de-dup refactor.
+- **Inline `base`/`surface` comment added in `class-inventory.php`** to mirror
+ the note in `export.js`, so the brand-family list documents why `base` is
+ included and `surface` (a derived alias) is not.
+
### Verified already-resolved since the 2026-06-02 snapshot
CSS-generator allowlist validation (`valid_color`/`valid_dimension`/
diff --git a/plugins/SLASHED-for-WP/includes/class-token-page.php b/plugins/SLASHED-for-WP/includes/class-token-page.php
index 669971dd..8b613e08 100644
--- a/plugins/SLASHED-for-WP/includes/class-token-page.php
+++ b/plugins/SLASHED-for-WP/includes/class-token-page.php
@@ -170,6 +170,18 @@ public static function get_class_hints() {
*/
const CPT_FONTS_TRANSIENT = 'slashed_bricks_cpt_fonts';
+ /**
+ * Flush the cached Bricks Font-Manager CPT font list.
+ *
+ * Registered on save_post_{BRICKS_DB_CUSTOM_FONTS} from an always-loaded
+ * bootstrap path (see slashed-bricks.php) rather than from REST route
+ * registration, so the cache is invalidated on every custom-font save —
+ * including normal admin saves, not only during REST requests.
+ */
+ public static function flush_bricks_fonts_cache() {
+ delete_transient( self::CPT_FONTS_TRANSIENT );
+ }
+
/**
* Collect every font Bricks already knows how to serve.
*
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
index d7efe6fa..57a23750 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-fonts-rest.php
@@ -42,14 +42,11 @@ public function register_routes() {
)
);
- // Bust the CPT font cache whenever a custom-font post is saved.
- if ( defined( 'BRICKS_DB_CUSTOM_FONTS' ) ) {
- add_action( 'save_post_' . BRICKS_DB_CUSTOM_FONTS, array( $this, 'bust_cpt_cache' ) );
- }
- }
-
- public function bust_cpt_cache() {
- delete_transient( Slashed_Token_Page::CPT_FONTS_TRANSIENT );
+ // Note: the CPT font-cache invalidation hook
+ // (save_post_{BRICKS_DB_CUSTOM_FONTS}) is registered from the
+ // always-loaded plugins_loaded bootstrap in slashed-bricks.php, not
+ // here — rest_api_init only fires during REST dispatch, so registering
+ // it here would miss normal admin saves and leave a stale cache.
}
public function check_permissions() {
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
index be05beb0..7ed5422b 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-inventory.php
@@ -238,6 +238,9 @@ private static function get_admin_color_overrides() {
$settings = $tokens['colors'];
$overrides = array();
+ // Brand families: 'base' is the source token (--sf-color-base-light);
+ // 'surface' is a derived alias with no -light source, so it's excluded.
+ // Must stay in sync with Slashed_CSS_Generator::generate_color_declarations().
$brand_colors = array( 'primary', 'secondary', 'tertiary', 'action', 'neutral', 'base' );
$status_colors = array( 'success', 'warning', 'error', 'info', 'danger' );
diff --git a/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php b/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
index 3cb91901..f4bc2c45 100644
--- a/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
+++ b/plugins/SLASHED-for-WP/integrations/bricks/slashed-bricks.php
@@ -241,6 +241,18 @@ function slashed_bricks_data_init() {
new Slashed_Bricks_Variables();
new Slashed_Bricks_Classes();
+
+ // Invalidate the Bricks Font-Manager CPT cache on every custom-font save.
+ // Registered here (plugins_loaded, all request types) rather than from REST
+ // route registration so the cache is busted on normal admin saves too, not
+ // only during REST requests. The collector + transient live in the
+ // always-loaded Slashed_Token_Page.
+ if ( defined( 'BRICKS_DB_CUSTOM_FONTS' ) && class_exists( 'Slashed_Token_Page' ) ) {
+ add_action(
+ 'save_post_' . BRICKS_DB_CUSTOM_FONTS,
+ array( 'Slashed_Token_Page', 'flush_bricks_fonts_cache' )
+ );
+ }
}
add_action( 'plugins_loaded', 'slashed_bricks_data_init', 20 );