@hogsend/cli 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hogsend/cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"tsup": "^8.5.1",
|
|
35
35
|
"tsx": "^4.22.4",
|
|
36
36
|
"vitest": "^4.1.7",
|
|
37
|
-
"@hogsend/studio": "^0.23.
|
|
37
|
+
"@hogsend/studio": "^0.23.1",
|
|
38
38
|
"@repo/typescript-config": "0.0.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@clack/prompts": "^1.5.0",
|
|
45
45
|
"better-auth": "^1.6.11",
|
|
46
46
|
"picocolors": "^1.1.1",
|
|
47
|
-
"@hogsend/db": "^0.23.
|
|
48
|
-
"@hogsend/engine": "^0.23.
|
|
47
|
+
"@hogsend/db": "^0.23.1",
|
|
48
|
+
"@hogsend/engine": "^0.23.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"prebuild": "node scripts/bundle-studio.mjs",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:"Geist Mono Variable", ui-monospace, "SFMono-Regular", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--radius-md:.375rem;--radius-lg:.375rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Inter Display", ui-sans-serif, system-ui, sans-serif;--color-accent:#f64838;--color-accent-deep:#b8281c;--color-accent-tint:#f6483826;--color-ink:#050101;--color-raised:#0a0606;--color-hairline-faint:#ffffff14}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--color-hairline-faint)}::file-selector-button{border-color:var(--color-hairline-faint)}html{color-scheme:dark;scrollbar-gutter:stable;background-color:var(--color-ink);-webkit-font-smoothing:antialiased}body{font-family:var(--font-sans);letter-spacing:-.02em;background-color:var(--color-ink);color:#fff}h1,h2,h3,h4,.font-display{font-family:var(--font-display);letter-spacing:-.02em;font-weight:400}code,kbd,pre,samp{letter-spacing:0}*{scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#ffffff26;border-radius:4px}body:before{content:"";z-index:30;pointer-events:none;opacity:.025;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-repeat:repeat;position:fixed;top:0;right:0;bottom:0;left:0}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.table{display:table}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-40{height:calc(var(--spacing) * 40)}.h-48{height:calc(var(--spacing) * 48)}.h-96{height:calc(var(--spacing) * 96)}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.min-h-\[140px\]{min-height:140px}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-60{width:calc(var(--spacing) * 60)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[18rem\]{max-width:18rem}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[2px\]{min-width:2px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[3px\]{border-radius:3px}.rounded-\[6px\]{border-radius:6px}.rounded-\[8px\]{border-radius:8px}.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--color-accent)}.border-accent\/40{border-color:#f6483866}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--color-accent) 40%,transparent)}}.border-hairline-faint{border-color:var(--color-hairline-faint)}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.border-white\/\[0\.08\]{border-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.bg-accent{background-color:var(--color-accent)}.bg-accent-tint{background-color:var(--color-accent-tint)}.bg-accent\/5{background-color:#f648380d}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--color-accent) 5%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-ink{background-color:var(--color-ink)}.bg-ink\/30{background-color:#0501014d}@supports (color:color-mix(in lab,red,red)){.bg-ink\/30{background-color:color-mix(in oklab,var(--color-ink) 30%,transparent)}}.bg-raised{background-color:var(--color-raised)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-white\/\[0\.08\]{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.08\]{background-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.bg-white\/\[0\.12\]{background-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.12\]{background-color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.bg-white\/\[0\.015\]{background-color:#ffffff04}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.015\]{background-color:color-mix(in oklab,var(--color-white) 1.5%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.text-\[28px\]{font-size:28px}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-\[\#0a0a0a\]{color:#0a0a0a}.text-accent{color:var(--color-accent)}.text-white{color:var(--color-white)}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.accent-accent{accent-color:var(--color-accent)}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-\[7px\]{--tw-backdrop-blur:blur(7px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-0\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:bg-accent:is(:where(.group):hover *){background-color:var(--color-accent)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\:text-white\/40::placeholder{color:#fff6}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/40::placeholder{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}@media(hover:hover){.hover\:border-accent\/40:hover{border-color:#f6483866}@supports (color:color-mix(in lab,red,red)){.hover\:border-accent\/40:hover{border-color:color-mix(in oklab,var(--color-accent) 40%,transparent)}}.hover\:border-white\/15:hover{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/15:hover{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.hover\:bg-accent-deep:hover{background-color:var(--color-accent-deep)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/80:hover{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-accent:focus-visible{--tw-ring-color:var(--color-accent)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[state\=selected\]\:bg-white\/\[0\.06\][data-state=selected]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.data-\[state\=selected\]\:bg-white\/\[0\.06\][data-state=selected]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[260px_1fr\]{grid-template-columns:260px 1fr}}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\]\:border-hairline-faint tr{border-color:var(--color-hairline-faint)}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\&\>li\:last-child\>div\:first-child\>span\:last-child\]\:hidden>li:last-child>div:first-child>span:last-child{display:none}.\[\&\>option\]\:bg-raised>option{background-color:var(--color-raised)}.\[\&\>option\]\:text-white>option{color:var(--color-white)}}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2)format("woff2-variations");unicode-range:U+1F??}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-greek-wght-normal-CkhJZR-_.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-latin-wght-normal-Dx4kXJAl.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2)format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter Display;font-style:normal;font-weight:400;font-display:swap;src:url(/studio/assets/InterDisplay-Regular-CHKdHLF4.woff2)format("woff2")}@font-face{font-family:Inter Display;font-style:normal;font-weight:500;font-display:swap;src:url(/studio/assets/InterDisplay-Medium-CYGNL_ty.woff2)format("woff2")}.eyebrow{font-family:var(--font-sans);letter-spacing:.04em;text-transform:uppercase;font-size:.75rem;line-height:1}.glass-panel{-webkit-backdrop-filter:blur(14px);background-color:#0a0606cc;border:1px solid #ffffff1a;border-radius:12px}.noise{opacity:.025;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-repeat:repeat}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -277,4 +277,4 @@ Error generating stack: `+l.message+`
|
|
|
277
277
|
*
|
|
278
278
|
* This source code is licensed under the ISC license.
|
|
279
279
|
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const i_=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Eh=_e("Zap",i_),wb=V.createContext(null);function l_({children:n}){const[s,i]=V.useState([]),r=V.useRef(0),c=V.useCallback(y=>{i(p=>p.filter(m=>m.id!==y))},[]),d=V.useCallback(y=>{const p=++r.current,m={id:p,title:y.title,description:y.description,variant:y.variant??"success"};i(b=>[...b,m]),window.setTimeout(()=>c(p),5e3)},[c]),h=V.useMemo(()=>({toast:d}),[d]);return u.jsxs(wb.Provider,{value:h,children:[n,u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:s.map(y=>u.jsxs("div",{className:Fe("glass-panel pointer-events-auto flex items-start gap-3 p-4 text-white shadow-black/50 shadow-xl",y.variant==="error"&&"border-accent/40"),children:[y.variant==="success"?u.jsx(yb,{strokeWidth:1.5,className:"mt-0.5 h-5 w-5 shrink-0 text-white/90"}):u.jsx(gb,{strokeWidth:1.5,className:"mt-0.5 h-5 w-5 shrink-0 text-accent"}),u.jsxs("div",{className:"flex-1 space-y-0.5",children:[u.jsx("p",{className:"text-sm font-medium text-white",children:y.title}),y.description?u.jsx("p",{className:"text-sm text-white/60",children:y.description}):null]}),u.jsx("button",{type:"button","aria-label":"Dismiss",className:"text-white/50 transition-colors hover:text-white",onClick:()=>c(y.id),children:u.jsx(_h,{className:"h-4 w-4"})})]},y.id))})]})}function Cn(){const n=V.useContext(wb);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const r_=new RS({defaultOptions:{queries:{staleTime:3e4,retry:(n,s)=>s instanceof At&&[401,403].includes(s.status)?!1:n<2,refetchOnWindowFocus:!1}}}),Er="https://docs.hogsend.com",ui={docs:Er,quickstart:`${Er}/docs/getting-started`,recipes:`${Er}/docs/recipes`,journeys:`${Er}/docs/guides/journeys`,buckets:`${Er}/docs/guides/buckets`},o_=[{label:"Overview",path:"/",icon:AR},{label:"Sends",path:"/sends",icon:Pr},{label:"Templates",path:"/templates",icon:bb},{label:"Journeys",path:"/journeys",icon:Rh},{label:"Buckets",path:"/buckets",icon:oR},{label:"Contacts",path:"/contacts",icon:jb},{label:"Suppressions",path:"/suppressions",icon:pb},{label:"Debug",path:"/debug",icon:wR},{label:"Integrations",path:"/integrations",icon:Kc},{label:"Setup",path:"/setup",icon:lh},{label:"Settings",path:"/settings",icon:XR}];function c_(){const n=Aw({select:s=>s.location.pathname});return u.jsxs("aside",{className:"flex h-full w-60 flex-col border-r border-hairline-faint bg-ink",children:[u.jsx("div",{className:"flex h-14 items-center border-b border-hairline-faint px-5",children:u.jsx(fb,{})}),u.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-2",children:o_.map(s=>{const i=s.path==="/"?n==="/":n.startsWith(s.path),r=s.icon;return u.jsxs(jl,{to:s.path,className:Fe("flex items-center gap-3 rounded-md px-3 py-2 text-[15px] tracking-[-0.02em] outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-accent",i?"bg-accent-tint text-accent":"text-white/60 hover:bg-white/5 hover:text-white"),children:[u.jsx(r,{strokeWidth:1.5,className:"h-4 w-4"}),s.label]},s.path)})}),u.jsx("div",{className:"border-t border-hairline-faint p-2",children:u.jsxs("a",{href:ui.docs,target:"_blank",rel:"noreferrer",className:"group flex items-center gap-3 rounded-md px-3 py-2 text-[15px] tracking-[-0.02em] text-white/60 outline-none transition-colors duration-200 hover:bg-white/5 hover:text-white focus-visible:ring-2 focus-visible:ring-accent",children:[u.jsx(lR,{strokeWidth:1.5,className:"h-4 w-4"}),"Docs",u.jsx(wh,{className:"ml-auto h-3.5 w-3.5 opacity-60 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})})]})}function u_(){const{data:n}=Z0();return u.jsxs("div",{className:"flex h-full bg-ink text-white",children:[u.jsx(c_,{}),u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex h-14 items-center justify-end gap-3 border-b border-hairline-faint bg-ink/30 px-6 backdrop-blur-[7px]",children:[n!=null&&n.user?u.jsx("span",{className:"text-sm text-white/50",children:n.user.email}):null,u.jsxs(je,{variant:"ghost",size:"sm",onClick:()=>{Z2()},children:[u.jsx(kR,{strokeWidth:1.5,className:"h-4 w-4"}),"Sign out"]})]}),u.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:u.jsx(G0,{})})]})]})}function Ut({className:n,...s}){return u.jsx("div",{className:Fe("animate-pulse rounded-md bg-white/5",n),...s})}function hi({rows:n=6}){return u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ut,{className:"h-9 w-full"}),Array.from({length:n}).map((s,i)=>u.jsx(Ut,{className:"h-12 w-full"},i))]})}function Nb({count:n=4}){return u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:n}).map((s,i)=>u.jsx(Ut,{className:"h-28 w-full"},i))})}function In({title:n,description:s,icon:i=ER,action:r}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-white/15 p-12 text-center",children:[u.jsx(i,{strokeWidth:1.5,className:"h-8 w-8 text-white/30"}),u.jsx("p",{className:"text-sm font-medium text-white",children:n}),s?u.jsx("p",{className:"max-w-sm text-sm text-white/60",children:s}):null,r?u.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:r}):null]})}function _t({error:n,onRetry:s}){const i=n instanceof At||n instanceof Error?n.message:"Something went wrong.";return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-md border border-accent/40 bg-accent/5 p-12 text-center",children:[u.jsx(mR,{strokeWidth:1.5,className:"h-8 w-8 text-accent"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium text-white",children:"Failed to load"}),u.jsx("p",{className:"max-w-sm text-sm text-white/60",children:i})]}),s?u.jsx(je,{variant:"outline",size:"sm",onClick:s,children:"Retry"}):null]})}function Bn({title:n,description:s,action:i}){return u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"font-display text-2xl text-white tracking-[-0.02em]",children:n}),s?u.jsx("p",{className:"mt-1 text-sm text-white/60",children:s}):null]}),i?u.jsx("div",{className:"shrink-0",children:i}):null]})}const f_=db("inline-flex items-center rounded-[3px] border px-2 py-0.5 text-xs font-medium transition-colors",{variants:{variant:{default:"border-accent bg-accent-tint text-white",secondary:"border-white/[0.08] bg-white/[0.06] text-white/80",destructive:"border-accent/40 bg-accent-tint text-accent",outline:"border-white/[0.08] text-white/70"}},defaultVariants:{variant:"default"}});function De({className:n,variant:s,...i}){return u.jsx("div",{className:Fe(f_({variant:s}),n),...i})}function Qc({open:n,onClose:s,title:i,description:r,children:c,footer:d,className:h}){return V.useEffect(()=>{if(!n)return;const y=p=>{p.key==="Escape"&&s()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n,s]),n?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("button",{type:"button","aria-label":"Close dialog",className:"absolute inset-0 bg-black/60",onClick:s}),u.jsxs("div",{role:"dialog","aria-modal":"true",className:Fe("glass-panel relative z-10 w-full max-w-lg p-6 text-white shadow-black/50 shadow-xl",h),children:[u.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h2",{className:"font-display text-lg leading-none tracking-[-0.02em] text-white",children:i}),r?u.jsx("p",{className:"text-sm text-white/60",children:r}):null]}),u.jsx(je,{variant:"ghost",size:"icon",className:"-mr-2 -mt-2 h-8 w-8",onClick:s,"aria-label":"Close",children:u.jsx(_h,{className:"h-4 w-4"})})]}),c?u.jsx("div",{className:"space-y-4",children:c}):null,d?u.jsx("div",{className:"mt-6 flex justify-end gap-2",children:d}):null]})]}):null}function mi({open:n,onClose:s,onConfirm:i,title:r,description:c,confirmLabel:d="Confirm",cancelLabel:h="Cancel",destructive:y,loading:p}){return u.jsx(Qc,{open:n,onClose:s,title:r,description:c,footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:s,disabled:p,children:h}),u.jsx(je,{variant:y?"destructive":"default",onClick:i,disabled:p,children:p?"Working…":d})]})})}function wl({href:n,children:s,variant:i="outline",className:r}){return u.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:Fe(jh({variant:i,size:"sm"}),r),children:[s,u.jsx(wh,{strokeWidth:2,className:"h-3.5 w-3.5 shrink-0 opacity-70 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})}const Ss=V.forwardRef(({className:n,...s},i)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:i,className:Fe("w-full caption-bottom text-sm",n),...s})}));Ss.displayName="Table";const js=V.forwardRef(({className:n,...s},i)=>u.jsx("thead",{ref:i,className:Fe("[&_tr]:border-b [&_tr]:border-hairline-faint",n),...s}));js.displayName="TableHeader";const ws=V.forwardRef(({className:n,...s},i)=>u.jsx("tbody",{ref:i,className:Fe("[&_tr:last-child]:border-0",n),...s}));ws.displayName="TableBody";const Ht=V.forwardRef(({className:n,...s},i)=>u.jsx("tr",{ref:i,className:Fe("border-b border-hairline-faint transition-colors hover:bg-white/[0.03] data-[state=selected]:bg-white/[0.06]",n),...s}));Ht.displayName="TableRow";const Se=V.forwardRef(({className:n,...s},i)=>u.jsx("th",{ref:i,className:Fe("h-10 px-2 text-left align-middle font-normal text-white/50 text-xs uppercase tracking-[0.04em] [&:has([role=checkbox])]:pr-0",n),...s}));Se.displayName="TableHead";const be=V.forwardRef(({className:n,...s},i)=>u.jsx("td",{ref:i,className:Fe("p-2 align-middle [&:has([role=checkbox])]:pr-0",n),...s}));be.displayName="TableCell";const d_=V.forwardRef(({className:n,...s},i)=>u.jsx("caption",{ref:i,className:Fe("mt-4 text-sm text-white/50",n),...s}));d_.displayName="TableCaption";function h_(){return Le.get("/v1/admin/metrics/overview")}function m_(n){return Le.get("/v1/admin/emails",{query:n})}function p_(n){return Le.get(`/v1/admin/emails/${n}`)}function y_(n){return Le.post(`/v1/admin/emails/${n}/resend`)}function g_(){return Le.get("/v1/admin/templates")}function v_(n){return Le.get(`/v1/admin/templates/${encodeURIComponent(n)}/preview`)}function b_(n,s){return Le.post(`/v1/admin/templates/${encodeURIComponent(n)}/send-test`,{json:{to:s}})}function x_(n){return Le.get(`/v1/admin/reporting/templates/${encodeURIComponent(n)}`)}function S_(){return Le.get("/v1/admin/metrics/journeys")}function j_(n){return Le.get(`/v1/admin/metrics/journeys/${encodeURIComponent(n)}`)}function Rb(){return Le.get("/v1/admin/journeys",{query:{limit:100}})}function w_(n,s){return Le.put(`/v1/admin/journeys/${encodeURIComponent(n)}`,{json:{enabled:s}})}function N_(){return Le.get("/v1/admin/buckets",{query:{limit:100}})}function R_(n){return Le.get(`/v1/admin/buckets/${encodeURIComponent(n)}`)}function __(){return Le.get("/v1/admin/metrics/buckets")}function E_(n,s){return Le.get(`/v1/admin/metrics/buckets/${encodeURIComponent(n)}`,{query:{period:s}})}function C_(n,s){return Le.patch(`/v1/admin/buckets/${encodeURIComponent(n)}`,{json:{enabled:s}})}function T_(n){return Le.get("/v1/admin/contacts",{query:{search:n,limit:50}})}function M_(n){return Le.get(`/v1/admin/contacts/${encodeURIComponent(n)}`)}function A_(n){return Le.get(`/v1/admin/reporting/contacts/${encodeURIComponent(n)}/activity`)}function O_(n){return Le.get(`/v1/admin/contacts/${encodeURIComponent(n)}/timeline`,{query:{limit:100}})}function _b(n,s){return Le.put(`/v1/admin/contacts/${encodeURIComponent(n)}/preferences`,{json:s})}function k_(n){return Le.get("/v1/admin/suppressions",{query:{type:n,limit:200}})}function z_(){return Le.get("/v1/admin/api-keys",{query:{limit:100,includeRevoked:"true"}})}function D_(n){return Le.post("/v1/admin/api-keys",{json:n})}function U_(n){return Le.delete(`/v1/admin/api-keys/${encodeURIComponent(n)}`)}function L_(n){return Le.post("/v1/admin/events",{json:{event:n.event,userId:n.userId,userEmail:n.userEmail,properties:n.properties??{}}})}function qv(n){return Le.get("/v1/admin/domain",{query:{refresh:n?"true":void 0}})}function B_(n){return Le.post("/v1/admin/domain",{json:{domain:n}})}function q_(){return Le.post("/v1/admin/domain/verify")}function H_(){return Le.get("/v1/admin/connectors")}function Q_(){return Le.get("/v1/admin/connectors/discord/connect-info")}function G_(n){return Le.delete(`/v1/admin/provider-credentials/${encodeURIComponent(n)}`)}const Ue={overview:["overview"],emails:n=>["emails",n],email:n=>["email",n],templates:["templates"],templatePreview:n=>["template-preview",n],templateReport:n=>["template-report",n],journeyMetrics:["journey-metrics"],journeys:["journeys"],journeyFunnel:n=>["journey-funnel",n],buckets:["buckets"],bucketMetrics:["bucket-metrics"],bucket:n=>["bucket",n],bucketTrend:n=>["bucket-trend",n],contacts:n=>["contacts",n],contact:n=>["contact",n],contactActivity:n=>["contact-activity",n],contactTimeline:n=>["contact-timeline",n],suppressions:n=>["suppressions",n],apiKeys:["api-keys"],domain:["domain"],integrations:["integrations"],discordConnectInfo:["discord-connect-info"]};function En(n){if(!n)return"—";const s=new Date(n);return Number.isNaN(s.getTime())?"—":s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ac(n){if(!n)return"—";const s=new Date(n);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function V_(n){if(!n)return"—";const s=new Date(n);if(Number.isNaN(s.getTime()))return"—";const i=Date.now()-s.getTime(),r=Math.round(i/1e3);if(r<60)return"just now";const c=Math.round(r/60);if(c<60)return`${c}m ago`;const d=Math.round(c/60);if(d<24)return`${d}h ago`;const h=Math.round(d/24);return h<30?`${h}d ago`:Ac(n)}function Nl(n){return n==null||Number.isNaN(n)?"—":`${(n*100).toFixed(1)}%`}function ft(n){return n==null||Number.isNaN(n)?"—":n.toLocaleString()}function Ch(n){if(n==null||Number.isNaN(n))return"—";if(n<60)return`${Math.round(n)}s`;const s=Math.floor(n/60);if(s<60)return`${s}m`;const i=Math.floor(s/60),r=s%60;if(i<24)return r?`${i}h ${r}m`:`${i}h`;const c=Math.floor(i/24),d=i%24;return d?`${c}d ${d}h`:`${c}d`}function P_(n){if(!n)return null;const s=(n.hours??0)*3600+(n.minutes??0)*60+(n.seconds??0);return s>0?Ch(s):null}function Y_(n,s=48){return n.length>s?`${n.slice(0,s-1)}…`:n}function rh({data:n,height:s=160,label:i="value"}){var c,d;if(n.length===0)return u.jsx("div",{className:"flex items-center justify-center rounded-md border border-dashed border-white/15 text-sm text-white/50",style:{height:s},children:"No data in range"});const r=Math.max(...n.map(h=>h.value),1);return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"flex items-end gap-1 rounded-md border border-hairline-faint bg-white/[0.015] p-3",style:{height:s},children:n.map(h=>{const y=h.value/r*100;return u.jsx("div",{className:"group flex flex-1 flex-col items-center justify-end",title:`${Ac(h.date)}: ${h.value} ${i}`,children:u.jsx("div",{className:"w-full min-w-[2px] rounded-t bg-white/15 transition-colors duration-200 group-hover:bg-accent",style:{height:`${Math.max(y,h.value>0?4:0)}%`}})},h.date)})}),u.jsxs("div",{className:"flex justify-between text-[11px] text-white/40 uppercase tracking-[0.04em]",children:[u.jsx("span",{children:Ac((c=n[0])==null?void 0:c.date)}),u.jsx("span",{children:Ac((d=n[n.length-1])==null?void 0:d.date)})]})]})}function K_({bucketId:n}){const s=tt({queryKey:Ue.bucketTrend(n),queryFn:()=>E_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-48 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data,r=i.points.map(y=>({date:y.date,value:y.entered})),c=i.points.map(y=>({date:y.date,value:y.left})),d=i.points.reduce((y,p)=>y+p.entered,0),h=i.points.reduce((y,p)=>y+p.left,0);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-wrap gap-6 text-sm",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Current size"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(i.size)})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Entered (range)"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(d)})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Left (range)"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(h)})]})]}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Entered over time"}),u.jsx(rh,{data:r,label:"joined"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Left over time"}),u.jsx(rh,{data:c,label:"left"})]})]})]})}function X_(){var N,R;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),[c,d]=V.useState(null),h=tt({queryKey:Ue.bucketMetrics,queryFn:__}),y=tt({queryKey:Ue.buckets,queryFn:N_}),p=hn({mutationFn:j=>C_(j.id,j.enabled),onSuccess:(j,k)=>{n({title:k.enabled?"Bucket enabled":"Bucket disabled"}),d(null),s.invalidateQueries({queryKey:Ue.buckets}),s.invalidateQueries({queryKey:Ue.bucketMetrics})},onError:j=>{n({variant:"error",title:"Update failed",description:j instanceof At?j.message:"Unexpected error."}),d(null)}}),m=h.isPending||y.isPending,b=h.isError||y.isError,v=new Map((((N=y.data)==null?void 0:N.buckets)??[]).map(j=>[j.id,j])),x=(((R=h.data)==null?void 0:R.buckets)??[]).map(j=>{const k=v.get(j.bucketId);return{...j,enabled:(k==null?void 0:k.enabled)??!1,kind:(k==null?void 0:k.kind)??"dynamic",timeBased:(k==null?void 0:k.timeBased)??!1}}),w=x.find(j=>j.bucketId===i)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Buckets",description:"Real-time, code-defined membership. Sizes, enter/leave trends, and which journeys each bucket feeds — observe only, authoring stays in code."}),m?u.jsx(hi,{}):b?u.jsx(_t,{error:h.error??y.error,onRetry:()=>{h.refetch(),y.refetch()}}):x.length===0?u.jsx(In,{title:"No buckets registered",description:"Buckets are real-time, code-defined audiences (defineBucket()). Add one to your app and members appear here as events arrive.",action:u.jsxs(u.Fragment,{children:[u.jsx(wl,{href:ui.buckets,children:"How to create a bucket"}),u.jsx(wl,{href:ui.recipes,variant:"ghost",children:"Recipes"})]})}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Bucket"}),u.jsx(Se,{className:"text-right",children:"Current size"}),u.jsx(Se,{className:"text-right",children:"Entered"}),u.jsx(Se,{className:"text-right",children:"Left"}),u.jsx(Se,{className:"text-right",children:"Avg dwell"}),u.jsx(Se,{children:"Freshness"}),u.jsx(Se,{children:"State"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:x.map(j=>u.jsxs(Ht,{className:"cursor-pointer","data-state":j.bucketId===i?"selected":void 0,onClick:()=>r(k=>k===j.bucketId?null:j.bucketId),children:[u.jsxs(be,{children:[u.jsx("span",{className:"font-medium text-white",children:j.name}),u.jsx("span",{className:"block font-mono text-xs text-white/70",children:j.bucketId})]}),u.jsx(be,{className:"text-right",children:ft(j.size)}),u.jsx(be,{className:"text-right",children:ft(j.entered)}),u.jsx(be,{className:"text-right",children:ft(j.left)}),u.jsx(be,{className:"text-right text-white/60",children:Ch(j.avgDwellSecs)}),u.jsx(be,{children:u.jsx(Z_,{timeBased:j.timeBased})}),u.jsx(be,{children:u.jsx(De,{variant:j.enabled?"default":"secondary",children:j.enabled?"Enabled":"Disabled"})}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:k=>{k.stopPropagation(),d(j)},children:j.enabled?"Disable":"Enable"})})]},j.bucketId))})]})}),w?u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"text-base",children:[w.name," — feeds journeys"]})}),u.jsx(qt,{children:u.jsx(F_,{bucketId:w.bucketId})})]}),u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"text-base",children:[w.name," — enter / leave over time"]})}),u.jsx(qt,{children:u.jsx(K_,{bucketId:w.bucketId})})]})]}):null,u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&p.mutate({id:c.bucketId,enabled:!c.enabled}),title:c!=null&&c.enabled?"Disable this bucket?":"Enable this bucket?",description:c!=null&&c.enabled?"Membership will stop being recomputed; in-flight members stay until they leave.":"Matching users will start being added to this bucket again.",confirmLabel:c!=null&&c.enabled?"Disable":"Enable",destructive:c==null?void 0:c.enabled,loading:p.isPending})]})}function Z_({timeBased:n}){return n?u.jsx(De,{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50",title:"Time-based — leaves lag the reconcile cron",children:"Building"}):u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",title:"Event-driven — transitions in real time",children:"Live"})}function F_({bucketId:n}){const s=tt({queryKey:Ue.bucket(n),queryFn:()=>R_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-10 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data.bucket.feedsJourneys,r=P_(s.data.bucket.maxDwell);return u.jsxs("div",{className:"space-y-3",children:[r?u.jsxs(De,{variant:"outline",title:"Members are force-removed maxDwell after joining, regardless of criteria.",children:["Time-boxed · ",r]}):null,i.length===0?u.jsxs("div",{className:"space-y-1 text-sm text-white/60",children:[u.jsxs("p",{children:["No journeys are bound to this bucket's transitions yet. Bind one to THIS bucket with the typed refs"," ",u.jsx("code",{className:"text-xs",children:"bucket.entered"})," /"," ",u.jsx("code",{className:"text-xs",children:"bucket.left"})," (e.g."," ",u.jsx("code",{className:"text-xs",children:"{ trigger: { event: bucket.entered } }"}),"), or colocate a reaction with"," ",u.jsx("code",{className:"text-xs",children:'bucket.on("enter", ...)'}),"."]}),u.jsxs("p",{children:["To react to ANY bucket, use the generic"," ",u.jsx("code",{className:"text-xs",children:"Events.BUCKET_ENTERED"})," /"," ",u.jsx("code",{className:"text-xs",children:"Events.BUCKET_LEFT"})," constants."]})]}):u.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(c=>u.jsxs(De,{variant:c.owned?"default":"secondary",title:c.trigger,children:[c.name,c.owned?u.jsx("span",{className:"ml-1.5 text-[10px] uppercase tracking-[0.04em] text-white/50",children:"owned"}):null]},`${c.id}-${c.trigger}`))})]})}const I_={delivered:{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80"},opened:{variant:"outline",className:"border-white/20 bg-white/[0.08] text-white/90"},clicked:{variant:"outline",className:"border-white/30 bg-white/[0.12] text-white"},sent:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},rendered:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},queued:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},bounced:{variant:"destructive"},complained:{variant:"destructive"},failed:{variant:"destructive"}};function Yr({status:n}){const s=I_[n]??{variant:"outline"};return u.jsx(De,{variant:s.variant,className:Fe("capitalize",s.className),children:n})}function Eb({open:n,onClose:s,title:i,description:r,children:c,className:d}){return V.useEffect(()=>{if(!n)return;const h=y=>{y.key==="Escape"&&s()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n,s]),n?u.jsxs("div",{className:"fixed inset-0 z-50",children:[u.jsx("button",{type:"button","aria-label":"Close panel",className:"absolute inset-0 bg-black/60",onClick:s}),u.jsxs("div",{role:"dialog","aria-modal":"true",className:Fe("absolute inset-y-0 right-0 flex w-full max-w-2xl flex-col border-l border-white/10 bg-raised text-white shadow-black/50 shadow-xl",d),children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-hairline-faint p-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h2",{className:"font-display text-lg leading-none tracking-[-0.02em] text-white",children:i}),r?u.jsx("p",{className:"break-all text-sm text-white/60",children:r}):null]}),u.jsx(je,{variant:"ghost",size:"icon",className:"-mr-2 -mt-2 h-8 w-8 shrink-0",onClick:s,"aria-label":"Close",children:u.jsx(_h,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:c})]})]}):null}const J_={event:Eh,journey:Rh,email:bb};function $_({entry:n}){const s=J_[n.type],i=n.data,r=n.type==="event"?String(i.event??"event"):n.type==="journey"?`${String(i.journeyId??"journey")} · ${String(i.status??"")}`:String(i.subject??i.templateKey??"email");return u.jsxs("li",{className:"flex gap-3",children:[u.jsx("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-hairline-faint bg-white/[0.04]",children:u.jsx(s,{className:"h-3.5 w-3.5 text-white/50",strokeWidth:1.5})}),u.jsxs("div",{className:"min-w-0 flex-1 pb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"truncate text-sm font-medium text-white",children:r}),n.type==="email"&&i.status?u.jsx(Yr,{status:String(i.status)}):null]}),u.jsx("p",{className:"text-xs text-white/50",children:En(n.timestamp)})]})]})}function W_({contactId:n,onClose:s}){var N,R;const i=n!==null,{toast:r}=Cn(),c=Jn(),[d,h]=V.useState(!1),y=tt({queryKey:n?Ue.contact(n):["contact","none"],queryFn:()=>M_(n),enabled:i}),p=tt({queryKey:n?Ue.contactActivity(n):["activity","none"],queryFn:()=>A_(n),enabled:i}),m=tt({queryKey:n?Ue.contactTimeline(n):["timeline","none"],queryFn:()=>O_(n),enabled:i}),b=hn({mutationFn:()=>_b(n,{suppressed:!1}),onSuccess:()=>{r({title:"Contact un-suppressed",description:"They can receive emails again."}),h(!1),n&&c.invalidateQueries({queryKey:Ue.contact(n)}),c.invalidateQueries({queryKey:["suppressions"]})},onError:j=>{r({variant:"error",title:"Un-suppress failed",description:j instanceof At?j.message:"Unexpected error."}),h(!1)}}),v=(N=y.data)==null?void 0:N.contact,x=(R=y.data)==null?void 0:R.preferences,w=(x==null?void 0:x.suppressed)||(x==null?void 0:x.unsubscribedAll);return u.jsxs(u.Fragment,{children:[u.jsx(Eb,{open:i,onClose:s,title:(v==null?void 0:v.email)??(v==null?void 0:v.externalId)??"Contact",description:v?v.externalId:void 0,children:y.isPending?u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ut,{className:"h-24 w-full"}),u.jsx(Ut,{className:"h-40 w-full"})]}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):v?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x!=null&&x.suppressed?u.jsx(De,{variant:"destructive",children:"Suppressed"}):null,x!=null&&x.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Unsubscribed"}):null,x&&x.bounceCount>0?u.jsxs(De,{variant:"secondary",children:[x.bounceCount," bounce",x.bounceCount===1?"":"s"]}):null,w?null:u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Subscribed"}),w?u.jsx(je,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>h(!0),children:"Un-suppress"}):null]}),u.jsxs("dl",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"text-xs text-white/50",children:"First seen"}),u.jsx("dd",{className:"text-sm text-white",children:En(v.firstSeenAt)})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-xs text-white/50",children:"Last seen"}),u.jsx("dd",{className:"text-sm text-white",children:En(v.lastSeenAt)})]})]}),u.jsxs("section",{children:[u.jsxs("h3",{className:"eyebrow mb-3 text-white/50",children:["Email activity",p.data?` (${p.data.total})`:""]}),p.isPending?u.jsx(Ut,{className:"h-20 w-full"}):p.isError?u.jsx("p",{className:"text-sm text-white/60",children:"Could not load email activity."}):p.data&&p.data.sends.length>0?u.jsx("ul",{className:"space-y-2",children:p.data.sends.slice(0,10).map(j=>u.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border bg-white/[0.015] p-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"truncate text-sm font-medium text-white",children:j.subject}),u.jsx("p",{className:"text-xs text-white/50",children:En(j.createdAt)})]}),u.jsx(Yr,{status:j.status})]},j.id))}):u.jsx("p",{className:"text-sm text-white/60",children:"No emails sent."})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"eyebrow mb-3 text-white/50",children:"Timeline"}),m.isPending?u.jsx(Ut,{className:"h-20 w-full"}):m.isError?u.jsx("p",{className:"text-sm text-white/60",children:"Could not load timeline."}):m.data&&m.data.timeline.length>0?u.jsx("ul",{children:m.data.timeline.map((j,k)=>u.jsx($_,{entry:j},`${j.type}-${j.timestamp}-${k}`))}):u.jsx("p",{className:"text-sm text-white/60",children:"No activity yet."})]})]}):null}),u.jsx(mi,{open:d,onClose:()=>h(!1),onConfirm:()=>b.mutate(),title:"Un-suppress this contact?",description:"They will be eligible to receive emails again.",confirmLabel:"Un-suppress",loading:b.isPending})]})}function eE(){var p;const[n,s]=V.useState(""),[i,r]=V.useState(""),[c,d]=V.useState(null);V.useEffect(()=>{const m=window.setTimeout(()=>r(n.trim()),300);return()=>window.clearTimeout(m)},[n]);const h=tt({queryKey:Ue.contacts(i),queryFn:()=>T_(i||void 0),placeholderData:fh}),y=((p=h.data)==null?void 0:p.contacts)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Contacts",description:"Search contacts and review their full activity timeline."}),u.jsxs("div",{className:"relative max-w-sm",children:[u.jsx(PR,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-white/40",strokeWidth:1.5}),u.jsx(vt,{placeholder:"Search by email or external ID…",className:"pl-9",value:n,onChange:m=>s(m.target.value)})]}),h.isPending?u.jsx(hi,{}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):y.length===0?u.jsx(In,{title:"No contacts found",description:i?"No contacts match your search.":"Contacts appear here as events are ingested."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Email"}),u.jsx(Se,{children:"External ID"}),u.jsx(Se,{className:"text-right",children:"Last seen"})]})}),u.jsx(ws,{children:y.map(m=>u.jsxs(Ht,{className:"cursor-pointer",onClick:()=>d(m.id),children:[u.jsx(be,{className:"font-medium text-white",children:m.email??"—"}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:m.externalId}),u.jsx(be,{className:"text-right text-white/60",children:V_(m.lastSeenAt)})]},m.id))})]})}),u.jsx(W_,{contactId:c,onClose:()=>d(null)})]})}function Rt({className:n,...s}){return u.jsx("label",{className:Fe("text-sm font-medium leading-none text-white/80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...s})}function Hv(){return`test_${Math.random().toString(36).slice(2,10)}`}function tE(n){const s=n.trim();if(!s)return{ok:!0,value:{}};try{const i=JSON.parse(s);return i===null||typeof i!="object"||Array.isArray(i)?{ok:!1,error:"Properties must be a JSON object."}:{ok:!0,value:i}}catch(i){return{ok:!1,error:i instanceof Error?i.message:"Invalid JSON."}}}function nE(){const{toast:n}=Cn(),[s,i]=V.useState(""),[r,c]=V.useState(Hv),[d,h]=V.useState(""),[y,p]=V.useState("{}"),[m,b]=V.useState(null),[v,x]=V.useState(null),w=tt({queryKey:Ue.journeys,queryFn:Rb}),N=V.useMemo(()=>{var B;const A=new Map;for(const C of((B=w.data)==null?void 0:B.journeys)??[]){const Q=A.get(C.trigger.event)??[];Q.push(C.name),A.set(C.trigger.event,Q)}return Array.from(A,([C,Q])=>({event:C,journeys:Q}))},[w.data]),R=hn({mutationFn:A=>L_(A),onSuccess:A=>{x(A),n({title:"Event ingested",description:`Stored: ${A.stored} · ${A.exits.length} journey exit(s).`})},onError:A=>{n({variant:"error",title:"Ingest failed",description:A instanceof At?A.message:"Unexpected error."})}}),j=()=>{const A=tE(y);if(!A.ok){b(A.error);return}b(null),R.mutate({event:s.trim(),userId:r.trim(),userEmail:d.trim()||void 0,properties:A.value})},k=!!s.trim()&&!!r.trim()&&!R.isPending;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Debug",description:"Fire events into the ingest pipeline — exactly what real events do. Trigger journeys locally without a PostHog tunnel."}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[u.jsxs(Lt,{className:"lg:col-span-2",children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Send a test event"}),u.jsxs(bs,{children:["POSTs to ",u.jsx("code",{className:"text-xs",children:"/v1/ingest"}),". Journeys whose trigger matches will enrol this user."]})]}),u.jsxs(qt,{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"event",children:"Event name"}),u.jsx(vt,{id:"event",list:"event-presets",placeholder:"e.g. user.created",value:s,onChange:A=>i(A.target.value)}),u.jsx("datalist",{id:"event-presets",children:N.map(A=>u.jsx("option",{value:A.event},A.event))})]}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"userId",children:"User ID"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(vt,{id:"userId",placeholder:"test_user",value:r,onChange:A=>c(A.target.value)}),u.jsx(je,{variant:"outline",size:"icon",title:"Generate a random test user ID",onClick:()=>c(Hv()),children:u.jsx(JR,{className:"h-4 w-4"})})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"userEmail",children:"User email (optional)"}),u.jsx(vt,{id:"userEmail",type:"email",placeholder:"you@example.com",value:d,onChange:A=>h(A.target.value)})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"props",children:"Properties (JSON)"}),u.jsx("textarea",{id:"props",spellCheck:!1,className:"flex min-h-[140px] w-full rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-2 font-mono text-sm text-white transition-colors duration-200 placeholder:text-white/40 hover:border-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",value:y,onChange:A=>{p(A.target.value),m&&b(null)}}),m?u.jsx("p",{className:"text-xs text-accent",children:m}):null]}),u.jsx("div",{className:"flex justify-end",children:u.jsxs(je,{onClick:j,disabled:!k,children:[u.jsx(Eh,{className:"h-4 w-4"}),R.isPending?"Sending…":"Send event"]})})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Lt,{children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Journey triggers"}),u.jsx(bs,{children:"Events that enrol a registered journey. Click to fill the form."})]}),u.jsx(qt,{children:N.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No journeys registered yet. Any event name still works — define a journey to see triggers here."}):u.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(A=>u.jsx(je,{variant:"outline",size:"sm",title:`Triggers: ${A.journeys.join(", ")}`,onClick:()=>i(A.event),children:A.event},A.event))})})]}),v?u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"flex items-center gap-2 text-base",children:[u.jsx(yb,{className:"h-4 w-4 text-white/90"}),"Result"]})}),u.jsxs(qt,{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(De,{variant:v.stored?"default":"secondary",children:v.stored?"Stored":"Not stored"}),u.jsxs("span",{className:"text-sm text-white/60",children:[v.exits.length," journey exit(s)"]})]}),u.jsx("pre",{className:"max-h-48 overflow-auto rounded-md border border-hairline-faint bg-white/[0.04] p-3 font-mono text-xs text-white/90",children:JSON.stringify(v,null,2)}),u.jsxs("p",{className:"text-sm text-white/60",children:["See the effect in"," ",u.jsx(jl,{to:"/journeys",className:"text-white transition-colors duration-200 hover:text-white/80",children:"Journeys"})," ","or the"," ",u.jsx(jl,{to:"/contacts",className:"text-white transition-colors duration-200 hover:text-white/80",children:"contact's timeline"}),". Make sure the worker is running."]})]})]}):null]})]})]})}const aE={webhook:"Webhook",gateway:"Gateway",poll:"Poll"};function sE({transport:n}){return u.jsx(De,{variant:"secondary",className:"font-mono text-[11px]",children:aE[n]})}function iE({credential:n}){return n!=null&&n.connected?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Connected"}):u.jsx(De,{variant:"outline",className:"text-white/50",children:"Not connected"})}function lE({integration:n}){return u.jsxs("div",{className:"flex flex-wrap gap-1",children:[n.hasConnector?u.jsx(De,{variant:"outline",className:"text-white/60",children:"Inbound"}):null,n.hasDestination?u.jsx(De,{variant:"outline",className:"text-white/60",children:"Outbound"}):null]})}function Cb({label:n,value:s}){const{toast:i}=Cn();return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"shrink-0 text-white/50",children:n}),u.jsx("code",{className:"flex-1 truncate rounded border border-hairline-faint bg-white/[0.04] px-2 py-1 font-mono text-white/70",children:s}),u.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`Copy ${n}`,onClick:()=>{navigator.clipboard.writeText(s).then(()=>{i({title:"Copied",description:`${n} copied.`})})},children:u.jsx(Nh,{className:"h-3.5 w-3.5",strokeWidth:1.5})})]})}const rE=[{bit:2,label:"Members"},{bit:256,label:"Presence"},{bit:512,label:"Messages"},{bit:1024,label:"Reactions"},{bit:32768,label:"Message content"}];function oE({intents:n}){const s=rE.filter(i=>(n&i.bit)!==0);return s.length===0?null:u.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(i=>u.jsx(De,{variant:"secondary",className:"text-[11px]",children:i.label},i.label))})}function Qv({label:n,value:s}){return u.jsxs("div",{className:"rounded-md border border-hairline-faint bg-white/[0.015] px-3 py-2",children:[u.jsx("p",{className:"font-display text-lg text-white tabular-nums",children:s}),u.jsx("p",{className:"text-[11px] text-white/50",children:n})]})}function cE({integration:n,connectInfo:s}){var d;const i=n.gateway,r=!!((d=n.credential)!=null&&d.connected),c=(s==null?void 0:s.installUrl)??null;return u.jsxs("div",{className:"space-y-4",children:[r?null:u.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-tint p-3 text-xs text-white/70",children:[u.jsx("p",{className:"font-medium text-accent",children:"Connect via CLI"}),u.jsxs("p",{className:"mt-1",children:["Discord secrets are pasted through the CLI — Studio never stores tokens. Run"," ",u.jsx("code",{className:"rounded bg-white/[0.06] px-1 py-0.5 font-mono",children:"hogsend connect discord"})," ","to paste the bot token + client secret, then return here to invite the bot."]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-xs text-white/50",children:"Bot:"}),(i==null?void 0:i.botInstalled)===!0?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Installed"}):(i==null?void 0:i.botInstalled)===!1?u.jsx(De,{variant:"outline",className:"text-white/50",children:"Not installed"}):u.jsx(De,{variant:"outline",className:"text-white/40",children:"Unknown"}),u.jsx("span",{className:"text-xs text-white/50",children:"Worker:"}),i!=null&&i.workerHealthy?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Online"}):u.jsx(De,{variant:"outline",className:"text-white/50",children:"Offline"})]}),i!=null&&i.guildId?u.jsx(Cb,{label:"Guild",value:i.guildId}):null,i!=null&&i.intents?u.jsx(oE,{intents:i.intents}):null,i?u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsx(Qv,{label:"Linked members",value:i.linkedMembers}),u.jsx(Qv,{label:"Unlinked members",value:i.unlinkedMembers})]}):null,c?u.jsx("a",{href:c,target:"_blank",rel:"noreferrer",children:u.jsxs(je,{variant:"secondary",size:"sm",className:"w-full",children:[u.jsx(Kc,{className:"h-4 w-4",strokeWidth:1.5}),i!=null&&i.botInstalled?"Re-invite bot":"Invite bot",u.jsx(wh,{className:"ml-auto h-3.5 w-3.5 opacity-60"})]})}):null]})}function uE({integration:n}){const s=n.webhook;return s?u.jsxs("div",{className:"space-y-3",children:[u.jsx(Cb,{label:"URL",value:s.url}),u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-white/50",children:"Verify secret:"}),s.secretConfigured?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Configured"}):u.jsx(De,{variant:"destructive",children:"Open — no secret"})]})]}):null}function fE({integration:n,connectInfo:s,onDisconnect:i}){var d,h;const r=n.id==="discord",c=!!((d=n.credential)!=null&&d.connected);return u.jsxs(Lt,{className:"flex flex-col",children:[u.jsxs(Bt,{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[n.transport==="webhook"?u.jsx(a_,{className:"h-4 w-4 text-white/40",strokeWidth:1.5}):u.jsx(Kc,{className:"h-4 w-4 text-white/40",strokeWidth:1.5}),u.jsx($t,{children:n.name})]}),u.jsx(iE,{credential:n.credential})]}),n.description?u.jsx("p",{className:"text-sm text-white/60",children:n.description}):null,u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(sE,{transport:n.transport}),u.jsx(lE,{integration:n})]})]}),u.jsxs(qt,{className:"flex-1 space-y-4",children:[r?u.jsx(cE,{integration:n,connectInfo:s}):n.transport==="webhook"?u.jsx(uE,{integration:n}):null,(h=n.credential)!=null&&h.updatedAt?u.jsxs("p",{className:"text-[11px] text-white/40",children:["Connected ",En(n.credential.updatedAt)]}):null,c?u.jsx(je,{variant:"outline",size:"sm",className:"w-full",onClick:()=>i(n),children:"Disconnect"}):null]})]})}function dE(){var p;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),c=tt({queryKey:Ue.integrations,queryFn:H_}),d=tt({queryKey:Ue.discordConnectInfo,queryFn:Q_,retry:!1}),h=hn({mutationFn:m=>G_(m),onSuccess:()=>{n({title:"Integration disconnected"}),r(null),s.invalidateQueries({queryKey:Ue.integrations}),s.invalidateQueries({queryKey:Ue.discordConnectInfo})},onError:m=>{n({variant:"error",title:"Disconnect failed",description:m instanceof At?m.message:"Unexpected error."}),r(null)}}),y=((p=c.data)==null?void 0:p.integrations)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Integrations",description:"Code-registered connectors and destinations. Connect via the CLI, then observe and manage here.",action:u.jsxs(je,{variant:"outline",size:"sm",onClick:()=>c.refetch(),disabled:c.isFetching,children:[u.jsx(xb,{className:"h-4 w-4"}),c.isFetching?"Refreshing…":"Refresh"]})}),c.isPending?u.jsx(Nb,{count:4}):c.isError?u.jsx(_t,{error:c.error,onRetry:()=>c.refetch()}):y.length===0?u.jsx(In,{icon:Kc,title:"No integrations registered",description:"Register a connector or destination in code, then it appears here to connect.",action:u.jsx("a",{href:"https://docs.hogsend.com/docs/guides/events",target:"_blank",rel:"noreferrer",children:u.jsxs(je,{variant:"outline",size:"sm",children:[u.jsx(bR,{className:"h-4 w-4"}),"Connector docs"]})})}):u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:y.map(m=>u.jsx(fE,{integration:m,connectInfo:m.id==="discord"?d.data:void 0,onDisconnect:r},m.id))}),u.jsx(mi,{open:i!==null,onClose:()=>r(null),onConfirm:()=>i&&h.mutate(i.id),title:"Disconnect this integration?",description:i?`Purges all stored credentials for "${i.name}" — the OAuth grant and any derived config. The bot stays in your server until you remove it there. This cannot be undone.`:void 0,confirmLabel:"Disconnect",destructive:!0,loading:h.isPending})]})}function hE({step:n,base:s}){const i=s>0?n.value/s:0,r=i*100;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"font-medium text-white/80",children:n.label}),u.jsxs("span",{className:"text-white/60",children:[ft(n.value),s>0?u.jsxs("span",{className:"ml-1 text-xs text-white/50",children:["(",Nl(i),")"]}):null]})]}),u.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/[0.06]",children:u.jsx("div",{className:"h-full rounded-full bg-white/40",style:{width:`${Math.min(r,100)}%`}})})]})}function mE({journeyId:n}){const s=tt({queryKey:Ue.journeyFunnel(n),queryFn:()=>j_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-48 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data,r=[{label:"Enrolled",value:i.enrolled},{label:"Email sent",value:i.emailSent},{label:"Opened",value:i.emailOpened},{label:"Clicked",value:i.emailClicked},{label:"Completed",value:i.completed}];return u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"space-y-3",children:r.map(c=>u.jsx(hE,{step:c,base:i.enrolled},c.label))}),u.jsxs("div",{className:"flex gap-4 border-t pt-3 text-sm text-white/60",children:[u.jsxs("span",{children:["Failed: ",ft(i.failed)]}),u.jsxs("span",{children:["Exited: ",ft(i.exited)]})]})]})}function pE(){var N,R;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),[c,d]=V.useState(null),h=tt({queryKey:Ue.journeyMetrics,queryFn:S_}),y=tt({queryKey:Ue.journeys,queryFn:Rb}),p=hn({mutationFn:j=>w_(j.id,j.enabled),onSuccess:(j,k)=>{n({title:k.enabled?"Journey enabled":"Journey disabled"}),d(null),s.invalidateQueries({queryKey:Ue.journeys}),s.invalidateQueries({queryKey:Ue.journeyMetrics})},onError:j=>{n({variant:"error",title:"Update failed",description:j instanceof At?j.message:"Unexpected error."}),d(null)}}),m=h.isPending||y.isPending,b=h.isError||y.isError,v=new Map((((N=y.data)==null?void 0:N.journeys)??[]).map(j=>[j.id,j.enabled])),x=(((R=h.data)==null?void 0:R.journeys)??[]).map(j=>({...j,enabled:v.get(j.journeyId)??!1})),w=x.find(j=>j.journeyId===i)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Journeys",description:"Lifecycle journeys, completion rates, and per-journey funnels."}),m?u.jsx(hi,{}):b?u.jsx(_t,{error:h.error??y.error,onRetry:()=>{h.refetch(),y.refetch()}}):x.length===0?u.jsx(In,{title:"No journeys registered",description:"Journeys are defined in code with defineJourney(). Add one to your app, then fire its trigger event from Debug to see it here.",action:u.jsxs(u.Fragment,{children:[u.jsx(wl,{href:ui.journeys,children:"How to create a journey"}),u.jsx(wl,{href:ui.recipes,variant:"ghost",children:"Recipes"})]})}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Journey"}),u.jsx(Se,{className:"text-right",children:"Enrolled"}),u.jsx(Se,{className:"text-right",children:"Active"}),u.jsx(Se,{className:"text-right",children:"Completed"}),u.jsx(Se,{className:"text-right",children:"Completion"}),u.jsx(Se,{className:"text-right",children:"Avg duration"}),u.jsx(Se,{children:"State"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:x.map(j=>u.jsxs(Ht,{className:"cursor-pointer","data-state":j.journeyId===i?"selected":void 0,onClick:()=>r(k=>k===j.journeyId?null:j.journeyId),children:[u.jsxs(be,{children:[u.jsx("span",{className:"font-medium text-white",children:j.name}),u.jsx("span",{className:"block font-mono text-xs text-white/70",children:j.journeyId})]}),u.jsx(be,{className:"text-right",children:ft(j.enrolled)}),u.jsx(be,{className:"text-right",children:ft(j.active)}),u.jsx(be,{className:"text-right",children:ft(j.completed)}),u.jsx(be,{className:"text-right",children:Nl(j.completionRate)}),u.jsx(be,{className:"text-right text-white/60",children:Ch(j.avgDurationSecs)}),u.jsx(be,{children:u.jsx(De,{variant:j.enabled?"default":"secondary",children:j.enabled?"Enabled":"Disabled"})}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:k=>{k.stopPropagation(),d(j)},children:j.enabled?"Disable":"Enable"})})]},j.journeyId))})]})}),w?u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{children:[w.name," — funnel"]})}),u.jsx(qt,{children:u.jsx(mE,{journeyId:w.journeyId})})]}):null,u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&p.mutate({id:c.journeyId,enabled:!c.enabled}),title:c!=null&&c.enabled?"Disable this journey?":"Enable this journey?",description:c!=null&&c.enabled?"New events will stop enrolling users into this journey.":"New matching events will start enrolling users into this journey.",confirmLabel:c!=null&&c.enabled?"Disable":"Enable",destructive:c==null?void 0:c.enabled,loading:p.isPending})]})}function Xs({label:n,value:s,hint:i,icon:r}){return u.jsxs(Lt,{children:[u.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx("span",{className:"eyebrow text-white/50",children:n}),r?u.jsx(r,{strokeWidth:1.5,className:"h-4 w-4 text-white/30"}):null]}),u.jsxs(qt,{children:[u.jsx("div",{className:"font-display text-[28px] leading-none text-white tracking-[-0.02em]",children:s}),i?u.jsx("p",{className:"mt-2 text-xs text-white/50",children:i}):null]})]})}function yE(n){return n.totalContacts===0&&n.activeJourneys===0&&n.emailsSent30d===0}function gE(){return u.jsxs(Lt,{className:"border-accent/40 bg-accent-tint hover:border-accent/40",children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Welcome to Hogsend Studio"}),u.jsx(bs,{children:"Studio observes your code-first lifecycle engine. Here's the path to your first running journey."})]}),u.jsxs(qt,{className:"space-y-4",children:[u.jsxs("ol",{className:"space-y-1.5 text-sm text-white/60",children:[u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"1."})," Define a journey in code and start the worker."]}),u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"2."})," Fire its trigger event to enrol a test user."]}),u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"3."})," Watch enrolments, sends, and exits land here."]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsxs(jl,{to:"/debug",className:Fe(jh({size:"sm"})),children:[u.jsx(Eh,{className:"h-4 w-4"}),"Send a test event"]}),u.jsx(wl,{href:ui.quickstart,children:"Quickstart"}),u.jsx(wl,{href:ui.journeys,variant:"ghost",children:"Create a journey"})]})]})]})}function vE(){const n=tt({queryKey:Ue.overview,queryFn:h_});return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Overview",description:"Key delivery and engagement metrics at a glance."}),n.isPending?u.jsx(Nb,{count:6}):n.isError?u.jsx(_t,{error:n.error,onRetry:()=>n.refetch()}):u.jsxs(u.Fragment,{children:[yE(n.data)?u.jsx(gE,{}):null,u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[u.jsx(Xs,{label:"Total contacts",value:ft(n.data.totalContacts),icon:jb}),u.jsx(Xs,{label:"Active journeys",value:ft(n.data.activeJourneys),hint:"Instances active or waiting",icon:Rh}),u.jsx(Xs,{label:"Sent (24h)",value:ft(n.data.emailsSent24h),icon:Pr}),u.jsx(Xs,{label:"Sent (7d)",value:ft(n.data.emailsSent7d),icon:Bv}),u.jsx(Xs,{label:"Sent (30d)",value:ft(n.data.emailsSent30d),icon:Bv}),u.jsx(Xs,{label:"Bounce rate (30d)",value:Nl(n.data.bounceRate30d),hint:"Bounced / sent in last 30 days",icon:vb})]}),u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.jsx(Xs,{label:"Unsubscribe rate",value:Nl(n.data.unsubscribeRate),hint:"Unsubscribed / total preferences",icon:e_})})]})]})}const Gc=V.forwardRef(({className:n,children:s,...i},r)=>u.jsxs("div",{className:"relative",children:[u.jsx("select",{ref:r,className:Fe("flex h-9 w-full appearance-none rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-1 pr-8 text-sm text-white transition-colors duration-200 hover:border-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50 [&>option]:bg-raised [&>option]:text-white",n),...i,children:s}),u.jsx(dR,{className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-white/40"})]}));Gc.displayName="Select";const bE={queued:Sb,sent:Pr,delivered:uR,opened:SR,clicked:BR,bounced:vb,complained:pb,failed:gb};function xE({event:n}){const s=bE[n.type]??Sb;return u.jsxs("li",{className:"flex gap-3",children:[u.jsxs("div",{className:"flex flex-col items-center",children:[u.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-hairline-faint bg-white/[0.04]",children:u.jsx(s,{strokeWidth:1.5,className:"h-3.5 w-3.5 text-white/50"})}),u.jsx("span",{className:"w-px flex-1 bg-white/[0.08]"})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("p",{className:"text-sm font-medium capitalize text-white",children:n.type}),u.jsx("p",{className:"text-xs text-white/50",children:En(n.timestamp)}),n.url?u.jsx("p",{className:"mt-0.5 break-all text-xs text-white/50",children:n.url}):null]})]})}function ts({label:n,value:s,mono:i=!1}){return u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("dt",{className:"text-xs text-white/50",children:n}),u.jsx("dd",{className:i?"break-all font-mono text-xs text-white/70":"break-all text-sm text-white",children:s})]})}function SE({emailId:n,onClose:s}){const i=n!==null,{toast:r}=Cn(),c=Jn(),[d,h]=V.useState(!1),y=tt({queryKey:n?Ue.email(n):["email","none"],queryFn:()=>p_(n),enabled:i}),p=hn({mutationFn:()=>y_(n),onSuccess:()=>{r({title:"Resend queued",description:"A fresh send was queued from this template."}),h(!1),c.invalidateQueries({queryKey:["emails"]}),n&&c.invalidateQueries({queryKey:Ue.email(n)})},onError:v=>{r({variant:"error",title:"Resend failed",description:v instanceof At?v.message:"Unexpected error."}),h(!1)}}),m=y.data,b=m&&["failed","bounced"].includes(m.email.status);return u.jsxs(u.Fragment,{children:[u.jsx(Eb,{open:i,onClose:s,title:"Email send",description:m==null?void 0:m.email.subject,children:y.isPending?u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ut,{className:"h-24 w-full"}),u.jsx(Ut,{className:"h-40 w-full"})]}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):m?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(Yr,{status:m.email.status}),b?u.jsxs(je,{size:"sm",variant:"outline",onClick:()=>h(!0),children:[u.jsx(Pr,{className:"h-4 w-4"}),"Resend"]}):null]}),u.jsxs("dl",{className:"grid grid-cols-2 gap-4",children:[u.jsx(ts,{label:"To",value:m.email.toEmail,mono:!0}),u.jsx(ts,{label:"From",value:m.email.fromEmail,mono:!0}),u.jsx(ts,{label:"Template",value:m.email.templateKey??"—"}),u.jsx(ts,{label:"Category",value:m.email.category??"—"}),u.jsx(ts,{label:"Journey",value:m.email.journeyId??"—",mono:!0}),u.jsx(ts,{label:"User",value:m.email.userId??"—",mono:!0}),u.jsx(ts,{label:"Message ID",value:m.email.messageId??"—",mono:!0}),u.jsx(ts,{label:"Created",value:En(m.email.createdAt)})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"eyebrow mb-3 text-white/50",children:"Timeline"}),m.events.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No delivery events recorded yet."}):u.jsx("ul",{className:"[&>li:last-child>div:first-child>span:last-child]:hidden",children:m.events.map((v,x)=>u.jsx(xE,{event:v},`${v.type}-${v.timestamp}-${x}`))})]}),u.jsxs("section",{children:[u.jsxs("h3",{className:"eyebrow mb-3 text-white/50",children:["Tracked links (",m.trackedLinks.length,")"]}),m.trackedLinks.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No tracked links in this email."}):u.jsx("ul",{className:"space-y-2",children:m.trackedLinks.map(v=>u.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border bg-white/[0.015] p-3",children:[u.jsx("span",{className:"break-all text-sm text-white/80",children:v.originalUrl}),u.jsxs("span",{className:"shrink-0 text-xs text-white/50",children:[v.clickCount," click",v.clickCount===1?"":"s"]})]},v.id))})]})]}):null}),u.jsx(mi,{open:d,onClose:()=>h(!1),onConfirm:()=>p.mutate(),title:"Resend this email?",description:"A new send will be queued from the original template and recipient.",confirmLabel:"Resend",loading:p.isPending})]})}const jE=["queued","rendered","sent","delivered","opened","clicked","bounced","complained","failed"],wE=["opened","clicked","bounced","complained"],Cr=25,Gv={templateKey:"",status:"",engagement:"",journeyId:"",userId:"",from:"",to:""};function NE(){var C,Q;const[n,s]=V.useState(Gv),[i,r]=V.useState("createdAt"),[c,d]=V.useState("desc"),[h,y]=V.useState(0),[p,m]=V.useState(null),b=n.from?new Date(`${n.from}T00:00:00`).toISOString():void 0,v=n.to?new Date(`${n.to}T23:59:59`).toISOString():void 0,x={limit:Cr,offset:h,templateKey:n.templateKey||void 0,status:n.status||void 0,engagement:n.engagement||void 0,journeyId:n.journeyId||void 0,userId:n.userId||void 0,from:b,to:v,sort:i,order:c},w=tt({queryKey:Ue.emails(x),queryFn:()=>m_(x),placeholderData:fh});function N(U){s(z=>({...z,...U})),y(0)}function R(U){i===U?d(z=>z==="asc"?"desc":"asc"):(r(U),d("desc")),y(0)}const j=Object.values(n).some(Boolean),k=((C=w.data)==null?void 0:C.total)??0,A=((Q=w.data)==null?void 0:Q.emails)??[];function B({column:U,label:z}){const O=i===U;return u.jsx(Se,{children:u.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 transition-colors duration-200 hover:text-white",onClick:()=>R(U),children:[z,O?c==="asc"?u.jsx(aR,{className:"h-3 w-3"}):u.jsx(eR,{className:"h-3 w-3"}):null]})})}return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Sends",description:"Every email sent — filter, sort, and drill into the timeline."}),u.jsxs("div",{className:"grid gap-3 rounded-lg border bg-white/[0.015] p-4 md:grid-cols-3 lg:grid-cols-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-template",children:"Template"}),u.jsx(vt,{id:"f-template",placeholder:"template key",value:n.templateKey,onChange:U=>N({templateKey:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-status",children:"Status"}),u.jsxs(Gc,{id:"f-status",value:n.status,onChange:U=>N({status:U.target.value}),children:[u.jsx("option",{value:"",children:"All"}),jE.map(U=>u.jsx("option",{value:U,children:U},U))]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-engagement",children:"Engagement"}),u.jsxs(Gc,{id:"f-engagement",value:n.engagement,onChange:U=>N({engagement:U.target.value}),children:[u.jsx("option",{value:"",children:"Any"}),wE.map(U=>u.jsx("option",{value:U,children:U},U))]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-journey",children:"Journey ID"}),u.jsx(vt,{id:"f-journey",placeholder:"journey id",value:n.journeyId,onChange:U=>N({journeyId:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-user",children:"User ID"}),u.jsx(vt,{id:"f-user",placeholder:"user id",value:n.userId,onChange:U=>N({userId:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-from",children:"From"}),u.jsx(vt,{id:"f-from",type:"date",value:n.from,onChange:U=>N({from:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-to",children:"To"}),u.jsx(vt,{id:"f-to",type:"date",value:n.to,onChange:U=>N({to:U.target.value})})]}),j?u.jsx("div",{className:"flex items-end",children:u.jsx(je,{variant:"ghost",size:"sm",onClick:()=>{s(Gv),y(0)},children:"Clear filters"})}):null]}),w.isPending?u.jsx(hi,{}):w.isError?u.jsx(_t,{error:w.error,onRetry:()=>w.refetch()}):A.length===0?u.jsx(In,{title:"No sends found",description:j?"Try widening or clearing your filters.":"Emails will appear here once your journeys start sending."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Recipient"}),u.jsx(Se,{children:"Subject"}),u.jsx(Se,{children:"Template"}),u.jsx(Se,{children:"Status"}),u.jsx(B,{column:"sentAt",label:"Sent"}),u.jsx(B,{column:"createdAt",label:"Created"})]})}),u.jsx(ws,{children:A.map(U=>u.jsxs(Ht,{className:"cursor-pointer",onClick:()=>m(U.id),children:[u.jsx(be,{className:"font-medium text-white",children:U.toEmail}),u.jsx(be,{className:"text-white/80",children:Y_(U.subject,40)}),u.jsx(be,{className:"text-white/60",children:U.templateKey??"—"}),u.jsx(be,{children:u.jsx(Yr,{status:U.status})}),u.jsx(be,{className:"text-white/60",children:En(U.sentAt)}),u.jsx(be,{className:"text-white/60",children:En(U.createdAt)})]},U.id))})]})}),k>0?u.jsxs("div",{className:"flex items-center justify-between text-sm text-white/60",children:[u.jsxs("span",{children:[h+1,"–",Math.min(h+Cr,k)," of ",k]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(je,{variant:"outline",size:"sm",disabled:h===0,onClick:()=>y(U=>Math.max(0,U-Cr)),children:"Previous"}),u.jsx(je,{variant:"outline",size:"sm",disabled:h+Cr>=k,onClick:()=>y(U=>U+Cr),children:"Next"})]})]}):null,u.jsx(SE,{emailId:p,onClose:()=>m(null)})]})}const RE=["read","journey-admin","full-admin"];function _E(){var A;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(!1),[c,d]=V.useState(""),[h,y]=V.useState(["read"]),[p,m]=V.useState(null),[b,v]=V.useState(null),x=tt({queryKey:Ue.apiKeys,queryFn:z_}),w=hn({mutationFn:()=>D_({name:c.trim(),scopes:h}),onSuccess:B=>{r(!1),d(""),y(["read"]),m(B),s.invalidateQueries({queryKey:Ue.apiKeys})},onError:B=>{n({variant:"error",title:"Could not create key",description:B instanceof At?B.message:"Unexpected error."})}}),N=hn({mutationFn:B=>U_(B),onSuccess:()=>{n({title:"API key revoked"}),v(null),s.invalidateQueries({queryKey:Ue.apiKeys})},onError:B=>{n({variant:"error",title:"Revoke failed",description:B instanceof At?B.message:"Unexpected error."}),v(null)}});function R(B){y(C=>C.includes(B)?C.filter(Q=>Q!==B):[...C,B])}async function j(B){try{await navigator.clipboard.writeText(B),n({title:"Copied to clipboard"})}catch{n({variant:"error",title:"Copy failed"})}}const k=((A=x.data)==null?void 0:A.keys)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Settings",description:"API keys for programmatic access to the Hogsend admin API.",action:u.jsxs(je,{onClick:()=>r(!0),children:[u.jsx(QR,{className:"h-4 w-4"}),"New API key"]})}),x.isPending?u.jsx(hi,{}):x.isError?u.jsx(_t,{error:x.error,onRetry:()=>x.refetch()}):k.length===0?u.jsx(In,{icon:TR,title:"No API keys",description:"Create a key to authenticate API and webhook requests."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Name"}),u.jsx(Se,{children:"Prefix"}),u.jsx(Se,{children:"Scopes"}),u.jsx(Se,{children:"Last used"}),u.jsx(Se,{children:"Status"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:k.map(B=>{const C=B.revokedAt!==null;return u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:B.name}),u.jsxs(be,{className:"font-mono text-xs text-white/70",children:[B.keyPrefix,"…"]}),u.jsx(be,{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:B.scopes.map(Q=>u.jsx(De,{variant:"secondary",children:Q},Q))})}),u.jsx(be,{className:"text-white/60",children:En(B.lastUsedAt)}),u.jsx(be,{children:C?u.jsx(De,{variant:"destructive",children:"Revoked"}):u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Active"})}),u.jsx(be,{className:"text-right",children:C?null:u.jsx(je,{variant:"outline",size:"sm",onClick:()=>v(B),children:"Revoke"})})]},B.id)})})]})}),u.jsxs(Qc,{open:i,onClose:()=>r(!1),title:"Create API key",description:"Choose a descriptive name and the scopes this key needs.",footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),u.jsx(je,{onClick:()=>w.mutate(),disabled:!c.trim()||h.length===0||w.isPending,children:w.isPending?"Creating…":"Create key"})]}),children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"key-name",children:"Name"}),u.jsx(vt,{id:"key-name",placeholder:"CI ingest key",value:c,onChange:B=>d(B.target.value)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Rt,{children:"Scopes"}),u.jsx("div",{className:"flex flex-col gap-2",children:RE.map(B=>u.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80",htmlFor:`scope-${B}`,children:[u.jsx("input",{id:`scope-${B}`,type:"checkbox",className:"h-4 w-4 rounded border-hairline-faint accent-accent",checked:h.includes(B),onChange:()=>R(B)}),B]},B))})]})]}),u.jsx(Qc,{open:p!==null,onClose:()=>m(null),title:"API key created",description:"Copy this key now — it will not be shown again.",footer:u.jsx(je,{onClick:()=>m(null),children:"Done"}),children:p?u.jsxs("div",{className:"space-y-2",children:[u.jsx(Rt,{children:"Secret key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 break-all rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-2 font-mono text-xs text-white/90",children:p.key}),u.jsx(je,{variant:"outline",size:"icon",onClick:()=>j(p.key),"aria-label":"Copy key",children:u.jsx(Nh,{className:"h-4 w-4"})})]})]}):null}),u.jsx(mi,{open:b!==null,onClose:()=>v(null),onConfirm:()=>b&&N.mutate(b.id),title:"Revoke this API key?",description:b?`"${b.name}" will stop working immediately. This cannot be undone.`:void 0,confirmLabel:"Revoke",destructive:!0,loading:N.isPending})]})}const EE=/^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i,CE={verified:{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80"},pending:{variant:"secondary"},failed:{variant:"destructive"},not_found:{variant:"outline"}};function TE({state:n}){const s=CE[n];return u.jsx(De,{variant:s.variant,className:s.className,children:n.replace("_"," ")})}function ME({testMode:n}){return n.active?u.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-tint p-4 text-sm",children:[u.jsxs("p",{className:"font-medium text-accent",children:["Test mode is active",n.reason==="domain_unverified"?" — sending domain not verified":n.reason==="env_flag"?" — forced via HOGSEND_TEST_MODE":""]}),u.jsxs("p",{className:"mt-1 text-white/60",children:[n.redirectTo?`All sends are redirected to ${n.redirectTo}.`:"No redirect address is configured — sends will fail until one is set.",n.fromOverride?` From address is overridden to ${n.fromOverride}.`:""]})]}):null}function Vv({value:n}){const{toast:s}=Cn();return u.jsx(je,{variant:"ghost",size:"sm","aria-label":"Copy value",onClick:()=>{navigator.clipboard.writeText(n).then(()=>{s({title:"Copied",description:"Value copied to clipboard."})})},children:u.jsx(Nh,{className:"h-3.5 w-3.5",strokeWidth:1.5})})}function AE({onSubmit:n,loading:s}){const[i,r]=V.useState(""),c=EE.test(i);return u.jsxs("form",{className:"flex max-w-md items-end gap-2",onSubmit:d=>{d.preventDefault(),c&&n(i.toLowerCase())},children:[u.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx(Rt,{htmlFor:"setup-domain",children:"Sending domain"}),u.jsx(vt,{id:"setup-domain",placeholder:"mysite.com",value:i,onChange:d=>r(d.target.value)})]}),u.jsx(je,{type:"submit",disabled:!c||s,children:s?"Adding…":"Add domain"})]})}function OE(){var v,x,w;const{toast:n}=Cn(),s=Jn(),i=tt({queryKey:Ue.domain,queryFn:()=>qv()}),r=N=>{s.setQueryData(Ue.domain,N)},c=N=>R=>{n({variant:"error",title:N,description:R instanceof At?R.status===501?"The active email provider does not support domain management.":R.message:"Unexpected error."})},d=hn({mutationFn:()=>qv(!0),onSuccess:r,onError:c("Re-check failed")}),h=hn({mutationFn:()=>q_(),onSuccess:N=>{var R;r(N),n({title:"Verification pass triggered",description:((R=N.status)==null?void 0:R.state)==="verified"?"Domain is verified.":"DNS can take a few minutes — re-check shortly."})},onError:c("Verify failed")}),y=hn({mutationFn:N=>B_(N),onSuccess:N=>{r(N),n({title:"Domain registered",description:"Add the DNS records below at your DNS host."})},onError:c("Add domain failed")}),p=i.data,m=((v=p==null?void 0:p.status)==null?void 0:v.records)??[],b=(p==null?void 0:p.supported)===!0&&(p.status===null||p.status.state==="not_found");return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Setup",description:"Sending-domain verification — DNS records, status, and test mode.",action:p!=null&&p.supported?u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(je,{variant:"outline",size:"sm",onClick:()=>d.mutate(),disabled:d.isPending,children:[u.jsx(xb,{className:"h-4 w-4"}),d.isPending?"Checking…":"Re-check"]}),p.domain?u.jsxs(je,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:[u.jsx(FR,{className:"h-4 w-4"}),h.isPending?"Verifying…":"Verify"]}):null]}):null}),i.isPending?u.jsx(hi,{}):i.isError?u.jsx(_t,{error:i.error,onRetry:()=>i.refetch()}):p?p.supported?u.jsxs(u.Fragment,{children:[u.jsx(ME,{testMode:p.testMode}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2 rounded-lg border bg-white/[0.015] p-4 text-sm",children:[u.jsxs("span",{children:[u.jsx("span",{className:"text-white/60",children:"Domain: "}),u.jsx("span",{className:"font-medium text-white",children:p.domain??"not configured"})]}),u.jsxs("span",{children:[u.jsx("span",{className:"text-white/60",children:"Provider: "}),u.jsx("span",{className:"font-medium text-white",children:p.providerId})]}),u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-white/60",children:"State:"}),u.jsx(TE,{state:((x=p.status)==null?void 0:x.state)??"not_found"})]}),(w=p.status)!=null&&w.checkedAt?u.jsxs("span",{className:"text-white/50",children:["Checked ",En(p.status.checkedAt)]}):null]}),b?u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-white/60",children:p.domain?`${p.domain} isn't registered with ${p.providerId} yet — add it to get the DNS records.`:"No sending domain configured. Add one to get the DNS records to verify."}),u.jsx(AE,{onSubmit:N=>y.mutate(N),loading:y.isPending})]}):null,m.length>0?u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Type"}),u.jsx(Se,{children:"Name"}),u.jsx(Se,{children:"Value"}),u.jsx(Se,{className:"text-right",children:"Priority"}),u.jsx(Se,{children:"Purpose"}),u.jsx(Se,{children:"Status"})]})}),u.jsx(ws,{children:m.map(N=>u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:N.type}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:u.jsxs("span",{className:"flex items-center gap-1",children:[N.name,u.jsx(Vv,{value:N.name})]})}),u.jsx(be,{className:"max-w-[18rem] font-mono text-xs text-white/70",children:u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"truncate",title:N.value,children:N.value}),u.jsx(Vv,{value:N.value})]})}),u.jsx(be,{className:"text-right text-white/60",children:N.priority??""}),u.jsx(be,{className:"text-white/60",children:N.purpose}),u.jsx(be,{children:u.jsx(Yr,{status:N.status})})]},`${N.type}-${N.name}-${N.value}`))})]})}):b?null:u.jsx(In,{icon:lh,title:"No DNS records yet",description:"The provider hasn't reported any DNS records for this domain. Re-check, or verify it in the provider dashboard."})]}):u.jsx(In,{icon:lh,title:"Domain management not supported",description:`The active email provider (${p.providerId}) does not expose a domains API. Verify your sending domain in the provider's own dashboard instead.`}):null]})}const kE=[{value:"",label:"All"},{value:"bounced",label:"Bounced"},{value:"unsubscribed",label:"Unsubscribed"},{value:"complained",label:"Complained"}];function zE({row:n}){return u.jsxs("div",{className:"flex flex-wrap gap-1",children:[n.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Unsubscribed"}):null,n.bounceCount>0?u.jsxs(De,{variant:"secondary",children:[ft(n.bounceCount)," bounce"]}):null,n.suppressed&&n.bounceCount===0&&!n.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Complained"}):null,n.suppressed&&!n.unsubscribedAll&&n.bounceCount>0?u.jsx(De,{variant:"destructive",children:"Suppressed"}):null]})}function DE(){var m;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(""),[c,d]=V.useState(null),h=tt({queryKey:Ue.suppressions(i),queryFn:()=>k_(i||void 0),placeholderData:fh}),y=hn({mutationFn:b=>_b(b.userId,{suppressed:!1,unsubscribedAll:!1}),onSuccess:()=>{n({title:"Recipient restored",description:"They can receive emails again."}),d(null),s.invalidateQueries({queryKey:["suppressions"]})},onError:b=>{n({variant:"error",title:"Un-suppress failed",description:b instanceof At?b.message:"Unexpected error."}),d(null)}}),p=((m=h.data)==null?void 0:m.suppressions)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Suppressions",description:"Bounced, unsubscribed, and complained recipients."}),u.jsxs("div",{className:"flex max-w-xs flex-col gap-1.5",children:[u.jsx(Rt,{htmlFor:"supp-type",children:"Type"}),u.jsx(Gc,{id:"supp-type",value:i,onChange:b=>r(b.target.value),children:kE.map(b=>u.jsx("option",{value:b.value,children:b.label},b.value))})]}),h.isPending?u.jsx(hi,{}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):p.length===0?u.jsx(In,{title:"No suppressions",description:"Recipients who bounce, unsubscribe, or complain appear here."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Email"}),u.jsx(Se,{children:"User ID"}),u.jsx(Se,{children:"Reason"}),u.jsx(Se,{className:"text-right",children:"Suppressed"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:p.map(b=>u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:b.email}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:b.userId}),u.jsx(be,{children:u.jsx(zE,{row:b})}),u.jsx(be,{className:"text-right text-white/60",children:En(b.suppressedAt)}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:()=>d(b),children:"Un-suppress"})})]},b.id))})]})}),u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&y.mutate(c),title:"Un-suppress this recipient?",description:c?`${c.email} will be eligible to receive emails again.`:void 0,confirmLabel:"Un-suppress",loading:y.isPending})]})}function jc({label:n,value:s}){return u.jsxs("div",{className:"rounded-md border border-hairline-faint bg-white/[0.015] p-3",children:[u.jsx("p",{className:"eyebrow text-white/50",children:n}),u.jsx("p",{className:"mt-2 font-display text-lg text-white tracking-[-0.02em]",children:s})]})}function UE({template:n}){const{toast:s}=Cn(),[i,r]=V.useState(!1),[c,d]=V.useState(""),h=tt({queryKey:Ue.templatePreview(n.key),queryFn:()=>v_(n.key)}),y=tt({queryKey:Ue.templateReport(n.key),queryFn:()=>x_(n.key),retry:(b,v)=>!(v instanceof At&&v.status===404)&&b<2}),p=hn({mutationFn:()=>b_(n.key,c),onSuccess:b=>{s({title:"Test email sent",description:`Status: ${b.status}.`}),r(!1),d("")},onError:b=>{s({variant:"error",title:"Send-test failed",description:b instanceof At?b.message:"Unexpected error."})}}),m=y.isError&&y.error instanceof At&&y.error.status===404;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"font-display text-xl text-white tracking-[-0.02em]",children:n.key}),n.category?u.jsx(De,{variant:"secondary",children:n.category}):null]}),u.jsx("p",{className:"text-sm text-white/60",children:n.defaultSubject})]}),u.jsxs(je,{onClick:()=>r(!0),children:[u.jsx(Pr,{className:"h-4 w-4"}),"Send test"]})]}),u.jsxs("section",{className:"space-y-3",children:[u.jsx("h3",{className:"eyebrow text-white/50",children:"Performance"}),y.isPending?u.jsx(Ut,{className:"h-28 w-full"}):m?u.jsx("p",{className:"rounded-md border border-dashed border-white/15 p-6 text-center text-sm text-white/60",children:"This template has never been sent."}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):y.data?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[u.jsx(jc,{label:"Sent",value:ft(y.data.totals.sent)}),u.jsx(jc,{label:"Delivered",value:ft(y.data.totals.delivered)}),u.jsx(jc,{label:"Open rate",value:Nl(y.data.totals.openRate)}),u.jsx(jc,{label:"Click rate",value:Nl(y.data.totals.clickRate)})]}),u.jsxs(Lt,{children:[u.jsx(Bt,{className:"pb-2",children:u.jsx($t,{className:"eyebrow text-white/50",children:"Sends over time"})}),u.jsx(qt,{children:u.jsx(rh,{label:"sent",data:y.data.series.map(b=>({date:b.date,value:b.sent}))})})]})]}):null]}),u.jsxs("section",{className:"space-y-3",children:[u.jsx("h3",{className:"eyebrow text-white/50",children:"Preview"}),h.isPending?u.jsx(Ut,{className:"h-96 w-full"}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):h.data?u.jsx("div",{className:"overflow-hidden rounded-lg border bg-white",children:u.jsx("iframe",{title:`${n.key} preview`,srcDoc:h.data.html,sandbox:"",className:"h-[600px] w-full"})}):null]}),u.jsx(Qc,{open:i,onClose:()=>r(!1),title:"Send a test email",description:`Sends "${n.key}" with example props.`,footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),u.jsx(je,{onClick:()=>p.mutate(),disabled:!c||p.isPending,children:p.isPending?"Sending…":"Send test"})]}),children:u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"test-to",children:"Recipient email"}),u.jsx(vt,{id:"test-to",type:"email",placeholder:"you@example.com",value:c,onChange:b=>d(b.target.value)})]})})]})}function LE(){var d;const n=tt({queryKey:Ue.templates,queryFn:g_}),[s,i]=V.useState(null),r=((d=n.data)==null?void 0:d.templates)??[];V.useEffect(()=>{const h=r[0];s===null&&h&&i(h.key)},[s,r]);const c=r.find(h=>h.key===s)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Templates",description:"Catalog, per-template stats, live previews, and send-test."}),n.isPending?u.jsx(Ut,{className:"h-96 w-full"}):n.isError?u.jsx(_t,{error:n.error,onRetry:()=>n.refetch()}):r.length===0?u.jsx(In,{title:"No templates registered",description:"Templates appear here once they're added to your email registry."}):u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[260px_1fr]",children:[u.jsx("nav",{className:"space-y-1",children:r.map(h=>u.jsxs("button",{type:"button",onClick:()=>i(h.key),className:Fe("w-full rounded-md px-3 py-2 text-left text-sm transition-colors duration-200",h.key===s?"bg-accent-tint text-accent":"text-white/60 hover:bg-white/5 hover:text-white"),children:[u.jsx("span",{className:"block font-medium",children:h.key}),h.category?u.jsx("span",{className:"block text-xs opacity-70",children:h.category}):null]},h.key))}),c?u.jsx(UE,{template:c},c.key):null]})]})}const Tn=yw({component:u_}),BE=Ln({getParentRoute:()=>Tn,path:"/",component:vE}),qE=Ln({getParentRoute:()=>Tn,path:"/sends",component:NE}),HE=Ln({getParentRoute:()=>Tn,path:"/templates",component:LE}),QE=Ln({getParentRoute:()=>Tn,path:"/journeys",component:pE}),GE=Ln({getParentRoute:()=>Tn,path:"/buckets",component:X_}),VE=Ln({getParentRoute:()=>Tn,path:"/contacts",component:eE}),PE=Ln({getParentRoute:()=>Tn,path:"/suppressions",component:DE}),YE=Ln({getParentRoute:()=>Tn,path:"/integrations",component:dE}),KE=Ln({getParentRoute:()=>Tn,path:"/setup",component:OE}),XE=Ln({getParentRoute:()=>Tn,path:"/settings",component:_E}),ZE=Ln({getParentRoute:()=>Tn,path:"/debug",component:nE}),FE=Tn.addChildren([BE,qE,HE,QE,GE,VE,PE,ZE,YE,KE,XE]),IE=Ew({routeTree:FE,basepath:"/studio",defaultPreload:"intent"}),Tb=document.getElementById("root");if(!Tb)throw new Error("Root element #root not found");Uw.createRoot(Tb).render(u.jsx(V.StrictMode,{children:u.jsx(ES,{client:r_,children:u.jsx(l_,{children:u.jsx(FN,{children:u.jsx(Mw,{router:IE})})})})}));
|
|
280
|
+
*/const i_=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Eh=_e("Zap",i_),wb=V.createContext(null);function l_({children:n}){const[s,i]=V.useState([]),r=V.useRef(0),c=V.useCallback(y=>{i(p=>p.filter(m=>m.id!==y))},[]),d=V.useCallback(y=>{const p=++r.current,m={id:p,title:y.title,description:y.description,variant:y.variant??"success"};i(b=>[...b,m]),window.setTimeout(()=>c(p),5e3)},[c]),h=V.useMemo(()=>({toast:d}),[d]);return u.jsxs(wb.Provider,{value:h,children:[n,u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:s.map(y=>u.jsxs("div",{className:Fe("glass-panel pointer-events-auto flex items-start gap-3 p-4 text-white shadow-black/50 shadow-xl",y.variant==="error"&&"border-accent/40"),children:[y.variant==="success"?u.jsx(yb,{strokeWidth:1.5,className:"mt-0.5 h-5 w-5 shrink-0 text-white/90"}):u.jsx(gb,{strokeWidth:1.5,className:"mt-0.5 h-5 w-5 shrink-0 text-accent"}),u.jsxs("div",{className:"flex-1 space-y-0.5",children:[u.jsx("p",{className:"text-sm font-medium text-white",children:y.title}),y.description?u.jsx("p",{className:"text-sm text-white/60",children:y.description}):null]}),u.jsx("button",{type:"button","aria-label":"Dismiss",className:"text-white/50 transition-colors hover:text-white",onClick:()=>c(y.id),children:u.jsx(_h,{className:"h-4 w-4"})})]},y.id))})]})}function Cn(){const n=V.useContext(wb);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const r_=new RS({defaultOptions:{queries:{staleTime:3e4,retry:(n,s)=>s instanceof At&&[401,403].includes(s.status)?!1:n<2,refetchOnWindowFocus:!1}}}),Er="https://docs.hogsend.com",ui={docs:Er,quickstart:`${Er}/docs/getting-started`,recipes:`${Er}/docs/recipes`,journeys:`${Er}/docs/guides/journeys`,buckets:`${Er}/docs/guides/buckets`},o_=[{label:"Overview",path:"/",icon:AR},{label:"Sends",path:"/sends",icon:Pr},{label:"Templates",path:"/templates",icon:bb},{label:"Journeys",path:"/journeys",icon:Rh},{label:"Buckets",path:"/buckets",icon:oR},{label:"Contacts",path:"/contacts",icon:jb},{label:"Suppressions",path:"/suppressions",icon:pb},{label:"Debug",path:"/debug",icon:wR},{label:"Integrations",path:"/integrations",icon:Kc},{label:"Setup",path:"/setup",icon:lh},{label:"Settings",path:"/settings",icon:XR}];function c_(){const n=Aw({select:s=>s.location.pathname});return u.jsxs("aside",{className:"flex h-full w-60 flex-col border-r border-hairline-faint bg-ink",children:[u.jsx("div",{className:"flex h-14 items-center border-b border-hairline-faint px-5",children:u.jsx(fb,{})}),u.jsx("nav",{className:"flex-1 space-y-1 overflow-y-auto p-2",children:o_.map(s=>{const i=s.path==="/"?n==="/":n.startsWith(s.path),r=s.icon;return u.jsxs(jl,{to:s.path,className:Fe("flex items-center gap-3 rounded-md px-3 py-2 text-[15px] tracking-[-0.02em] outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-accent",i?"bg-accent-tint text-accent":"text-white/60 hover:bg-white/5 hover:text-white"),children:[u.jsx(r,{strokeWidth:1.5,className:"h-4 w-4"}),s.label]},s.path)})}),u.jsx("div",{className:"border-t border-hairline-faint p-2",children:u.jsxs("a",{href:ui.docs,target:"_blank",rel:"noreferrer",className:"group flex items-center gap-3 rounded-md px-3 py-2 text-[15px] tracking-[-0.02em] text-white/60 outline-none transition-colors duration-200 hover:bg-white/5 hover:text-white focus-visible:ring-2 focus-visible:ring-accent",children:[u.jsx(lR,{strokeWidth:1.5,className:"h-4 w-4"}),"Docs",u.jsx(wh,{className:"ml-auto h-3.5 w-3.5 opacity-60 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})})]})}function u_(){const{data:n}=Z0();return u.jsxs("div",{className:"flex h-full bg-ink text-white",children:[u.jsx(c_,{}),u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex h-14 items-center justify-end gap-3 border-b border-hairline-faint bg-ink/30 px-6 backdrop-blur-[7px]",children:[n!=null&&n.user?u.jsx("span",{className:"text-sm text-white/50",children:n.user.email}):null,u.jsxs(je,{variant:"ghost",size:"sm",onClick:()=>{Z2()},children:[u.jsx(kR,{strokeWidth:1.5,className:"h-4 w-4"}),"Sign out"]})]}),u.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:u.jsx(G0,{})})]})]})}function Ut({className:n,...s}){return u.jsx("div",{className:Fe("animate-pulse rounded-md bg-white/5",n),...s})}function hi({rows:n=6}){return u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ut,{className:"h-9 w-full"}),Array.from({length:n}).map((s,i)=>u.jsx(Ut,{className:"h-12 w-full"},i))]})}function Nb({count:n=4}){return u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:n}).map((s,i)=>u.jsx(Ut,{className:"h-28 w-full"},i))})}function In({title:n,description:s,icon:i=ER,action:r}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-white/15 p-12 text-center",children:[u.jsx(i,{strokeWidth:1.5,className:"h-8 w-8 text-white/30"}),u.jsx("p",{className:"text-sm font-medium text-white",children:n}),s?u.jsx("p",{className:"max-w-sm text-sm text-white/60",children:s}):null,r?u.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:r}):null]})}function _t({error:n,onRetry:s}){const i=n instanceof At||n instanceof Error?n.message:"Something went wrong.";return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-md border border-accent/40 bg-accent/5 p-12 text-center",children:[u.jsx(mR,{strokeWidth:1.5,className:"h-8 w-8 text-accent"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium text-white",children:"Failed to load"}),u.jsx("p",{className:"max-w-sm text-sm text-white/60",children:i})]}),s?u.jsx(je,{variant:"outline",size:"sm",onClick:s,children:"Retry"}):null]})}function Bn({title:n,description:s,action:i}){return u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"font-display text-2xl text-white tracking-[-0.02em]",children:n}),s?u.jsx("p",{className:"mt-1 text-sm text-white/60",children:s}):null]}),i?u.jsx("div",{className:"shrink-0",children:i}):null]})}const f_=db("inline-flex items-center rounded-[3px] border px-2 py-0.5 text-xs font-medium transition-colors",{variants:{variant:{default:"border-accent bg-accent-tint text-white",secondary:"border-white/[0.08] bg-white/[0.06] text-white/80",destructive:"border-accent/40 bg-accent-tint text-accent",outline:"border-white/[0.08] text-white/70"}},defaultVariants:{variant:"default"}});function De({className:n,variant:s,...i}){return u.jsx("div",{className:Fe(f_({variant:s}),n),...i})}function Qc({open:n,onClose:s,title:i,description:r,children:c,footer:d,className:h}){return V.useEffect(()=>{if(!n)return;const y=p=>{p.key==="Escape"&&s()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n,s]),n?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("button",{type:"button","aria-label":"Close dialog",className:"absolute inset-0 bg-black/60",onClick:s}),u.jsxs("div",{role:"dialog","aria-modal":"true",className:Fe("glass-panel relative z-10 w-full max-w-lg p-6 text-white shadow-black/50 shadow-xl",h),children:[u.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h2",{className:"font-display text-lg leading-none tracking-[-0.02em] text-white",children:i}),r?u.jsx("p",{className:"text-sm text-white/60",children:r}):null]}),u.jsx(je,{variant:"ghost",size:"icon",className:"-mr-2 -mt-2 h-8 w-8",onClick:s,"aria-label":"Close",children:u.jsx(_h,{className:"h-4 w-4"})})]}),c?u.jsx("div",{className:"space-y-4",children:c}):null,d?u.jsx("div",{className:"mt-6 flex justify-end gap-2",children:d}):null]})]}):null}function mi({open:n,onClose:s,onConfirm:i,title:r,description:c,confirmLabel:d="Confirm",cancelLabel:h="Cancel",destructive:y,loading:p}){return u.jsx(Qc,{open:n,onClose:s,title:r,description:c,footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:s,disabled:p,children:h}),u.jsx(je,{variant:y?"destructive":"default",onClick:i,disabled:p,children:p?"Working…":d})]})})}function wl({href:n,children:s,variant:i="outline",className:r}){return u.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:Fe(jh({variant:i,size:"sm"}),r),children:[s,u.jsx(wh,{strokeWidth:2,className:"h-3.5 w-3.5 shrink-0 opacity-70 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})}const Ss=V.forwardRef(({className:n,...s},i)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:i,className:Fe("w-full caption-bottom text-sm",n),...s})}));Ss.displayName="Table";const js=V.forwardRef(({className:n,...s},i)=>u.jsx("thead",{ref:i,className:Fe("[&_tr]:border-b [&_tr]:border-hairline-faint",n),...s}));js.displayName="TableHeader";const ws=V.forwardRef(({className:n,...s},i)=>u.jsx("tbody",{ref:i,className:Fe("[&_tr:last-child]:border-0",n),...s}));ws.displayName="TableBody";const Ht=V.forwardRef(({className:n,...s},i)=>u.jsx("tr",{ref:i,className:Fe("border-b border-hairline-faint transition-colors hover:bg-white/[0.03] data-[state=selected]:bg-white/[0.06]",n),...s}));Ht.displayName="TableRow";const Se=V.forwardRef(({className:n,...s},i)=>u.jsx("th",{ref:i,className:Fe("h-10 px-2 text-left align-middle font-normal text-white/50 text-xs uppercase tracking-[0.04em] [&:has([role=checkbox])]:pr-0",n),...s}));Se.displayName="TableHead";const be=V.forwardRef(({className:n,...s},i)=>u.jsx("td",{ref:i,className:Fe("p-2 align-middle [&:has([role=checkbox])]:pr-0",n),...s}));be.displayName="TableCell";const d_=V.forwardRef(({className:n,...s},i)=>u.jsx("caption",{ref:i,className:Fe("mt-4 text-sm text-white/50",n),...s}));d_.displayName="TableCaption";function h_(){return Le.get("/v1/admin/metrics/overview")}function m_(n){return Le.get("/v1/admin/emails",{query:n})}function p_(n){return Le.get(`/v1/admin/emails/${n}`)}function y_(n){return Le.post(`/v1/admin/emails/${n}/resend`)}function g_(){return Le.get("/v1/admin/templates")}function v_(n){return Le.get(`/v1/admin/templates/${encodeURIComponent(n)}/preview`)}function b_(n,s){return Le.post(`/v1/admin/templates/${encodeURIComponent(n)}/send-test`,{json:{to:s}})}function x_(n){return Le.get(`/v1/admin/reporting/templates/${encodeURIComponent(n)}`)}function S_(){return Le.get("/v1/admin/metrics/journeys")}function j_(n){return Le.get(`/v1/admin/metrics/journeys/${encodeURIComponent(n)}`)}function Rb(){return Le.get("/v1/admin/journeys",{query:{limit:100}})}function w_(n,s){return Le.put(`/v1/admin/journeys/${encodeURIComponent(n)}`,{json:{enabled:s}})}function N_(){return Le.get("/v1/admin/buckets",{query:{limit:100}})}function R_(n){return Le.get(`/v1/admin/buckets/${encodeURIComponent(n)}`)}function __(){return Le.get("/v1/admin/metrics/buckets")}function E_(n,s){return Le.get(`/v1/admin/metrics/buckets/${encodeURIComponent(n)}`,{query:{period:s}})}function C_(n,s){return Le.patch(`/v1/admin/buckets/${encodeURIComponent(n)}`,{json:{enabled:s}})}function T_(n){return Le.get("/v1/admin/contacts",{query:{search:n,limit:50}})}function M_(n){return Le.get(`/v1/admin/contacts/${encodeURIComponent(n)}`)}function A_(n){return Le.get(`/v1/admin/reporting/contacts/${encodeURIComponent(n)}/activity`)}function O_(n){return Le.get(`/v1/admin/contacts/${encodeURIComponent(n)}/timeline`,{query:{limit:100}})}function _b(n,s){return Le.put(`/v1/admin/contacts/${encodeURIComponent(n)}/preferences`,{json:s})}function k_(n){return Le.get("/v1/admin/suppressions",{query:{type:n,limit:200}})}function z_(){return Le.get("/v1/admin/api-keys",{query:{limit:100,includeRevoked:"true"}})}function D_(n){return Le.post("/v1/admin/api-keys",{json:n})}function U_(n){return Le.delete(`/v1/admin/api-keys/${encodeURIComponent(n)}`)}function L_(n){return Le.post("/v1/admin/events",{json:{event:n.event,userId:n.userId,userEmail:n.userEmail,properties:n.properties??{}}})}function qv(n){return Le.get("/v1/admin/domain",{query:{refresh:n?"true":void 0}})}function B_(n){return Le.post("/v1/admin/domain",{json:{domain:n}})}function q_(){return Le.post("/v1/admin/domain/verify")}function H_(){return Le.get("/v1/admin/connectors")}function Q_(){return Le.get("/v1/admin/connectors/discord/connect-info")}function G_(n){return Le.delete(`/v1/admin/provider-credentials/${encodeURIComponent(n)}`)}const Ue={overview:["overview"],emails:n=>["emails",n],email:n=>["email",n],templates:["templates"],templatePreview:n=>["template-preview",n],templateReport:n=>["template-report",n],journeyMetrics:["journey-metrics"],journeys:["journeys"],journeyFunnel:n=>["journey-funnel",n],buckets:["buckets"],bucketMetrics:["bucket-metrics"],bucket:n=>["bucket",n],bucketTrend:n=>["bucket-trend",n],contacts:n=>["contacts",n],contact:n=>["contact",n],contactActivity:n=>["contact-activity",n],contactTimeline:n=>["contact-timeline",n],suppressions:n=>["suppressions",n],apiKeys:["api-keys"],domain:["domain"],integrations:["integrations"],discordConnectInfo:["discord-connect-info"]};function En(n){if(!n)return"—";const s=new Date(n);return Number.isNaN(s.getTime())?"—":s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ac(n){if(!n)return"—";const s=new Date(n);return Number.isNaN(s.getTime())?"—":s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function V_(n){if(!n)return"—";const s=new Date(n);if(Number.isNaN(s.getTime()))return"—";const i=Date.now()-s.getTime(),r=Math.round(i/1e3);if(r<60)return"just now";const c=Math.round(r/60);if(c<60)return`${c}m ago`;const d=Math.round(c/60);if(d<24)return`${d}h ago`;const h=Math.round(d/24);return h<30?`${h}d ago`:Ac(n)}function Nl(n){return n==null||Number.isNaN(n)?"—":`${(n*100).toFixed(1)}%`}function ft(n){return n==null||Number.isNaN(n)?"—":n.toLocaleString()}function Ch(n){if(n==null||Number.isNaN(n))return"—";if(n<60)return`${Math.round(n)}s`;const s=Math.floor(n/60);if(s<60)return`${s}m`;const i=Math.floor(s/60),r=s%60;if(i<24)return r?`${i}h ${r}m`:`${i}h`;const c=Math.floor(i/24),d=i%24;return d?`${c}d ${d}h`:`${c}d`}function P_(n){if(!n)return null;const s=(n.hours??0)*3600+(n.minutes??0)*60+(n.seconds??0);return s>0?Ch(s):null}function Y_(n,s=48){return n.length>s?`${n.slice(0,s-1)}…`:n}function rh({data:n,height:s=160,label:i="value"}){var c,d;if(n.length===0)return u.jsx("div",{className:"flex items-center justify-center rounded-md border border-dashed border-white/15 text-sm text-white/50",style:{height:s},children:"No data in range"});const r=Math.max(...n.map(h=>h.value),1);return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"flex items-end gap-1 rounded-md border border-hairline-faint bg-white/[0.015] p-3",style:{height:s},children:n.map(h=>{const y=h.value/r*100;return u.jsx("div",{className:"group flex flex-1 flex-col items-center justify-end",title:`${Ac(h.date)}: ${h.value} ${i}`,children:u.jsx("div",{className:"w-full min-w-[2px] rounded-t bg-white/15 transition-colors duration-200 group-hover:bg-accent",style:{height:`${Math.max(y,h.value>0?4:0)}%`}})},h.date)})}),u.jsxs("div",{className:"flex justify-between text-[11px] text-white/40 uppercase tracking-[0.04em]",children:[u.jsx("span",{children:Ac((c=n[0])==null?void 0:c.date)}),u.jsx("span",{children:Ac((d=n[n.length-1])==null?void 0:d.date)})]})]})}function K_({bucketId:n}){const s=tt({queryKey:Ue.bucketTrend(n),queryFn:()=>E_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-48 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data,r=i.points.map(y=>({date:y.date,value:y.entered})),c=i.points.map(y=>({date:y.date,value:y.left})),d=i.points.reduce((y,p)=>y+p.entered,0),h=i.points.reduce((y,p)=>y+p.left,0);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-wrap gap-6 text-sm",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Current size"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(i.size)})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Entered (range)"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(d)})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Left (range)"}),u.jsx("span",{className:"font-display text-lg text-white",children:ft(h)})]})]}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Entered over time"}),u.jsx(rh,{data:r,label:"joined"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("span",{className:"eyebrow block text-white/50",children:"Left over time"}),u.jsx(rh,{data:c,label:"left"})]})]})]})}function X_(){var N,R;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),[c,d]=V.useState(null),h=tt({queryKey:Ue.bucketMetrics,queryFn:__}),y=tt({queryKey:Ue.buckets,queryFn:N_}),p=hn({mutationFn:j=>C_(j.id,j.enabled),onSuccess:(j,k)=>{n({title:k.enabled?"Bucket enabled":"Bucket disabled"}),d(null),s.invalidateQueries({queryKey:Ue.buckets}),s.invalidateQueries({queryKey:Ue.bucketMetrics})},onError:j=>{n({variant:"error",title:"Update failed",description:j instanceof At?j.message:"Unexpected error."}),d(null)}}),m=h.isPending||y.isPending,b=h.isError||y.isError,v=new Map((((N=y.data)==null?void 0:N.buckets)??[]).map(j=>[j.id,j])),x=(((R=h.data)==null?void 0:R.buckets)??[]).map(j=>{const k=v.get(j.bucketId);return{...j,enabled:(k==null?void 0:k.enabled)??!1,kind:(k==null?void 0:k.kind)??"dynamic",timeBased:(k==null?void 0:k.timeBased)??!1}}),w=x.find(j=>j.bucketId===i)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Buckets",description:"Real-time, code-defined membership. Sizes, enter/leave trends, and which journeys each bucket feeds — observe only, authoring stays in code."}),m?u.jsx(hi,{}):b?u.jsx(_t,{error:h.error??y.error,onRetry:()=>{h.refetch(),y.refetch()}}):x.length===0?u.jsx(In,{title:"No buckets registered",description:"Buckets are real-time, code-defined audiences (defineBucket()). Add one to your app and members appear here as events arrive.",action:u.jsxs(u.Fragment,{children:[u.jsx(wl,{href:ui.buckets,children:"How to create a bucket"}),u.jsx(wl,{href:ui.recipes,variant:"ghost",children:"Recipes"})]})}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Bucket"}),u.jsx(Se,{className:"text-right",children:"Current size"}),u.jsx(Se,{className:"text-right",children:"Entered"}),u.jsx(Se,{className:"text-right",children:"Left"}),u.jsx(Se,{className:"text-right",children:"Avg dwell"}),u.jsx(Se,{children:"Freshness"}),u.jsx(Se,{children:"State"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:x.map(j=>u.jsxs(Ht,{className:"cursor-pointer","data-state":j.bucketId===i?"selected":void 0,onClick:()=>r(k=>k===j.bucketId?null:j.bucketId),children:[u.jsxs(be,{children:[u.jsx("span",{className:"font-medium text-white",children:j.name}),u.jsx("span",{className:"block font-mono text-xs text-white/70",children:j.bucketId})]}),u.jsx(be,{className:"text-right",children:ft(j.size)}),u.jsx(be,{className:"text-right",children:ft(j.entered)}),u.jsx(be,{className:"text-right",children:ft(j.left)}),u.jsx(be,{className:"text-right text-white/60",children:Ch(j.avgDwellSecs)}),u.jsx(be,{children:u.jsx(Z_,{timeBased:j.timeBased})}),u.jsx(be,{children:u.jsx(De,{variant:j.enabled?"default":"secondary",children:j.enabled?"Enabled":"Disabled"})}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:k=>{k.stopPropagation(),d(j)},children:j.enabled?"Disable":"Enable"})})]},j.bucketId))})]})}),w?u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"text-base",children:[w.name," — feeds journeys"]})}),u.jsx(qt,{children:u.jsx(F_,{bucketId:w.bucketId})})]}),u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"text-base",children:[w.name," — enter / leave over time"]})}),u.jsx(qt,{children:u.jsx(K_,{bucketId:w.bucketId})})]})]}):null,u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&p.mutate({id:c.bucketId,enabled:!c.enabled}),title:c!=null&&c.enabled?"Disable this bucket?":"Enable this bucket?",description:c!=null&&c.enabled?"Membership will stop being recomputed; in-flight members stay until they leave.":"Matching users will start being added to this bucket again.",confirmLabel:c!=null&&c.enabled?"Disable":"Enable",destructive:c==null?void 0:c.enabled,loading:p.isPending})]})}function Z_({timeBased:n}){return n?u.jsx(De,{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50",title:"Time-based — leaves lag the reconcile cron",children:"Building"}):u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",title:"Event-driven — transitions in real time",children:"Live"})}function F_({bucketId:n}){const s=tt({queryKey:Ue.bucket(n),queryFn:()=>R_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-10 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data.bucket.feedsJourneys,r=P_(s.data.bucket.maxDwell);return u.jsxs("div",{className:"space-y-3",children:[r?u.jsxs(De,{variant:"outline",title:"Members are force-removed maxDwell after joining, regardless of criteria.",children:["Time-boxed · ",r]}):null,i.length===0?u.jsxs("div",{className:"space-y-1 text-sm text-white/60",children:[u.jsxs("p",{children:["No journeys are bound to this bucket's transitions yet. Bind one to THIS bucket with the typed refs"," ",u.jsx("code",{className:"text-xs",children:"bucket.entered"})," /"," ",u.jsx("code",{className:"text-xs",children:"bucket.left"})," (e.g."," ",u.jsx("code",{className:"text-xs",children:"{ trigger: { event: bucket.entered } }"}),"), or colocate a reaction with"," ",u.jsx("code",{className:"text-xs",children:'bucket.on("enter", ...)'}),"."]}),u.jsxs("p",{children:["To react to ANY bucket, use the generic"," ",u.jsx("code",{className:"text-xs",children:"Events.BUCKET_ENTERED"})," /"," ",u.jsx("code",{className:"text-xs",children:"Events.BUCKET_LEFT"})," constants."]})]}):u.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(c=>u.jsxs(De,{variant:c.owned?"default":"secondary",title:c.trigger,children:[c.name,c.owned?u.jsx("span",{className:"ml-1.5 text-[10px] uppercase tracking-[0.04em] text-white/50",children:"owned"}):null]},`${c.id}-${c.trigger}`))})]})}const I_={delivered:{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80"},opened:{variant:"outline",className:"border-white/20 bg-white/[0.08] text-white/90"},clicked:{variant:"outline",className:"border-white/30 bg-white/[0.12] text-white"},sent:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},rendered:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},queued:{variant:"outline",className:"border-white/[0.08] bg-white/[0.04] text-white/50"},bounced:{variant:"destructive"},complained:{variant:"destructive"},failed:{variant:"destructive"}};function Yr({status:n}){const s=I_[n]??{variant:"outline"};return u.jsx(De,{variant:s.variant,className:Fe("capitalize",s.className),children:n})}function Eb({open:n,onClose:s,title:i,description:r,children:c,className:d}){return V.useEffect(()=>{if(!n)return;const h=y=>{y.key==="Escape"&&s()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n,s]),n?u.jsxs("div",{className:"fixed inset-0 z-50",children:[u.jsx("button",{type:"button","aria-label":"Close panel",className:"absolute inset-0 bg-black/60",onClick:s}),u.jsxs("div",{role:"dialog","aria-modal":"true",className:Fe("absolute inset-y-0 right-0 flex w-full max-w-2xl flex-col border-l border-white/10 bg-raised text-white shadow-black/50 shadow-xl",d),children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-hairline-faint p-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("h2",{className:"font-display text-lg leading-none tracking-[-0.02em] text-white",children:i}),r?u.jsx("p",{className:"break-all text-sm text-white/60",children:r}):null]}),u.jsx(je,{variant:"ghost",size:"icon",className:"-mr-2 -mt-2 h-8 w-8 shrink-0",onClick:s,"aria-label":"Close",children:u.jsx(_h,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:c})]})]}):null}const J_={event:Eh,journey:Rh,email:bb};function $_({entry:n}){const s=J_[n.type],i=n.data,r=n.type==="event"?String(i.event??"event"):n.type==="journey"?`${String(i.journeyId??"journey")} · ${String(i.status??"")}`:String(i.subject??i.templateKey??"email");return u.jsxs("li",{className:"flex gap-3",children:[u.jsx("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-hairline-faint bg-white/[0.04]",children:u.jsx(s,{className:"h-3.5 w-3.5 text-white/50",strokeWidth:1.5})}),u.jsxs("div",{className:"min-w-0 flex-1 pb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"truncate text-sm font-medium text-white",children:r}),n.type==="email"&&i.status?u.jsx(Yr,{status:String(i.status)}):null]}),u.jsx("p",{className:"text-xs text-white/50",children:En(n.timestamp)})]})]})}function W_({contactId:n,onClose:s}){var N,R;const i=n!==null,{toast:r}=Cn(),c=Jn(),[d,h]=V.useState(!1),y=tt({queryKey:n?Ue.contact(n):["contact","none"],queryFn:()=>M_(n),enabled:i}),p=tt({queryKey:n?Ue.contactActivity(n):["activity","none"],queryFn:()=>A_(n),enabled:i}),m=tt({queryKey:n?Ue.contactTimeline(n):["timeline","none"],queryFn:()=>O_(n),enabled:i}),b=hn({mutationFn:()=>_b(n,{suppressed:!1,unsubscribedAll:!1}),onSuccess:()=>{r({title:"Contact un-suppressed",description:"They can receive emails again."}),h(!1),n&&c.invalidateQueries({queryKey:Ue.contact(n)}),c.invalidateQueries({queryKey:["suppressions"]})},onError:j=>{r({variant:"error",title:"Un-suppress failed",description:j instanceof At?j.message:"Unexpected error."}),h(!1)}}),v=(N=y.data)==null?void 0:N.contact,x=(R=y.data)==null?void 0:R.preferences,w=(x==null?void 0:x.suppressed)||(x==null?void 0:x.unsubscribedAll);return u.jsxs(u.Fragment,{children:[u.jsx(Eb,{open:i,onClose:s,title:(v==null?void 0:v.email)??(v==null?void 0:v.externalId)??"Contact",description:v?v.externalId:void 0,children:y.isPending?u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ut,{className:"h-24 w-full"}),u.jsx(Ut,{className:"h-40 w-full"})]}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):v?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x!=null&&x.suppressed?u.jsx(De,{variant:"destructive",children:"Suppressed"}):null,x!=null&&x.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Unsubscribed"}):null,x&&x.bounceCount>0?u.jsxs(De,{variant:"secondary",children:[x.bounceCount," bounce",x.bounceCount===1?"":"s"]}):null,w?null:u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Subscribed"}),w?u.jsx(je,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>h(!0),children:"Un-suppress"}):null]}),u.jsxs("dl",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"text-xs text-white/50",children:"First seen"}),u.jsx("dd",{className:"text-sm text-white",children:En(v.firstSeenAt)})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-xs text-white/50",children:"Last seen"}),u.jsx("dd",{className:"text-sm text-white",children:En(v.lastSeenAt)})]})]}),u.jsxs("section",{children:[u.jsxs("h3",{className:"eyebrow mb-3 text-white/50",children:["Email activity",p.data?` (${p.data.total})`:""]}),p.isPending?u.jsx(Ut,{className:"h-20 w-full"}):p.isError?u.jsx("p",{className:"text-sm text-white/60",children:"Could not load email activity."}):p.data&&p.data.sends.length>0?u.jsx("ul",{className:"space-y-2",children:p.data.sends.slice(0,10).map(j=>u.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border bg-white/[0.015] p-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"truncate text-sm font-medium text-white",children:j.subject}),u.jsx("p",{className:"text-xs text-white/50",children:En(j.createdAt)})]}),u.jsx(Yr,{status:j.status})]},j.id))}):u.jsx("p",{className:"text-sm text-white/60",children:"No emails sent."})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"eyebrow mb-3 text-white/50",children:"Timeline"}),m.isPending?u.jsx(Ut,{className:"h-20 w-full"}):m.isError?u.jsx("p",{className:"text-sm text-white/60",children:"Could not load timeline."}):m.data&&m.data.timeline.length>0?u.jsx("ul",{children:m.data.timeline.map((j,k)=>u.jsx($_,{entry:j},`${j.type}-${j.timestamp}-${k}`))}):u.jsx("p",{className:"text-sm text-white/60",children:"No activity yet."})]})]}):null}),u.jsx(mi,{open:d,onClose:()=>h(!1),onConfirm:()=>b.mutate(),title:"Un-suppress this contact?",description:"They will be eligible to receive emails again.",confirmLabel:"Un-suppress",loading:b.isPending})]})}function eE(){var p;const[n,s]=V.useState(""),[i,r]=V.useState(""),[c,d]=V.useState(null);V.useEffect(()=>{const m=window.setTimeout(()=>r(n.trim()),300);return()=>window.clearTimeout(m)},[n]);const h=tt({queryKey:Ue.contacts(i),queryFn:()=>T_(i||void 0),placeholderData:fh}),y=((p=h.data)==null?void 0:p.contacts)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Contacts",description:"Search contacts and review their full activity timeline."}),u.jsxs("div",{className:"relative max-w-sm",children:[u.jsx(PR,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-white/40",strokeWidth:1.5}),u.jsx(vt,{placeholder:"Search by email or external ID…",className:"pl-9",value:n,onChange:m=>s(m.target.value)})]}),h.isPending?u.jsx(hi,{}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):y.length===0?u.jsx(In,{title:"No contacts found",description:i?"No contacts match your search.":"Contacts appear here as events are ingested."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Email"}),u.jsx(Se,{children:"External ID"}),u.jsx(Se,{className:"text-right",children:"Last seen"})]})}),u.jsx(ws,{children:y.map(m=>u.jsxs(Ht,{className:"cursor-pointer",onClick:()=>d(m.id),children:[u.jsx(be,{className:"font-medium text-white",children:m.email??"—"}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:m.externalId}),u.jsx(be,{className:"text-right text-white/60",children:V_(m.lastSeenAt)})]},m.id))})]})}),u.jsx(W_,{contactId:c,onClose:()=>d(null)})]})}function Rt({className:n,...s}){return u.jsx("label",{className:Fe("text-sm font-medium leading-none text-white/80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...s})}function Hv(){return`test_${Math.random().toString(36).slice(2,10)}`}function tE(n){const s=n.trim();if(!s)return{ok:!0,value:{}};try{const i=JSON.parse(s);return i===null||typeof i!="object"||Array.isArray(i)?{ok:!1,error:"Properties must be a JSON object."}:{ok:!0,value:i}}catch(i){return{ok:!1,error:i instanceof Error?i.message:"Invalid JSON."}}}function nE(){const{toast:n}=Cn(),[s,i]=V.useState(""),[r,c]=V.useState(Hv),[d,h]=V.useState(""),[y,p]=V.useState("{}"),[m,b]=V.useState(null),[v,x]=V.useState(null),w=tt({queryKey:Ue.journeys,queryFn:Rb}),N=V.useMemo(()=>{var B;const A=new Map;for(const C of((B=w.data)==null?void 0:B.journeys)??[]){const Q=A.get(C.trigger.event)??[];Q.push(C.name),A.set(C.trigger.event,Q)}return Array.from(A,([C,Q])=>({event:C,journeys:Q}))},[w.data]),R=hn({mutationFn:A=>L_(A),onSuccess:A=>{x(A),n({title:"Event ingested",description:`Stored: ${A.stored} · ${A.exits.length} journey exit(s).`})},onError:A=>{n({variant:"error",title:"Ingest failed",description:A instanceof At?A.message:"Unexpected error."})}}),j=()=>{const A=tE(y);if(!A.ok){b(A.error);return}b(null),R.mutate({event:s.trim(),userId:r.trim(),userEmail:d.trim()||void 0,properties:A.value})},k=!!s.trim()&&!!r.trim()&&!R.isPending;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Debug",description:"Fire events into the ingest pipeline — exactly what real events do. Trigger journeys locally without a PostHog tunnel."}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[u.jsxs(Lt,{className:"lg:col-span-2",children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Send a test event"}),u.jsxs(bs,{children:["POSTs to ",u.jsx("code",{className:"text-xs",children:"/v1/ingest"}),". Journeys whose trigger matches will enrol this user."]})]}),u.jsxs(qt,{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"event",children:"Event name"}),u.jsx(vt,{id:"event",list:"event-presets",placeholder:"e.g. user.created",value:s,onChange:A=>i(A.target.value)}),u.jsx("datalist",{id:"event-presets",children:N.map(A=>u.jsx("option",{value:A.event},A.event))})]}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"userId",children:"User ID"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(vt,{id:"userId",placeholder:"test_user",value:r,onChange:A=>c(A.target.value)}),u.jsx(je,{variant:"outline",size:"icon",title:"Generate a random test user ID",onClick:()=>c(Hv()),children:u.jsx(JR,{className:"h-4 w-4"})})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"userEmail",children:"User email (optional)"}),u.jsx(vt,{id:"userEmail",type:"email",placeholder:"you@example.com",value:d,onChange:A=>h(A.target.value)})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"props",children:"Properties (JSON)"}),u.jsx("textarea",{id:"props",spellCheck:!1,className:"flex min-h-[140px] w-full rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-2 font-mono text-sm text-white transition-colors duration-200 placeholder:text-white/40 hover:border-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",value:y,onChange:A=>{p(A.target.value),m&&b(null)}}),m?u.jsx("p",{className:"text-xs text-accent",children:m}):null]}),u.jsx("div",{className:"flex justify-end",children:u.jsxs(je,{onClick:j,disabled:!k,children:[u.jsx(Eh,{className:"h-4 w-4"}),R.isPending?"Sending…":"Send event"]})})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Lt,{children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Journey triggers"}),u.jsx(bs,{children:"Events that enrol a registered journey. Click to fill the form."})]}),u.jsx(qt,{children:N.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No journeys registered yet. Any event name still works — define a journey to see triggers here."}):u.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(A=>u.jsx(je,{variant:"outline",size:"sm",title:`Triggers: ${A.journeys.join(", ")}`,onClick:()=>i(A.event),children:A.event},A.event))})})]}),v?u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{className:"flex items-center gap-2 text-base",children:[u.jsx(yb,{className:"h-4 w-4 text-white/90"}),"Result"]})}),u.jsxs(qt,{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(De,{variant:v.stored?"default":"secondary",children:v.stored?"Stored":"Not stored"}),u.jsxs("span",{className:"text-sm text-white/60",children:[v.exits.length," journey exit(s)"]})]}),u.jsx("pre",{className:"max-h-48 overflow-auto rounded-md border border-hairline-faint bg-white/[0.04] p-3 font-mono text-xs text-white/90",children:JSON.stringify(v,null,2)}),u.jsxs("p",{className:"text-sm text-white/60",children:["See the effect in"," ",u.jsx(jl,{to:"/journeys",className:"text-white transition-colors duration-200 hover:text-white/80",children:"Journeys"})," ","or the"," ",u.jsx(jl,{to:"/contacts",className:"text-white transition-colors duration-200 hover:text-white/80",children:"contact's timeline"}),". Make sure the worker is running."]})]})]}):null]})]})]})}const aE={webhook:"Webhook",gateway:"Gateway",poll:"Poll"};function sE({transport:n}){return u.jsx(De,{variant:"secondary",className:"font-mono text-[11px]",children:aE[n]})}function iE({credential:n}){return n!=null&&n.connected?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Connected"}):u.jsx(De,{variant:"outline",className:"text-white/50",children:"Not connected"})}function lE({integration:n}){return u.jsxs("div",{className:"flex flex-wrap gap-1",children:[n.hasConnector?u.jsx(De,{variant:"outline",className:"text-white/60",children:"Inbound"}):null,n.hasDestination?u.jsx(De,{variant:"outline",className:"text-white/60",children:"Outbound"}):null]})}function Cb({label:n,value:s}){const{toast:i}=Cn();return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"shrink-0 text-white/50",children:n}),u.jsx("code",{className:"flex-1 truncate rounded border border-hairline-faint bg-white/[0.04] px-2 py-1 font-mono text-white/70",children:s}),u.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`Copy ${n}`,onClick:()=>{navigator.clipboard.writeText(s).then(()=>{i({title:"Copied",description:`${n} copied.`})})},children:u.jsx(Nh,{className:"h-3.5 w-3.5",strokeWidth:1.5})})]})}const rE=[{bit:2,label:"Members"},{bit:256,label:"Presence"},{bit:512,label:"Messages"},{bit:1024,label:"Reactions"},{bit:32768,label:"Message content"}];function oE({intents:n}){const s=rE.filter(i=>(n&i.bit)!==0);return s.length===0?null:u.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(i=>u.jsx(De,{variant:"secondary",className:"text-[11px]",children:i.label},i.label))})}function Qv({label:n,value:s}){return u.jsxs("div",{className:"rounded-md border border-hairline-faint bg-white/[0.015] px-3 py-2",children:[u.jsx("p",{className:"font-display text-lg text-white tabular-nums",children:s}),u.jsx("p",{className:"text-[11px] text-white/50",children:n})]})}function cE({integration:n,connectInfo:s}){var d;const i=n.gateway,r=!!((d=n.credential)!=null&&d.connected),c=(s==null?void 0:s.installUrl)??null;return u.jsxs("div",{className:"space-y-4",children:[r?null:u.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-tint p-3 text-xs text-white/70",children:[u.jsx("p",{className:"font-medium text-accent",children:"Connect via CLI"}),u.jsxs("p",{className:"mt-1",children:["Discord secrets are pasted through the CLI — Studio never stores tokens. Run"," ",u.jsx("code",{className:"rounded bg-white/[0.06] px-1 py-0.5 font-mono",children:"hogsend connect discord"})," ","to paste the bot token + client secret, then return here to invite the bot."]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-xs text-white/50",children:"Bot:"}),(i==null?void 0:i.botInstalled)===!0?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Installed"}):(i==null?void 0:i.botInstalled)===!1?u.jsx(De,{variant:"outline",className:"text-white/50",children:"Not installed"}):u.jsx(De,{variant:"outline",className:"text-white/40",children:"Unknown"}),u.jsx("span",{className:"text-xs text-white/50",children:"Worker:"}),i!=null&&i.workerHealthy?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Online"}):u.jsx(De,{variant:"outline",className:"text-white/50",children:"Offline"})]}),i!=null&&i.guildId?u.jsx(Cb,{label:"Guild",value:i.guildId}):null,i!=null&&i.intents?u.jsx(oE,{intents:i.intents}):null,i?u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsx(Qv,{label:"Linked members",value:i.linkedMembers}),u.jsx(Qv,{label:"Unlinked members",value:i.unlinkedMembers})]}):null,c?u.jsx("a",{href:c,target:"_blank",rel:"noreferrer",children:u.jsxs(je,{variant:"secondary",size:"sm",className:"w-full",children:[u.jsx(Kc,{className:"h-4 w-4",strokeWidth:1.5}),i!=null&&i.botInstalled?"Re-invite bot":"Invite bot",u.jsx(wh,{className:"ml-auto h-3.5 w-3.5 opacity-60"})]})}):null]})}function uE({integration:n}){const s=n.webhook;return s?u.jsxs("div",{className:"space-y-3",children:[u.jsx(Cb,{label:"URL",value:s.url}),u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-white/50",children:"Verify secret:"}),s.secretConfigured?u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Configured"}):u.jsx(De,{variant:"destructive",children:"Open — no secret"})]})]}):null}function fE({integration:n,connectInfo:s,onDisconnect:i}){var d,h;const r=n.id==="discord",c=!!((d=n.credential)!=null&&d.connected);return u.jsxs(Lt,{className:"flex flex-col",children:[u.jsxs(Bt,{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[n.transport==="webhook"?u.jsx(a_,{className:"h-4 w-4 text-white/40",strokeWidth:1.5}):u.jsx(Kc,{className:"h-4 w-4 text-white/40",strokeWidth:1.5}),u.jsx($t,{children:n.name})]}),u.jsx(iE,{credential:n.credential})]}),n.description?u.jsx("p",{className:"text-sm text-white/60",children:n.description}):null,u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(sE,{transport:n.transport}),u.jsx(lE,{integration:n})]})]}),u.jsxs(qt,{className:"flex-1 space-y-4",children:[r?u.jsx(cE,{integration:n,connectInfo:s}):n.transport==="webhook"?u.jsx(uE,{integration:n}):null,(h=n.credential)!=null&&h.updatedAt?u.jsxs("p",{className:"text-[11px] text-white/40",children:["Connected ",En(n.credential.updatedAt)]}):null,c?u.jsx(je,{variant:"outline",size:"sm",className:"w-full",onClick:()=>i(n),children:"Disconnect"}):null]})]})}function dE(){var p;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),c=tt({queryKey:Ue.integrations,queryFn:H_}),d=tt({queryKey:Ue.discordConnectInfo,queryFn:Q_,retry:!1}),h=hn({mutationFn:m=>G_(m),onSuccess:()=>{n({title:"Integration disconnected"}),r(null),s.invalidateQueries({queryKey:Ue.integrations}),s.invalidateQueries({queryKey:Ue.discordConnectInfo})},onError:m=>{n({variant:"error",title:"Disconnect failed",description:m instanceof At?m.message:"Unexpected error."}),r(null)}}),y=((p=c.data)==null?void 0:p.integrations)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Integrations",description:"Code-registered connectors and destinations. Connect via the CLI, then observe and manage here.",action:u.jsxs(je,{variant:"outline",size:"sm",onClick:()=>c.refetch(),disabled:c.isFetching,children:[u.jsx(xb,{className:"h-4 w-4"}),c.isFetching?"Refreshing…":"Refresh"]})}),c.isPending?u.jsx(Nb,{count:4}):c.isError?u.jsx(_t,{error:c.error,onRetry:()=>c.refetch()}):y.length===0?u.jsx(In,{icon:Kc,title:"No integrations registered",description:"Register a connector or destination in code, then it appears here to connect.",action:u.jsx("a",{href:"https://docs.hogsend.com/docs/guides/events",target:"_blank",rel:"noreferrer",children:u.jsxs(je,{variant:"outline",size:"sm",children:[u.jsx(bR,{className:"h-4 w-4"}),"Connector docs"]})})}):u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:y.map(m=>u.jsx(fE,{integration:m,connectInfo:m.id==="discord"?d.data:void 0,onDisconnect:r},m.id))}),u.jsx(mi,{open:i!==null,onClose:()=>r(null),onConfirm:()=>i&&h.mutate(i.id),title:"Disconnect this integration?",description:i?`Purges all stored credentials for "${i.name}" — the OAuth grant and any derived config. The bot stays in your server until you remove it there. This cannot be undone.`:void 0,confirmLabel:"Disconnect",destructive:!0,loading:h.isPending})]})}function hE({step:n,base:s}){const i=s>0?n.value/s:0,r=i*100;return u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"font-medium text-white/80",children:n.label}),u.jsxs("span",{className:"text-white/60",children:[ft(n.value),s>0?u.jsxs("span",{className:"ml-1 text-xs text-white/50",children:["(",Nl(i),")"]}):null]})]}),u.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/[0.06]",children:u.jsx("div",{className:"h-full rounded-full bg-white/40",style:{width:`${Math.min(r,100)}%`}})})]})}function mE({journeyId:n}){const s=tt({queryKey:Ue.journeyFunnel(n),queryFn:()=>j_(n)});if(s.isPending)return u.jsx(Ut,{className:"h-48 w-full"});if(s.isError)return u.jsx(_t,{error:s.error,onRetry:()=>s.refetch()});const i=s.data,r=[{label:"Enrolled",value:i.enrolled},{label:"Email sent",value:i.emailSent},{label:"Opened",value:i.emailOpened},{label:"Clicked",value:i.emailClicked},{label:"Completed",value:i.completed}];return u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"space-y-3",children:r.map(c=>u.jsx(hE,{step:c,base:i.enrolled},c.label))}),u.jsxs("div",{className:"flex gap-4 border-t pt-3 text-sm text-white/60",children:[u.jsxs("span",{children:["Failed: ",ft(i.failed)]}),u.jsxs("span",{children:["Exited: ",ft(i.exited)]})]})]})}function pE(){var N,R;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(null),[c,d]=V.useState(null),h=tt({queryKey:Ue.journeyMetrics,queryFn:S_}),y=tt({queryKey:Ue.journeys,queryFn:Rb}),p=hn({mutationFn:j=>w_(j.id,j.enabled),onSuccess:(j,k)=>{n({title:k.enabled?"Journey enabled":"Journey disabled"}),d(null),s.invalidateQueries({queryKey:Ue.journeys}),s.invalidateQueries({queryKey:Ue.journeyMetrics})},onError:j=>{n({variant:"error",title:"Update failed",description:j instanceof At?j.message:"Unexpected error."}),d(null)}}),m=h.isPending||y.isPending,b=h.isError||y.isError,v=new Map((((N=y.data)==null?void 0:N.journeys)??[]).map(j=>[j.id,j.enabled])),x=(((R=h.data)==null?void 0:R.journeys)??[]).map(j=>({...j,enabled:v.get(j.journeyId)??!1})),w=x.find(j=>j.journeyId===i)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Journeys",description:"Lifecycle journeys, completion rates, and per-journey funnels."}),m?u.jsx(hi,{}):b?u.jsx(_t,{error:h.error??y.error,onRetry:()=>{h.refetch(),y.refetch()}}):x.length===0?u.jsx(In,{title:"No journeys registered",description:"Journeys are defined in code with defineJourney(). Add one to your app, then fire its trigger event from Debug to see it here.",action:u.jsxs(u.Fragment,{children:[u.jsx(wl,{href:ui.journeys,children:"How to create a journey"}),u.jsx(wl,{href:ui.recipes,variant:"ghost",children:"Recipes"})]})}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Journey"}),u.jsx(Se,{className:"text-right",children:"Enrolled"}),u.jsx(Se,{className:"text-right",children:"Active"}),u.jsx(Se,{className:"text-right",children:"Completed"}),u.jsx(Se,{className:"text-right",children:"Completion"}),u.jsx(Se,{className:"text-right",children:"Avg duration"}),u.jsx(Se,{children:"State"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:x.map(j=>u.jsxs(Ht,{className:"cursor-pointer","data-state":j.journeyId===i?"selected":void 0,onClick:()=>r(k=>k===j.journeyId?null:j.journeyId),children:[u.jsxs(be,{children:[u.jsx("span",{className:"font-medium text-white",children:j.name}),u.jsx("span",{className:"block font-mono text-xs text-white/70",children:j.journeyId})]}),u.jsx(be,{className:"text-right",children:ft(j.enrolled)}),u.jsx(be,{className:"text-right",children:ft(j.active)}),u.jsx(be,{className:"text-right",children:ft(j.completed)}),u.jsx(be,{className:"text-right",children:Nl(j.completionRate)}),u.jsx(be,{className:"text-right text-white/60",children:Ch(j.avgDurationSecs)}),u.jsx(be,{children:u.jsx(De,{variant:j.enabled?"default":"secondary",children:j.enabled?"Enabled":"Disabled"})}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:k=>{k.stopPropagation(),d(j)},children:j.enabled?"Disable":"Enable"})})]},j.journeyId))})]})}),w?u.jsxs(Lt,{children:[u.jsx(Bt,{children:u.jsxs($t,{children:[w.name," — funnel"]})}),u.jsx(qt,{children:u.jsx(mE,{journeyId:w.journeyId})})]}):null,u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&p.mutate({id:c.journeyId,enabled:!c.enabled}),title:c!=null&&c.enabled?"Disable this journey?":"Enable this journey?",description:c!=null&&c.enabled?"New events will stop enrolling users into this journey.":"New matching events will start enrolling users into this journey.",confirmLabel:c!=null&&c.enabled?"Disable":"Enable",destructive:c==null?void 0:c.enabled,loading:p.isPending})]})}function Xs({label:n,value:s,hint:i,icon:r}){return u.jsxs(Lt,{children:[u.jsxs(Bt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx("span",{className:"eyebrow text-white/50",children:n}),r?u.jsx(r,{strokeWidth:1.5,className:"h-4 w-4 text-white/30"}):null]}),u.jsxs(qt,{children:[u.jsx("div",{className:"font-display text-[28px] leading-none text-white tracking-[-0.02em]",children:s}),i?u.jsx("p",{className:"mt-2 text-xs text-white/50",children:i}):null]})]})}function yE(n){return n.totalContacts===0&&n.activeJourneys===0&&n.emailsSent30d===0}function gE(){return u.jsxs(Lt,{className:"border-accent/40 bg-accent-tint hover:border-accent/40",children:[u.jsxs(Bt,{children:[u.jsx($t,{className:"text-base",children:"Welcome to Hogsend Studio"}),u.jsx(bs,{children:"Studio observes your code-first lifecycle engine. Here's the path to your first running journey."})]}),u.jsxs(qt,{className:"space-y-4",children:[u.jsxs("ol",{className:"space-y-1.5 text-sm text-white/60",children:[u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"1."})," Define a journey in code and start the worker."]}),u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"2."})," Fire its trigger event to enrol a test user."]}),u.jsxs("li",{children:[u.jsx("span",{className:"font-medium text-white",children:"3."})," Watch enrolments, sends, and exits land here."]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsxs(jl,{to:"/debug",className:Fe(jh({size:"sm"})),children:[u.jsx(Eh,{className:"h-4 w-4"}),"Send a test event"]}),u.jsx(wl,{href:ui.quickstart,children:"Quickstart"}),u.jsx(wl,{href:ui.journeys,variant:"ghost",children:"Create a journey"})]})]})]})}function vE(){const n=tt({queryKey:Ue.overview,queryFn:h_});return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Overview",description:"Key delivery and engagement metrics at a glance."}),n.isPending?u.jsx(Nb,{count:6}):n.isError?u.jsx(_t,{error:n.error,onRetry:()=>n.refetch()}):u.jsxs(u.Fragment,{children:[yE(n.data)?u.jsx(gE,{}):null,u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[u.jsx(Xs,{label:"Total contacts",value:ft(n.data.totalContacts),icon:jb}),u.jsx(Xs,{label:"Active journeys",value:ft(n.data.activeJourneys),hint:"Instances active or waiting",icon:Rh}),u.jsx(Xs,{label:"Sent (24h)",value:ft(n.data.emailsSent24h),icon:Pr}),u.jsx(Xs,{label:"Sent (7d)",value:ft(n.data.emailsSent7d),icon:Bv}),u.jsx(Xs,{label:"Sent (30d)",value:ft(n.data.emailsSent30d),icon:Bv}),u.jsx(Xs,{label:"Bounce rate (30d)",value:Nl(n.data.bounceRate30d),hint:"Bounced / sent in last 30 days",icon:vb})]}),u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.jsx(Xs,{label:"Unsubscribe rate",value:Nl(n.data.unsubscribeRate),hint:"Unsubscribed / total preferences",icon:e_})})]})]})}const Gc=V.forwardRef(({className:n,children:s,...i},r)=>u.jsxs("div",{className:"relative",children:[u.jsx("select",{ref:r,className:Fe("flex h-9 w-full appearance-none rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-1 pr-8 text-sm text-white transition-colors duration-200 hover:border-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50 [&>option]:bg-raised [&>option]:text-white",n),...i,children:s}),u.jsx(dR,{className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-white/40"})]}));Gc.displayName="Select";const bE={queued:Sb,sent:Pr,delivered:uR,opened:SR,clicked:BR,bounced:vb,complained:pb,failed:gb};function xE({event:n}){const s=bE[n.type]??Sb;return u.jsxs("li",{className:"flex gap-3",children:[u.jsxs("div",{className:"flex flex-col items-center",children:[u.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-hairline-faint bg-white/[0.04]",children:u.jsx(s,{strokeWidth:1.5,className:"h-3.5 w-3.5 text-white/50"})}),u.jsx("span",{className:"w-px flex-1 bg-white/[0.08]"})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("p",{className:"text-sm font-medium capitalize text-white",children:n.type}),u.jsx("p",{className:"text-xs text-white/50",children:En(n.timestamp)}),n.url?u.jsx("p",{className:"mt-0.5 break-all text-xs text-white/50",children:n.url}):null]})]})}function ts({label:n,value:s,mono:i=!1}){return u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("dt",{className:"text-xs text-white/50",children:n}),u.jsx("dd",{className:i?"break-all font-mono text-xs text-white/70":"break-all text-sm text-white",children:s})]})}function SE({emailId:n,onClose:s}){const i=n!==null,{toast:r}=Cn(),c=Jn(),[d,h]=V.useState(!1),y=tt({queryKey:n?Ue.email(n):["email","none"],queryFn:()=>p_(n),enabled:i}),p=hn({mutationFn:()=>y_(n),onSuccess:()=>{r({title:"Resend queued",description:"A fresh send was queued from this template."}),h(!1),c.invalidateQueries({queryKey:["emails"]}),n&&c.invalidateQueries({queryKey:Ue.email(n)})},onError:v=>{r({variant:"error",title:"Resend failed",description:v instanceof At?v.message:"Unexpected error."}),h(!1)}}),m=y.data,b=m&&["failed","bounced"].includes(m.email.status);return u.jsxs(u.Fragment,{children:[u.jsx(Eb,{open:i,onClose:s,title:"Email send",description:m==null?void 0:m.email.subject,children:y.isPending?u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ut,{className:"h-24 w-full"}),u.jsx(Ut,{className:"h-40 w-full"})]}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):m?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(Yr,{status:m.email.status}),b?u.jsxs(je,{size:"sm",variant:"outline",onClick:()=>h(!0),children:[u.jsx(Pr,{className:"h-4 w-4"}),"Resend"]}):null]}),u.jsxs("dl",{className:"grid grid-cols-2 gap-4",children:[u.jsx(ts,{label:"To",value:m.email.toEmail,mono:!0}),u.jsx(ts,{label:"From",value:m.email.fromEmail,mono:!0}),u.jsx(ts,{label:"Template",value:m.email.templateKey??"—"}),u.jsx(ts,{label:"Category",value:m.email.category??"—"}),u.jsx(ts,{label:"Journey",value:m.email.journeyId??"—",mono:!0}),u.jsx(ts,{label:"User",value:m.email.userId??"—",mono:!0}),u.jsx(ts,{label:"Message ID",value:m.email.messageId??"—",mono:!0}),u.jsx(ts,{label:"Created",value:En(m.email.createdAt)})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"eyebrow mb-3 text-white/50",children:"Timeline"}),m.events.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No delivery events recorded yet."}):u.jsx("ul",{className:"[&>li:last-child>div:first-child>span:last-child]:hidden",children:m.events.map((v,x)=>u.jsx(xE,{event:v},`${v.type}-${v.timestamp}-${x}`))})]}),u.jsxs("section",{children:[u.jsxs("h3",{className:"eyebrow mb-3 text-white/50",children:["Tracked links (",m.trackedLinks.length,")"]}),m.trackedLinks.length===0?u.jsx("p",{className:"text-sm text-white/60",children:"No tracked links in this email."}):u.jsx("ul",{className:"space-y-2",children:m.trackedLinks.map(v=>u.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border bg-white/[0.015] p-3",children:[u.jsx("span",{className:"break-all text-sm text-white/80",children:v.originalUrl}),u.jsxs("span",{className:"shrink-0 text-xs text-white/50",children:[v.clickCount," click",v.clickCount===1?"":"s"]})]},v.id))})]})]}):null}),u.jsx(mi,{open:d,onClose:()=>h(!1),onConfirm:()=>p.mutate(),title:"Resend this email?",description:"A new send will be queued from the original template and recipient.",confirmLabel:"Resend",loading:p.isPending})]})}const jE=["queued","rendered","sent","delivered","opened","clicked","bounced","complained","failed"],wE=["opened","clicked","bounced","complained"],Cr=25,Gv={templateKey:"",status:"",engagement:"",journeyId:"",userId:"",from:"",to:""};function NE(){var C,Q;const[n,s]=V.useState(Gv),[i,r]=V.useState("createdAt"),[c,d]=V.useState("desc"),[h,y]=V.useState(0),[p,m]=V.useState(null),b=n.from?new Date(`${n.from}T00:00:00`).toISOString():void 0,v=n.to?new Date(`${n.to}T23:59:59`).toISOString():void 0,x={limit:Cr,offset:h,templateKey:n.templateKey||void 0,status:n.status||void 0,engagement:n.engagement||void 0,journeyId:n.journeyId||void 0,userId:n.userId||void 0,from:b,to:v,sort:i,order:c},w=tt({queryKey:Ue.emails(x),queryFn:()=>m_(x),placeholderData:fh});function N(U){s(z=>({...z,...U})),y(0)}function R(U){i===U?d(z=>z==="asc"?"desc":"asc"):(r(U),d("desc")),y(0)}const j=Object.values(n).some(Boolean),k=((C=w.data)==null?void 0:C.total)??0,A=((Q=w.data)==null?void 0:Q.emails)??[];function B({column:U,label:z}){const O=i===U;return u.jsx(Se,{children:u.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 transition-colors duration-200 hover:text-white",onClick:()=>R(U),children:[z,O?c==="asc"?u.jsx(aR,{className:"h-3 w-3"}):u.jsx(eR,{className:"h-3 w-3"}):null]})})}return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Sends",description:"Every email sent — filter, sort, and drill into the timeline."}),u.jsxs("div",{className:"grid gap-3 rounded-lg border bg-white/[0.015] p-4 md:grid-cols-3 lg:grid-cols-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-template",children:"Template"}),u.jsx(vt,{id:"f-template",placeholder:"template key",value:n.templateKey,onChange:U=>N({templateKey:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-status",children:"Status"}),u.jsxs(Gc,{id:"f-status",value:n.status,onChange:U=>N({status:U.target.value}),children:[u.jsx("option",{value:"",children:"All"}),jE.map(U=>u.jsx("option",{value:U,children:U},U))]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-engagement",children:"Engagement"}),u.jsxs(Gc,{id:"f-engagement",value:n.engagement,onChange:U=>N({engagement:U.target.value}),children:[u.jsx("option",{value:"",children:"Any"}),wE.map(U=>u.jsx("option",{value:U,children:U},U))]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-journey",children:"Journey ID"}),u.jsx(vt,{id:"f-journey",placeholder:"journey id",value:n.journeyId,onChange:U=>N({journeyId:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-user",children:"User ID"}),u.jsx(vt,{id:"f-user",placeholder:"user id",value:n.userId,onChange:U=>N({userId:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-from",children:"From"}),u.jsx(vt,{id:"f-from",type:"date",value:n.from,onChange:U=>N({from:U.target.value})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"f-to",children:"To"}),u.jsx(vt,{id:"f-to",type:"date",value:n.to,onChange:U=>N({to:U.target.value})})]}),j?u.jsx("div",{className:"flex items-end",children:u.jsx(je,{variant:"ghost",size:"sm",onClick:()=>{s(Gv),y(0)},children:"Clear filters"})}):null]}),w.isPending?u.jsx(hi,{}):w.isError?u.jsx(_t,{error:w.error,onRetry:()=>w.refetch()}):A.length===0?u.jsx(In,{title:"No sends found",description:j?"Try widening or clearing your filters.":"Emails will appear here once your journeys start sending."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Recipient"}),u.jsx(Se,{children:"Subject"}),u.jsx(Se,{children:"Template"}),u.jsx(Se,{children:"Status"}),u.jsx(B,{column:"sentAt",label:"Sent"}),u.jsx(B,{column:"createdAt",label:"Created"})]})}),u.jsx(ws,{children:A.map(U=>u.jsxs(Ht,{className:"cursor-pointer",onClick:()=>m(U.id),children:[u.jsx(be,{className:"font-medium text-white",children:U.toEmail}),u.jsx(be,{className:"text-white/80",children:Y_(U.subject,40)}),u.jsx(be,{className:"text-white/60",children:U.templateKey??"—"}),u.jsx(be,{children:u.jsx(Yr,{status:U.status})}),u.jsx(be,{className:"text-white/60",children:En(U.sentAt)}),u.jsx(be,{className:"text-white/60",children:En(U.createdAt)})]},U.id))})]})}),k>0?u.jsxs("div",{className:"flex items-center justify-between text-sm text-white/60",children:[u.jsxs("span",{children:[h+1,"–",Math.min(h+Cr,k)," of ",k]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(je,{variant:"outline",size:"sm",disabled:h===0,onClick:()=>y(U=>Math.max(0,U-Cr)),children:"Previous"}),u.jsx(je,{variant:"outline",size:"sm",disabled:h+Cr>=k,onClick:()=>y(U=>U+Cr),children:"Next"})]})]}):null,u.jsx(SE,{emailId:p,onClose:()=>m(null)})]})}const RE=["read","journey-admin","full-admin"];function _E(){var A;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(!1),[c,d]=V.useState(""),[h,y]=V.useState(["read"]),[p,m]=V.useState(null),[b,v]=V.useState(null),x=tt({queryKey:Ue.apiKeys,queryFn:z_}),w=hn({mutationFn:()=>D_({name:c.trim(),scopes:h}),onSuccess:B=>{r(!1),d(""),y(["read"]),m(B),s.invalidateQueries({queryKey:Ue.apiKeys})},onError:B=>{n({variant:"error",title:"Could not create key",description:B instanceof At?B.message:"Unexpected error."})}}),N=hn({mutationFn:B=>U_(B),onSuccess:()=>{n({title:"API key revoked"}),v(null),s.invalidateQueries({queryKey:Ue.apiKeys})},onError:B=>{n({variant:"error",title:"Revoke failed",description:B instanceof At?B.message:"Unexpected error."}),v(null)}});function R(B){y(C=>C.includes(B)?C.filter(Q=>Q!==B):[...C,B])}async function j(B){try{await navigator.clipboard.writeText(B),n({title:"Copied to clipboard"})}catch{n({variant:"error",title:"Copy failed"})}}const k=((A=x.data)==null?void 0:A.keys)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Settings",description:"API keys for programmatic access to the Hogsend admin API.",action:u.jsxs(je,{onClick:()=>r(!0),children:[u.jsx(QR,{className:"h-4 w-4"}),"New API key"]})}),x.isPending?u.jsx(hi,{}):x.isError?u.jsx(_t,{error:x.error,onRetry:()=>x.refetch()}):k.length===0?u.jsx(In,{icon:TR,title:"No API keys",description:"Create a key to authenticate API and webhook requests."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Name"}),u.jsx(Se,{children:"Prefix"}),u.jsx(Se,{children:"Scopes"}),u.jsx(Se,{children:"Last used"}),u.jsx(Se,{children:"Status"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:k.map(B=>{const C=B.revokedAt!==null;return u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:B.name}),u.jsxs(be,{className:"font-mono text-xs text-white/70",children:[B.keyPrefix,"…"]}),u.jsx(be,{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:B.scopes.map(Q=>u.jsx(De,{variant:"secondary",children:Q},Q))})}),u.jsx(be,{className:"text-white/60",children:En(B.lastUsedAt)}),u.jsx(be,{children:C?u.jsx(De,{variant:"destructive",children:"Revoked"}):u.jsx(De,{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80",children:"Active"})}),u.jsx(be,{className:"text-right",children:C?null:u.jsx(je,{variant:"outline",size:"sm",onClick:()=>v(B),children:"Revoke"})})]},B.id)})})]})}),u.jsxs(Qc,{open:i,onClose:()=>r(!1),title:"Create API key",description:"Choose a descriptive name and the scopes this key needs.",footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),u.jsx(je,{onClick:()=>w.mutate(),disabled:!c.trim()||h.length===0||w.isPending,children:w.isPending?"Creating…":"Create key"})]}),children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"key-name",children:"Name"}),u.jsx(vt,{id:"key-name",placeholder:"CI ingest key",value:c,onChange:B=>d(B.target.value)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Rt,{children:"Scopes"}),u.jsx("div",{className:"flex flex-col gap-2",children:RE.map(B=>u.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80",htmlFor:`scope-${B}`,children:[u.jsx("input",{id:`scope-${B}`,type:"checkbox",className:"h-4 w-4 rounded border-hairline-faint accent-accent",checked:h.includes(B),onChange:()=>R(B)}),B]},B))})]})]}),u.jsx(Qc,{open:p!==null,onClose:()=>m(null),title:"API key created",description:"Copy this key now — it will not be shown again.",footer:u.jsx(je,{onClick:()=>m(null),children:"Done"}),children:p?u.jsxs("div",{className:"space-y-2",children:[u.jsx(Rt,{children:"Secret key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 break-all rounded-md border border-hairline-faint bg-white/[0.04] px-3 py-2 font-mono text-xs text-white/90",children:p.key}),u.jsx(je,{variant:"outline",size:"icon",onClick:()=>j(p.key),"aria-label":"Copy key",children:u.jsx(Nh,{className:"h-4 w-4"})})]})]}):null}),u.jsx(mi,{open:b!==null,onClose:()=>v(null),onConfirm:()=>b&&N.mutate(b.id),title:"Revoke this API key?",description:b?`"${b.name}" will stop working immediately. This cannot be undone.`:void 0,confirmLabel:"Revoke",destructive:!0,loading:N.isPending})]})}const EE=/^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i,CE={verified:{variant:"outline",className:"border-white/15 bg-white/[0.06] text-white/80"},pending:{variant:"secondary"},failed:{variant:"destructive"},not_found:{variant:"outline"}};function TE({state:n}){const s=CE[n];return u.jsx(De,{variant:s.variant,className:s.className,children:n.replace("_"," ")})}function ME({testMode:n}){return n.active?u.jsxs("div",{className:"rounded-md border border-accent/40 bg-accent-tint p-4 text-sm",children:[u.jsxs("p",{className:"font-medium text-accent",children:["Test mode is active",n.reason==="domain_unverified"?" — sending domain not verified":n.reason==="env_flag"?" — forced via HOGSEND_TEST_MODE":""]}),u.jsxs("p",{className:"mt-1 text-white/60",children:[n.redirectTo?`All sends are redirected to ${n.redirectTo}.`:"No redirect address is configured — sends will fail until one is set.",n.fromOverride?` From address is overridden to ${n.fromOverride}.`:""]})]}):null}function Vv({value:n}){const{toast:s}=Cn();return u.jsx(je,{variant:"ghost",size:"sm","aria-label":"Copy value",onClick:()=>{navigator.clipboard.writeText(n).then(()=>{s({title:"Copied",description:"Value copied to clipboard."})})},children:u.jsx(Nh,{className:"h-3.5 w-3.5",strokeWidth:1.5})})}function AE({onSubmit:n,loading:s}){const[i,r]=V.useState(""),c=EE.test(i);return u.jsxs("form",{className:"flex max-w-md items-end gap-2",onSubmit:d=>{d.preventDefault(),c&&n(i.toLowerCase())},children:[u.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[u.jsx(Rt,{htmlFor:"setup-domain",children:"Sending domain"}),u.jsx(vt,{id:"setup-domain",placeholder:"mysite.com",value:i,onChange:d=>r(d.target.value)})]}),u.jsx(je,{type:"submit",disabled:!c||s,children:s?"Adding…":"Add domain"})]})}function OE(){var v,x,w;const{toast:n}=Cn(),s=Jn(),i=tt({queryKey:Ue.domain,queryFn:()=>qv()}),r=N=>{s.setQueryData(Ue.domain,N)},c=N=>R=>{n({variant:"error",title:N,description:R instanceof At?R.status===501?"The active email provider does not support domain management.":R.message:"Unexpected error."})},d=hn({mutationFn:()=>qv(!0),onSuccess:r,onError:c("Re-check failed")}),h=hn({mutationFn:()=>q_(),onSuccess:N=>{var R;r(N),n({title:"Verification pass triggered",description:((R=N.status)==null?void 0:R.state)==="verified"?"Domain is verified.":"DNS can take a few minutes — re-check shortly."})},onError:c("Verify failed")}),y=hn({mutationFn:N=>B_(N),onSuccess:N=>{r(N),n({title:"Domain registered",description:"Add the DNS records below at your DNS host."})},onError:c("Add domain failed")}),p=i.data,m=((v=p==null?void 0:p.status)==null?void 0:v.records)??[],b=(p==null?void 0:p.supported)===!0&&(p.status===null||p.status.state==="not_found");return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Setup",description:"Sending-domain verification — DNS records, status, and test mode.",action:p!=null&&p.supported?u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(je,{variant:"outline",size:"sm",onClick:()=>d.mutate(),disabled:d.isPending,children:[u.jsx(xb,{className:"h-4 w-4"}),d.isPending?"Checking…":"Re-check"]}),p.domain?u.jsxs(je,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:[u.jsx(FR,{className:"h-4 w-4"}),h.isPending?"Verifying…":"Verify"]}):null]}):null}),i.isPending?u.jsx(hi,{}):i.isError?u.jsx(_t,{error:i.error,onRetry:()=>i.refetch()}):p?p.supported?u.jsxs(u.Fragment,{children:[u.jsx(ME,{testMode:p.testMode}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2 rounded-lg border bg-white/[0.015] p-4 text-sm",children:[u.jsxs("span",{children:[u.jsx("span",{className:"text-white/60",children:"Domain: "}),u.jsx("span",{className:"font-medium text-white",children:p.domain??"not configured"})]}),u.jsxs("span",{children:[u.jsx("span",{className:"text-white/60",children:"Provider: "}),u.jsx("span",{className:"font-medium text-white",children:p.providerId})]}),u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-white/60",children:"State:"}),u.jsx(TE,{state:((x=p.status)==null?void 0:x.state)??"not_found"})]}),(w=p.status)!=null&&w.checkedAt?u.jsxs("span",{className:"text-white/50",children:["Checked ",En(p.status.checkedAt)]}):null]}),b?u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-white/60",children:p.domain?`${p.domain} isn't registered with ${p.providerId} yet — add it to get the DNS records.`:"No sending domain configured. Add one to get the DNS records to verify."}),u.jsx(AE,{onSubmit:N=>y.mutate(N),loading:y.isPending})]}):null,m.length>0?u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Type"}),u.jsx(Se,{children:"Name"}),u.jsx(Se,{children:"Value"}),u.jsx(Se,{className:"text-right",children:"Priority"}),u.jsx(Se,{children:"Purpose"}),u.jsx(Se,{children:"Status"})]})}),u.jsx(ws,{children:m.map(N=>u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:N.type}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:u.jsxs("span",{className:"flex items-center gap-1",children:[N.name,u.jsx(Vv,{value:N.name})]})}),u.jsx(be,{className:"max-w-[18rem] font-mono text-xs text-white/70",children:u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"truncate",title:N.value,children:N.value}),u.jsx(Vv,{value:N.value})]})}),u.jsx(be,{className:"text-right text-white/60",children:N.priority??""}),u.jsx(be,{className:"text-white/60",children:N.purpose}),u.jsx(be,{children:u.jsx(Yr,{status:N.status})})]},`${N.type}-${N.name}-${N.value}`))})]})}):b?null:u.jsx(In,{icon:lh,title:"No DNS records yet",description:"The provider hasn't reported any DNS records for this domain. Re-check, or verify it in the provider dashboard."})]}):u.jsx(In,{icon:lh,title:"Domain management not supported",description:`The active email provider (${p.providerId}) does not expose a domains API. Verify your sending domain in the provider's own dashboard instead.`}):null]})}const kE=[{value:"",label:"All"},{value:"bounced",label:"Bounced"},{value:"unsubscribed",label:"Unsubscribed"},{value:"complained",label:"Complained"}];function zE({row:n}){return u.jsxs("div",{className:"flex flex-wrap gap-1",children:[n.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Unsubscribed"}):null,n.bounceCount>0?u.jsxs(De,{variant:"secondary",children:[ft(n.bounceCount)," bounce"]}):null,n.suppressed&&n.bounceCount===0&&!n.unsubscribedAll?u.jsx(De,{variant:"destructive",children:"Complained"}):null,n.suppressed&&!n.unsubscribedAll&&n.bounceCount>0?u.jsx(De,{variant:"destructive",children:"Suppressed"}):null]})}function DE(){var m;const{toast:n}=Cn(),s=Jn(),[i,r]=V.useState(""),[c,d]=V.useState(null),h=tt({queryKey:Ue.suppressions(i),queryFn:()=>k_(i||void 0),placeholderData:fh}),y=hn({mutationFn:b=>_b(b.userId,{suppressed:!1,unsubscribedAll:!1}),onSuccess:()=>{n({title:"Recipient restored",description:"They can receive emails again."}),d(null),s.invalidateQueries({queryKey:["suppressions"]})},onError:b=>{n({variant:"error",title:"Un-suppress failed",description:b instanceof At?b.message:"Unexpected error."}),d(null)}}),p=((m=h.data)==null?void 0:m.suppressions)??[];return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Suppressions",description:"Bounced, unsubscribed, and complained recipients."}),u.jsxs("div",{className:"flex max-w-xs flex-col gap-1.5",children:[u.jsx(Rt,{htmlFor:"supp-type",children:"Type"}),u.jsx(Gc,{id:"supp-type",value:i,onChange:b=>r(b.target.value),children:kE.map(b=>u.jsx("option",{value:b.value,children:b.label},b.value))})]}),h.isPending?u.jsx(hi,{}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):p.length===0?u.jsx(In,{title:"No suppressions",description:"Recipients who bounce, unsubscribe, or complain appear here."}):u.jsx("div",{className:"rounded-lg border bg-white/[0.015]",children:u.jsxs(Ss,{children:[u.jsx(js,{children:u.jsxs(Ht,{children:[u.jsx(Se,{children:"Email"}),u.jsx(Se,{children:"User ID"}),u.jsx(Se,{children:"Reason"}),u.jsx(Se,{className:"text-right",children:"Suppressed"}),u.jsx(Se,{className:"text-right",children:"Action"})]})}),u.jsx(ws,{children:p.map(b=>u.jsxs(Ht,{children:[u.jsx(be,{className:"font-medium text-white",children:b.email}),u.jsx(be,{className:"font-mono text-xs text-white/70",children:b.userId}),u.jsx(be,{children:u.jsx(zE,{row:b})}),u.jsx(be,{className:"text-right text-white/60",children:En(b.suppressedAt)}),u.jsx(be,{className:"text-right",children:u.jsx(je,{variant:"outline",size:"sm",onClick:()=>d(b),children:"Un-suppress"})})]},b.id))})]})}),u.jsx(mi,{open:c!==null,onClose:()=>d(null),onConfirm:()=>c&&y.mutate(c),title:"Un-suppress this recipient?",description:c?`${c.email} will be eligible to receive emails again.`:void 0,confirmLabel:"Un-suppress",loading:y.isPending})]})}function jc({label:n,value:s}){return u.jsxs("div",{className:"rounded-md border border-hairline-faint bg-white/[0.015] p-3",children:[u.jsx("p",{className:"eyebrow text-white/50",children:n}),u.jsx("p",{className:"mt-2 font-display text-lg text-white tracking-[-0.02em]",children:s})]})}function UE({template:n}){const{toast:s}=Cn(),[i,r]=V.useState(!1),[c,d]=V.useState(""),h=tt({queryKey:Ue.templatePreview(n.key),queryFn:()=>v_(n.key)}),y=tt({queryKey:Ue.templateReport(n.key),queryFn:()=>x_(n.key),retry:(b,v)=>!(v instanceof At&&v.status===404)&&b<2}),p=hn({mutationFn:()=>b_(n.key,c),onSuccess:b=>{s({title:"Test email sent",description:`Status: ${b.status}.`}),r(!1),d("")},onError:b=>{s({variant:"error",title:"Send-test failed",description:b instanceof At?b.message:"Unexpected error."})}}),m=y.isError&&y.error instanceof At&&y.error.status===404;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"font-display text-xl text-white tracking-[-0.02em]",children:n.key}),n.category?u.jsx(De,{variant:"secondary",children:n.category}):null]}),u.jsx("p",{className:"text-sm text-white/60",children:n.defaultSubject})]}),u.jsxs(je,{onClick:()=>r(!0),children:[u.jsx(Pr,{className:"h-4 w-4"}),"Send test"]})]}),u.jsxs("section",{className:"space-y-3",children:[u.jsx("h3",{className:"eyebrow text-white/50",children:"Performance"}),y.isPending?u.jsx(Ut,{className:"h-28 w-full"}):m?u.jsx("p",{className:"rounded-md border border-dashed border-white/15 p-6 text-center text-sm text-white/60",children:"This template has never been sent."}):y.isError?u.jsx(_t,{error:y.error,onRetry:()=>y.refetch()}):y.data?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[u.jsx(jc,{label:"Sent",value:ft(y.data.totals.sent)}),u.jsx(jc,{label:"Delivered",value:ft(y.data.totals.delivered)}),u.jsx(jc,{label:"Open rate",value:Nl(y.data.totals.openRate)}),u.jsx(jc,{label:"Click rate",value:Nl(y.data.totals.clickRate)})]}),u.jsxs(Lt,{children:[u.jsx(Bt,{className:"pb-2",children:u.jsx($t,{className:"eyebrow text-white/50",children:"Sends over time"})}),u.jsx(qt,{children:u.jsx(rh,{label:"sent",data:y.data.series.map(b=>({date:b.date,value:b.sent}))})})]})]}):null]}),u.jsxs("section",{className:"space-y-3",children:[u.jsx("h3",{className:"eyebrow text-white/50",children:"Preview"}),h.isPending?u.jsx(Ut,{className:"h-96 w-full"}):h.isError?u.jsx(_t,{error:h.error,onRetry:()=>h.refetch()}):h.data?u.jsx("div",{className:"overflow-hidden rounded-lg border bg-white",children:u.jsx("iframe",{title:`${n.key} preview`,srcDoc:h.data.html,sandbox:"",className:"h-[600px] w-full"})}):null]}),u.jsx(Qc,{open:i,onClose:()=>r(!1),title:"Send a test email",description:`Sends "${n.key}" with example props.`,footer:u.jsxs(u.Fragment,{children:[u.jsx(je,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),u.jsx(je,{onClick:()=>p.mutate(),disabled:!c||p.isPending,children:p.isPending?"Sending…":"Send test"})]}),children:u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Rt,{htmlFor:"test-to",children:"Recipient email"}),u.jsx(vt,{id:"test-to",type:"email",placeholder:"you@example.com",value:c,onChange:b=>d(b.target.value)})]})})]})}function LE(){var d;const n=tt({queryKey:Ue.templates,queryFn:g_}),[s,i]=V.useState(null),r=((d=n.data)==null?void 0:d.templates)??[];V.useEffect(()=>{const h=r[0];s===null&&h&&i(h.key)},[s,r]);const c=r.find(h=>h.key===s)??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Bn,{title:"Templates",description:"Catalog, per-template stats, live previews, and send-test."}),n.isPending?u.jsx(Ut,{className:"h-96 w-full"}):n.isError?u.jsx(_t,{error:n.error,onRetry:()=>n.refetch()}):r.length===0?u.jsx(In,{title:"No templates registered",description:"Templates appear here once they're added to your email registry."}):u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[260px_1fr]",children:[u.jsx("nav",{className:"space-y-1",children:r.map(h=>u.jsxs("button",{type:"button",onClick:()=>i(h.key),className:Fe("w-full rounded-md px-3 py-2 text-left text-sm transition-colors duration-200",h.key===s?"bg-accent-tint text-accent":"text-white/60 hover:bg-white/5 hover:text-white"),children:[u.jsx("span",{className:"block font-medium",children:h.key}),h.category?u.jsx("span",{className:"block text-xs opacity-70",children:h.category}):null]},h.key))}),c?u.jsx(UE,{template:c},c.key):null]})]})}const Tn=yw({component:u_}),BE=Ln({getParentRoute:()=>Tn,path:"/",component:vE}),qE=Ln({getParentRoute:()=>Tn,path:"/sends",component:NE}),HE=Ln({getParentRoute:()=>Tn,path:"/templates",component:LE}),QE=Ln({getParentRoute:()=>Tn,path:"/journeys",component:pE}),GE=Ln({getParentRoute:()=>Tn,path:"/buckets",component:X_}),VE=Ln({getParentRoute:()=>Tn,path:"/contacts",component:eE}),PE=Ln({getParentRoute:()=>Tn,path:"/suppressions",component:DE}),YE=Ln({getParentRoute:()=>Tn,path:"/integrations",component:dE}),KE=Ln({getParentRoute:()=>Tn,path:"/setup",component:OE}),XE=Ln({getParentRoute:()=>Tn,path:"/settings",component:_E}),ZE=Ln({getParentRoute:()=>Tn,path:"/debug",component:nE}),FE=Tn.addChildren([BE,qE,HE,QE,GE,VE,PE,ZE,YE,KE,XE]),IE=Ew({routeTree:FE,basepath:"/studio",defaultPreload:"intent"}),Tb=document.getElementById("root");if(!Tb)throw new Error("Root element #root not found");Uw.createRoot(Tb).render(u.jsx(V.StrictMode,{children:u.jsx(ES,{client:r_,children:u.jsx(l_,{children:u.jsx(FN,{children:u.jsx(Mw,{router:IE})})})})}));
|
package/studio/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="theme-color" content="#050101" />
|
|
7
7
|
<meta name="color-scheme" content="dark" />
|
|
8
8
|
<title>Hogsend Studio</title>
|
|
9
|
-
<script type="module" crossorigin src="/studio/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/studio/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/studio/assets/index-BWxTZyNF.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/studio/assets/index-B1B_hgJY.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body class="h-full">
|
|
13
13
|
<div id="root" class="h-full"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:"Geist Mono Variable", ui-monospace, "SFMono-Regular", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--radius-md:.375rem;--radius-lg:.375rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-display:"Inter Display", ui-sans-serif, system-ui, sans-serif;--color-accent:#f64838;--color-accent-deep:#b8281c;--color-accent-tint:#f6483826;--color-ink:#050101;--color-raised:#0a0606;--color-hairline-faint:#ffffff14}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--color-hairline-faint)}::file-selector-button{border-color:var(--color-hairline-faint)}html{color-scheme:dark;scrollbar-gutter:stable;background-color:var(--color-ink);-webkit-font-smoothing:antialiased}body{font-family:var(--font-sans);letter-spacing:-.02em;background-color:var(--color-ink);color:#fff}h1,h2,h3,h4,.font-display{font-family:var(--font-display);letter-spacing:-.02em;font-weight:400}code,kbd,pre,samp{letter-spacing:0}*{scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:#ffffff26;border-radius:4px}body:before{content:"";z-index:30;pointer-events:none;opacity:.025;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-repeat:repeat;position:fixed;top:0;right:0;bottom:0;left:0}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.-mt-2{margin-top:calc(var(--spacing) * -2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.table{display:table}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-40{height:calc(var(--spacing) * 40)}.h-48{height:calc(var(--spacing) * 48)}.h-96{height:calc(var(--spacing) * 96)}.h-\[600px\]{height:600px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.min-h-\[140px\]{min-height:140px}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-60{width:calc(var(--spacing) * 60)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[18rem\]{max-width:18rem}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[2px\]{min-width:2px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[3px\]{border-radius:3px}.rounded-\[6px\]{border-radius:6px}.rounded-\[8px\]{border-radius:8px}.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--color-accent)}.border-accent\/40{border-color:#f6483866}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--color-accent) 40%,transparent)}}.border-hairline-faint{border-color:var(--color-hairline-faint)}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.border-white\/15{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.border-white\/30{border-color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.border-white\/\[0\.08\]{border-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.border-white\/\[0\.08\]{border-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.bg-accent{background-color:var(--color-accent)}.bg-accent-tint{background-color:var(--color-accent-tint)}.bg-accent\/5{background-color:#f648380d}@supports (color:color-mix(in lab,red,red)){.bg-accent\/5{background-color:color-mix(in oklab,var(--color-accent) 5%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-ink{background-color:var(--color-ink)}.bg-ink\/30{background-color:#0501014d}@supports (color:color-mix(in lab,red,red)){.bg-ink\/30{background-color:color-mix(in oklab,var(--color-ink) 30%,transparent)}}.bg-raised{background-color:var(--color-raised)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-white\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\/15{background-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.bg-white\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-white\/40{background-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}.bg-white\/\[0\.08\]{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.08\]{background-color:color-mix(in oklab,var(--color-white) 8%,transparent)}}.bg-white\/\[0\.12\]{background-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.12\]{background-color:color-mix(in oklab,var(--color-white) 12%,transparent)}}.bg-white\/\[0\.015\]{background-color:#ffffff04}@supports (color:color-mix(in lab,red,red)){.bg-white\/\[0\.015\]{background-color:color-mix(in oklab,var(--color-white) 1.5%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-display{font-family:var(--font-display)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.text-\[28px\]{font-size:28px}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-\[\#0a0a0a\]{color:#0a0a0a}.text-accent{color:var(--color-accent)}.text-white{color:var(--color-white)}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.text-white\/30{color:color-mix(in oklab,var(--color-white) 30%,transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.text-white\/50{color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.text-white\/90{color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.accent-accent{accent-color:var(--color-accent)}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-\[7px\]{--tw-backdrop-blur:blur(7px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:-translate-y-0\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:bg-accent:is(:where(.group):hover *){background-color:var(--color-accent)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\:text-white\/40::placeholder{color:#fff6}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-white\/40::placeholder{color:color-mix(in oklab,var(--color-white) 40%,transparent)}}@media(hover:hover){.hover\:border-accent\/40:hover{border-color:#f6483866}@supports (color:color-mix(in lab,red,red)){.hover\:border-accent\/40:hover{border-color:color-mix(in oklab,var(--color-accent) 40%,transparent)}}.hover\:border-white\/15:hover{border-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.hover\:border-white\/15:hover{border-color:color-mix(in oklab,var(--color-white) 15%,transparent)}}.hover\:bg-accent-deep:hover{background-color:var(--color-accent-deep)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.hover\:bg-white\/\[0\.03\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-white) 3%,transparent)}}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab,red,red)){.hover\:text-white\/80:hover{color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-accent:focus-visible{--tw-ring-color:var(--color-accent)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[state\=selected\]\:bg-white\/\[0\.06\][data-state=selected]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.data-\[state\=selected\]\:bg-white\/\[0\.06\][data-state=selected]{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[260px_1fr\]{grid-template-columns:260px 1fr}}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\]\:border-hairline-faint tr{border-color:var(--color-hairline-faint)}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\&\>li\:last-child\>div\:first-child\>span\:last-child\]\:hidden>li:last-child>div:first-child>span:last-child{display:none}.\[\&\>option\]\:bg-raised>option{background-color:var(--color-raised)}.\[\&\>option\]\:text-white>option{color:var(--color-white)}}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2)format("woff2-variations");unicode-range:U+1F??}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-greek-wght-normal-CkhJZR-_.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/inter-latin-wght-normal-Dx4kXJAl.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2)format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/studio/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter Display;font-style:normal;font-weight:400;font-display:swap;src:url(/studio/assets/InterDisplay-Regular-CHKdHLF4.woff2)format("woff2")}@font-face{font-family:Inter Display;font-style:normal;font-weight:500;font-display:swap;src:url(/studio/assets/InterDisplay-Medium-CYGNL_ty.woff2)format("woff2")}.eyebrow{font-family:var(--font-sans);letter-spacing:.04em;text-transform:uppercase;font-size:.75rem;line-height:1}.glass-panel{-webkit-backdrop-filter:blur(14px);background-color:#0a0606cc;border:1px solid #ffffff1a;border-radius:12px}.noise{opacity:.025;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-repeat:repeat}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|