@wacht/jsx 1.0.0-beta.54 → 1.0.0-beta.55

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/dist/index.cjs.js CHANGED
@@ -96,7 +96,7 @@ Example:
96
96
  Perhaps you're looking to import 'styled-components/native'?
97
97
  Read more about this at https://styled-components.com/docs/basics#react-native`);const $s=`__sc-${$a}__`;process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[$s]||(window[$s]=0),window[$s]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
98
98
 
99
- See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[$s]+=1);const J8='.wacht-root{--wa-surface: var(--wa-ov-light-surface, #ffffff);--wa-surface-subtle: var(--wa-ov-light-surface_subtle, #fafaf8);--wa-background: var(--wa-ov-light-background, #f5f5f2);--wa-canvas: var(--wa-ov-light-canvas, #ebebe7);--wa-text: var(--wa-ov-light-text, #161618);--wa-text-secondary: var(--wa-ov-light-text_secondary, #3b3b3f);--wa-text-muted: var(--wa-ov-light-text_muted, #76767c);--wa-text-faint: var(--wa-ov-light-text_faint, #a8a8ad);--wa-border: var(--wa-ov-light-border, rgba(20, 20, 22, .08));--wa-border-strong: var(--wa-ov-light-border_strong, rgba(20, 20, 22, .14));--wa-primary: var(--wa-ov-light-primary, #6b3df5);--wa-primary-soft: var(--wa-ov-light-primary_soft, rgba(107, 61, 245, .1));--wa-primary-foreground: var(--wa-ov-light-primary_foreground, #ffffff);--wa-success: var(--wa-ov-light-success, #0f8a4a);--wa-success-soft: var(--wa-ov-light-success_soft, rgba(15, 138, 74, .12));--wa-info: var(--wa-ov-light-info, #2f6fdb);--wa-info-soft: var(--wa-ov-light-info_soft, rgba(47, 111, 219, .1));--wa-warning: var(--wa-ov-light-warning, #a8650a);--wa-warning-soft: var(--wa-ov-light-warning_soft, rgba(168, 101, 10, .12));--wa-error: var(--wa-ov-light-error, #c4271f);--wa-error-soft: var(--wa-ov-light-error_soft, rgba(196, 39, 31, .1));--wa-radius: var(--wa-ov-light-radius, 6px);--wa-radius-lg: var(--wa-ov-light-radius_lg, 10px);--wa-font-sans: var(--wa-ov-light-font_sans, "Geist", "Inter"), system-ui, -apple-system, sans-serif;--wa-font-mono: var(--wa-ov-light-font_mono, "Geist Mono"), ui-monospace, SFMono-Regular, Menlo, monospace;font-family:var(--wa-font-sans)}.dark .wacht-root,.wacht-root.dark{--wa-surface: var(--wa-ov-dark-surface, #131318);--wa-surface-subtle: var(--wa-ov-dark-surface_subtle, #101015);--wa-background: var(--wa-ov-dark-background, #0d0d10);--wa-canvas: var(--wa-ov-dark-canvas, #050507);--wa-text: var(--wa-ov-dark-text, #ececef);--wa-text-secondary: var(--wa-ov-dark-text_secondary, #c5c5cb);--wa-text-muted: var(--wa-ov-dark-text_muted, #8a8a92);--wa-text-faint: var(--wa-ov-dark-text_faint, #57575e);--wa-border: var(--wa-ov-dark-border, rgba(255, 255, 255, .07));--wa-border-strong: var(--wa-ov-dark-border_strong, rgba(255, 255, 255, .14));--wa-primary: var(--wa-ov-dark-primary, #9277ff);--wa-primary-soft: var(--wa-ov-dark-primary_soft, rgba(146, 119, 255, .16));--wa-primary-foreground: var(--wa-ov-dark-primary_foreground, #ffffff);--wa-success: var(--wa-ov-dark-success, #0f8a4a);--wa-success-soft: var(--wa-ov-dark-success_soft, rgba(15, 138, 74, .18));--wa-info: var(--wa-ov-dark-info, #2f6fdb);--wa-info-soft: var(--wa-ov-dark-info_soft, rgba(47, 111, 219, .18));--wa-warning: var(--wa-ov-dark-warning, #a8650a);--wa-warning-soft: var(--wa-ov-dark-warning_soft, rgba(168, 101, 10, .18));--wa-error: var(--wa-ov-dark-error, #c4271f);--wa-error-soft: var(--wa-ov-dark-error_soft, rgba(196, 39, 31, .18));--wa-radius: var(--wa-ov-dark-radius, 6px);--wa-radius-lg: var(--wa-ov-dark-radius_lg, 10px);--wa-font-sans: var(--wa-ov-dark-font_sans, "Geist", "Inter"), system-ui, -apple-system, sans-serif;--wa-font-mono: var(--wa-ov-dark-font_mono, "Geist Mono"), ui-monospace, SFMono-Regular, Menlo, monospace}.wacht-root *{box-sizing:border-box}',X8='.w-flex-col{display:flex;flex-direction:column}.w-inline{display:inline-flex;align-items:center}.w-wrap{flex-wrap:wrap}.w-grow{flex:1 1 auto;min-width:0}.w-none{flex:none}.w-full{width:100%}.w-gap-1{gap:4px}.w-gap-2{gap:8px}.w-gap-3{gap:12px}.w-gap-4{gap:16px}.w-gap-5{gap:20px}.w-gap-6{gap:24px}.w-truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-contents{display:contents}.w-h-full{height:100%}.w-minh-full{min-height:100%}.w-mono-sm{font:400 12px/1.4 var(--wa-font-mono);color:var(--wa-text-muted)}.w-text-primary{color:var(--wa-primary)}.w-text-secondary{color:var(--wa-text-secondary)}.w-text-muted{color:var(--wa-text-muted)}.w-text-faint{color:var(--wa-text-faint)}.w-text-error{color:var(--wa-error)}.w-text-success{color:var(--wa-success)}.w-text-warning{color:var(--wa-warning)}.w-mb-4{margin-bottom:16px}.w-mt-6{margin-top:24px}.w-maxw-sm{max-width:340px}.w-rolepick-btn{min-width:120px}.w-combo-menu--pop{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:60}.w-relative{position:relative}.w-card{background:var(--wa-surface);border:0;border-radius:var(--wa-radius-lg);box-shadow:0 0 0 .5px var(--wa-border),0 1px 1px #1414160a,0 4px 8px -4px #14141614,0 24px 48px -16px #14141629;overflow:hidden}.w-eyebrow{font:400 10px/1 var(--wa-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--wa-text-faint)}.w-title{font:400 17px/1.25 var(--wa-font-sans);letter-spacing:-.02em;color:var(--wa-text);margin:0}.w-title-lg{font:400 19px/1.2 var(--wa-font-sans);letter-spacing:-.022em;color:var(--wa-text);margin:0}.w-sub{font:400 13px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);margin:0}.w-sec{font:400 13px/1.3 var(--wa-font-sans);color:var(--wa-text);margin:0}.w-secsub{font:400 12px/1.45 var(--wa-font-sans);color:var(--wa-text-muted);margin:0}.w-btn{height:32px;padding:0 13px;border-radius:var(--wa-radius);border:.5px solid transparent;font:400 12.5px/1 var(--wa-font-sans);display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background .14s ease,border-color .14s ease,filter .14s ease,box-shadow .14s ease;background:transparent;color:var(--wa-text)}.w-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-btn:disabled{opacity:.6;cursor:not-allowed}.w-btn svg{width:14px;height:14px;flex:none}.w-btn.w-notif-bell{width:32px;height:32px}.w-btn.w-notif-bell svg{width:18px;height:18px}.w-btn--primary{background:var(--wa-primary);color:var(--wa-primary-foreground);box-shadow:inset 0 1px #ffffff2e,0 1px 2px #1414161f,0 2px 8px -2px color-mix(in srgb,var(--wa-primary) 50%,transparent);background-image:linear-gradient(180deg,#ffffff1a,#fff0 42%)}.w-btn--primary:active:not(:disabled){filter:brightness(.97);box-shadow:inset 0 1px 2px #14141633}.w-btn--block{width:100%;height:38px;font-size:13px}.w-btn--secondary{background:var(--wa-surface);border-color:var(--wa-border-strong);color:var(--wa-text);box-shadow:inset 0 1px #ffffff80,0 1px 1.5px #1414160a}.w-btn--ghost{background:transparent;color:var(--wa-text-secondary)}.w-btn--danger{background:transparent;color:var(--wa-error);border-color:color-mix(in srgb,var(--wa-error) 26%,transparent)}.w-btn--danger-solid{background:var(--wa-error);color:#fff}.w-btn--sm{height:26px;padding:0 9px;font-size:11.5px}.w-btn--lg{height:42px;padding:0 18px;font-size:13.5px}.w-btn--icon{height:28px;width:28px;padding:0;color:var(--wa-text-muted)}.w-btn--icon:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-social{height:40px;width:100%;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);color:var(--wa-text);font:400 13px/1 var(--wa-font-sans);display:flex;align-items:center;justify-content:center;gap:10px;padding:0 14px;cursor:pointer;position:relative;box-shadow:inset 0 1px #ffffff80,0 1px 1.5px #1414160a;transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .1s ease}.w-social:active{transform:translateY(.5px)}.w-social:focus-visible{outline:none;box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-social svg,.w-social img{width:17px;height:17px;flex:none}.w-social .w-social-label{flex:none}.w-social .w-lastused{position:absolute;top:-9px;right:12px;white-space:nowrap;font:400 9.5px/1 var(--wa-font-mono);letter-spacing:.04em;color:var(--wa-text-muted);background:var(--wa-surface);border:.5px solid var(--wa-border);padding:3px 6px;border-radius:5px}.w-field{display:flex;flex-direction:column;gap:7px}.w-label{font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);display:flex;align-items:center;gap:4px;letter-spacing:-.005em;white-space:nowrap}.w-req{color:var(--wa-error);font-size:12px}.w-input{height:34px;padding:0 12px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);color:var(--wa-text);font:400 13px/1 var(--wa-font-sans);width:100%;box-shadow:inset 0 1px 2px #1414160d;transition:border-color .14s ease,box-shadow .14s ease}.w-input::placeholder{color:var(--wa-text-faint)}.w-input:focus{outline:none;border-color:var(--wa-primary);box-shadow:inset 0 1px 2px #1414160a,0 0 0 3px var(--wa-primary-soft)}.w-input-row{display:flex;align-items:center;gap:6px}.w-input-trail{margin-left:-34px;z-index:1}.w-input-wrap{position:relative}.w-input--valid:focus{border-color:var(--wa-success);box-shadow:0 0 0 3px var(--wa-success-soft)}.w-input--invalid,.w-input[aria-invalid=true]{border-color:color-mix(in srgb,var(--wa-error) 55%,var(--wa-border-strong))}.w-input--invalid:focus,.w-input[aria-invalid=true]:focus{border-color:var(--wa-error);box-shadow:0 0 0 3px var(--wa-error-soft)}.w-input:disabled,.w-input[data-disabled]{opacity:.55;cursor:not-allowed}.w-input-err{font:400 11.5px/1.3 var(--wa-font-sans);color:var(--wa-error)}.w-input-ok{font:400 11.5px/1.3 var(--wa-font-sans);color:var(--wa-success)}.w-input-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:28px;height:28px;display:grid;place-items:center;border:0;background:none;cursor:pointer;color:var(--wa-text-faint);border-radius:6px}.w-input-eye:hover{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-input-eye svg{width:15px;height:15px}.w-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font:400 var(--av-fs, 13px)/1 var(--wa-font-sans);color:#fff;flex:none;background:var(--av-bg, linear-gradient(135deg, #6b3df5, #9277ff));box-shadow:inset 0 0 0 .5px #ffffff29;letter-spacing:.01em;overflow:hidden}.w-avatar img{width:100%;height:100%;object-fit:cover}.w-avatar--square{border-radius:var(--wa-radius)}.w-avatar--sm{width:20px;height:20px;font-size:10px}.w-avatar--md{width:28px;height:28px;font-size:11px}.w-avatar--lg{width:44px;height:44px;font-size:15px}.w-avatar--xl{width:80px;height:80px;font-size:24px}.w-avatar-edit{position:relative;cursor:pointer;border:0;padding:0}.w-avatar-edit .w-avatar-veil{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;display:grid;place-items:center;color:#fff;background:color-mix(in srgb,#000 45%,transparent);opacity:0;transition:opacity .15s ease;font:400 11px/1.2 var(--wa-font-sans);text-align:center;padding:0 6px}.w-avatar-edit:hover .w-avatar-veil,.w-avatar-edit[data-busy] .w-avatar-veil{opacity:1}.w-avatar-veil svg{width:18px;height:18px}.w-pill{display:inline-flex;align-items:center;gap:6px;height:21px;padding:0 8px;border-radius:4px;font:400 10.5px/1 var(--wa-font-mono);text-transform:lowercase;letter-spacing:.01em;background:var(--wa-surface-subtle);color:var(--wa-text-muted);border:.5px solid var(--wa-border);white-space:nowrap;flex:none}.w-pill .w-dot{width:5px;height:5px;border-radius:999px;background:var(--wa-text-faint)}.w-pill--success{background:var(--wa-success-soft);color:var(--wa-success);border-color:color-mix(in srgb,var(--wa-success) 26%,transparent)}.w-pill--success .w-dot{background:var(--wa-success)}.w-pill--warning{background:var(--wa-warning-soft);color:var(--wa-warning);border-color:color-mix(in srgb,var(--wa-warning) 26%,transparent)}.w-pill--warning .w-dot{background:var(--wa-warning)}.w-pill--info{background:var(--wa-info-soft);color:var(--wa-info);border-color:color-mix(in srgb,var(--wa-info) 26%,transparent)}.w-pill--info .w-dot{background:var(--wa-info)}.w-pill--current{background:var(--wa-primary-soft);color:var(--wa-primary);border-color:color-mix(in srgb,var(--wa-primary) 26%,transparent)}.w-pill--error{background:var(--wa-error-soft);color:var(--wa-error);border-color:color-mix(in srgb,var(--wa-error) 26%,transparent)}.w-pill--error .w-dot{background:var(--wa-error)}.w-pill--pending{background:transparent;color:var(--wa-warning);border:.5px dashed color-mix(in srgb,var(--wa-warning) 55%,transparent)}.w-pill--pending .w-dot{background:var(--wa-warning)}.w-chip{display:inline-flex;align-items:center;gap:7px;height:24px;padding:0 5px 0 9px;border-radius:var(--wa-radius);background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);font:400 12px/1 var(--wa-font-mono);color:var(--wa-text-secondary)}.w-chip-x{display:grid;place-items:center;width:16px;height:16px;border-radius:3px;color:var(--wa-text-faint);cursor:pointer}.w-chip-x:hover{background:var(--wa-border);color:var(--wa-text)}.w-chip-x svg{width:11px;height:11px}.w-or{display:flex;align-items:center;gap:14px;margin:18px 0}.w-or:before,.w-or:after{content:"";height:.5px;background:var(--wa-border);flex:1}.w-or span{font:400 10px/1 var(--wa-font-mono);letter-spacing:.14em;color:var(--wa-text-faint)}.w-hr{height:.5px;background:var(--wa-border);border:0;margin:0;width:100%}.w-list{display:flex;flex-direction:column}.w-listhead{display:grid;align-items:center;padding:0 2px 8px;font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);border-bottom:.5px solid var(--wa-border)}.w-row{display:grid;align-items:center;padding:13px 2px;border-bottom:.5px solid var(--wa-border)}.w-row:last-child{border-bottom:0}.w-row--hover{border-radius:var(--wa-radius);margin:0 -8px;padding:11px 10px;border-bottom:0;transition:background .12s ease}.w-row--hover:hover{background:var(--wa-surface-subtle)}.w-acct{display:flex;align-items:center;gap:13px;width:100%;text-align:left;padding:11px 12px;border:.5px solid transparent;border-radius:var(--wa-radius-lg);background:none;cursor:pointer;transition:background .13s ease,border-color .13s ease}.w-acct:hover{background:var(--wa-surface-subtle)}.w-acct[data-active]{background:var(--wa-surface-subtle);border-color:var(--wa-border)}.w-acct .w-acct-go{color:var(--wa-text-faint);flex:none;opacity:0;transform:translate(-4px);transition:opacity .13s ease,transform .13s ease}.w-acct:hover .w-acct-go{opacity:1;transform:none;color:var(--wa-text-muted)}.w-acct[data-busy]{opacity:.55;pointer-events:none}.w-acct-list{border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);overflow:hidden;margin-bottom:18px}.w-acct-list-head{padding:11px 14px;border-bottom:.5px solid var(--wa-border)}.w-acct-list-body{padding:6px}.w-acct-text{flex:1;min-width:0;text-align:left}.w-acct-name{display:block;font:400 13px/1.3 var(--wa-font-sans);color:var(--wa-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-acct-text .w-secsub{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-acct .w-avatar{width:34px;height:34px;flex:none}.w-acct[data-active] .w-avatar{width:40px;height:40px}.w-acct-add-ic{width:36px;height:36px;border-radius:50%;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);display:grid;place-items:center;color:var(--wa-text-muted);flex:none;transition:color .13s ease,border-color .13s ease}.w-acct--add:hover .w-acct-add-ic{color:var(--wa-text);border-color:var(--wa-text-muted)}.w-acct-out{color:var(--wa-text-faint);flex:none;margin-right:-6px}.w-acct-out:hover{color:var(--wa-error);background:var(--wa-error-soft)}.w-acct--add:hover{background:var(--wa-surface-subtle)}.w-acct-foot{margin-top:8px;padding-top:10px}.w-acct-add{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;height:36px;border:0;background:none;cursor:pointer;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-muted);transition:background .13s ease,color .13s ease}.w-acct-add svg{width:15px;height:15px}.w-acct-add:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-tabs{display:flex;gap:2px}.w-tab{display:inline-flex;align-items:center;gap:7px;height:30px;flex:none;white-space:nowrap;padding:0 12px;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-muted);background:none;border:0;cursor:pointer;transition:color .14s ease,background .14s ease}.w-tab svg{width:14px;height:14px}.w-tab:hover,.w-tab--active{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-tab--active svg{color:var(--wa-primary)}.w-menu{width:264px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;padding:4px;overflow:hidden}.w-menu-head{display:flex;align-items:center;gap:11px;padding:11px 9px}.w-menu-item{display:flex;align-items:center;justify-content:flex-start;gap:10px;height:32px;padding:0 8px;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);cursor:pointer;transition:background .12s ease;width:100%;border:0;background:none;text-align:left;white-space:nowrap}.w-menu-item:hover{background:var(--wa-surface-subtle)}.w-menu-item svg{width:15px;height:15px;color:var(--wa-text-muted);flex:none}.w-menu-item--danger{color:var(--wa-error)}.w-menu-item--danger svg{color:var(--wa-error)}.w-menu-item--danger:hover{background:var(--wa-error-soft)}.w-menu-trail{margin-left:auto;font:400 10.5px/1 var(--wa-font-mono);color:var(--wa-text-faint)}.w-menu-label{font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);padding:10px 9px 5px}.w-orgtrigger{display:flex;align-items:center;gap:9px;width:100%;height:40px;padding:0 9px;border:0;border-radius:var(--wa-radius);background:transparent;color:var(--wa-text);cursor:pointer;font:400 13px/1 var(--wa-font-sans);text-align:left;transition:background .12s ease}.w-orgtrigger:hover,.w-orgtrigger[data-open]{background:var(--wa-surface-subtle)}.w-orgtrigger:disabled{opacity:.6;cursor:default}.w-orgtrigger>svg{color:var(--wa-text-faint);flex:none}.w-switch-body{overflow-y:auto;padding:4px 0}.w-switch-banner{margin:8px 8px 0}.w-switch-nest{display:flex;flex-direction:column;margin:2px 0 6px 24px;padding-left:8px;border-left:.5px solid var(--wa-border)}.w-menu-item--muted{color:var(--wa-text-muted)}.w-menu-item--muted svg{color:var(--wa-text-muted)}.w-rowact{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:5px;color:var(--wa-text-muted);cursor:pointer}.w-rowact:hover{color:var(--wa-text);background:var(--wa-border)}.w-rowact svg{width:13px;height:13px}.w-danger{border:.5px solid color-mix(in srgb,var(--wa-error) 30%,transparent);background:var(--wa-error-soft);border-radius:var(--wa-radius);padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:20px}.w-link{color:var(--wa-text);font-weight:400;cursor:pointer;text-decoration:none}.w-link--sm{font-size:12px}.w-link:hover{text-decoration:underline}.w-link--muted{color:var(--wa-text-muted)}.w-mono-faint{font:400 12px/1.4 var(--wa-font-mono);color:var(--wa-text-faint)}@keyframes w-spin{to{transform:rotate(360deg)}}.w-spin{display:inline-block;border-radius:50%;border:2px solid var(--wa-border-strong);border-top-color:var(--wa-primary);animation:w-spin .7s linear infinite}.w-spin--on-accent{border-color:#ffffff59;border-top-color:#fff}.w-loading{display:grid;place-items:center;gap:14px;padding:40px;text-align:center}.w-otp{display:flex;gap:8px}.w-otp .w-otp-cell{width:42px;height:48px;text-align:center;font:400 20px/1 var(--wa-font-mono);color:var(--wa-text);border:.5px solid var(--wa-border-strong);border-radius:var(--wa-radius);background:var(--wa-surface);display:grid;place-items:center}.w-otp .w-otp-cell[data-active],.w-otp .w-otp-cell:focus{outline:none;border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-otp .w-otp-cell[data-filled]{border-color:var(--wa-text-muted)}.w-otp[data-error] .w-otp-cell{border-color:color-mix(in srgb,var(--wa-error) 50%,var(--wa-border-strong))}.w-otp-caret{width:1.5px;height:22px;background:var(--wa-primary);animation:w-blink 1s steps(1) infinite}@keyframes w-blink{50%{opacity:0}}.w-addr-badge{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 6px 0 12px;border-radius:999px;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-secondary)}.w-addr-badge button{border:0;background:none;cursor:pointer;color:var(--wa-primary);font:400 12px/1 var(--wa-font-sans);padding:4px 8px;border-radius:6px}.w-addr-badge button:hover{background:var(--wa-primary-soft)}.w-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:48px 24px}.w-empty .w-empty-ic{display:grid;place-items:center;width:44px;height:44px;border-radius:var(--wa-radius-lg);background:var(--wa-primary-soft);color:var(--wa-primary)}.w-empty .w-empty-ic svg{width:20px;height:20px;color:var(--wa-primary)}.w-empty-text{display:flex;flex-direction:column;gap:4px}.w-empty h4{margin:0;font:500 14px/1.4 var(--wa-font-sans);color:var(--wa-text)}.w-empty p{margin:0;font:400 12px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);max-width:384px;text-wrap:pretty}.w-empty-action{margin-top:4px}.w-empty--fill{height:100%}.w-empty-ic--accent{width:44px;height:44px}.w-toast{display:inline-flex;align-items:center;gap:11px;padding:11px 13px 11px 14px;border-radius:var(--wa-radius-lg);background:var(--wa-surface);border:.5px solid var(--wa-border);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;min-width:280px;max-width:380px}.w-toast .w-toast-ic{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;flex:none}.w-toast .w-toast-ic svg{width:12px;height:12px}.w-toast--success .w-toast-ic{background:var(--wa-success-soft);color:var(--wa-success)}.w-toast--error .w-toast-ic{background:var(--wa-error-soft);color:var(--wa-error)}.w-toast-msg{flex:1;font:400 13px/1.35 var(--wa-font-sans);color:var(--wa-text)}.w-toast-x{border:0;background:none;cursor:pointer;color:var(--wa-text-faint);width:22px;height:22px;border-radius:6px;display:grid;place-items:center;flex:none}.w-toast-x:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-toast-x svg{width:12px;height:12px}.w-pop{width:320px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;overflow:hidden}.w-pop-body{padding:15px 15px 13px;display:flex;flex-direction:column;gap:11px}.w-pop-title{margin:0;font:400 13.5px/1.3 var(--wa-font-sans);letter-spacing:-.01em;color:var(--wa-text)}.w-pop-sub{margin:0;font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);text-wrap:pretty}.w-pop-title+.w-pop-sub{margin-top:-7px}.w-pop-foot{display:flex;gap:8px;justify-content:flex-end;padding:10px 14px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-pop-foot .w-btn{width:auto}.w-pop-icon{width:38px;height:38px;border-radius:var(--wa-radius);display:grid;place-items:center;flex:none}.w-pop-icon--danger{background:var(--wa-error-soft);color:var(--wa-error)}.w-pop-icon--warn{background:var(--wa-warning-soft);color:var(--wa-warning)}.w-pop-icon svg{width:18px;height:18px}.w-locked{display:flex;align-items:center;gap:10px;height:38px;padding:0 8px 0 13px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-locked .w-locked-ic{color:var(--wa-text-faint);flex:none}.w-locked .w-locked-ic svg{width:15px;height:15px;display:block}.w-locked .w-locked-val{flex:1;font:400 13.5px/1 var(--wa-font-sans);color:var(--wa-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-restricted{opacity:.55;cursor:not-allowed}.w-restricted *{pointer-events:none}.w-warn-ic{color:var(--wa-warning);display:inline-grid;place-items:center}.w-warn-ic svg{width:15px;height:15px}.w-codes{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:14px;border-radius:var(--wa-radius);background:var(--wa-surface-subtle);border:.5px solid var(--wa-border)}.w-codes span{font:400 13px/1.6 var(--wa-font-mono);color:var(--wa-text);text-align:center;letter-spacing:.04em}.w-qr{width:148px;height:148px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface);display:grid;place-items:center;color:var(--wa-text)}.w-banner{display:flex;gap:11px;padding:12px 14px;border-radius:var(--wa-radius);align-items:flex-start}.w-banner svg{width:16px;height:16px;flex:none;margin-top:1px}.w-banner-txt{font:400 12.5px/1.5 var(--wa-font-sans);text-wrap:pretty;color:var(--wa-text-secondary)}.w-banner--error{background:var(--wa-error-soft)}.w-banner--warn{background:var(--wa-warning-soft)}.w-banner--info{background:var(--wa-info-soft)}.w-banner--error svg{color:var(--wa-error)}.w-banner--warn svg{color:var(--wa-warning)}.w-banner--info svg{color:var(--wa-info)}.w-seg{display:inline-flex;padding:3px;gap:2px;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);border-radius:var(--wa-radius)}.w-seg button{height:28px;padding:0 12px;border:0;background:none;cursor:pointer;border-radius:4px;font:400 12px/1 var(--wa-font-sans);color:var(--wa-text-muted);white-space:nowrap}.w-seg button[data-on]{background:var(--wa-surface);color:var(--wa-text);box-shadow:0 0 0 .5px var(--wa-border)}.w-steps{display:flex;gap:6px;justify-content:center}.w-steps i{width:5px;height:5px;border-radius:999px;background:var(--wa-border-strong);transition:background .2s ease,width .2s ease}.w-steps i[data-on]{background:var(--wa-primary);width:16px}.w-ibadge{display:grid;place-items:center;width:48px;height:48px;flex:none;border-radius:var(--wa-radius-lg);background:var(--wa-primary-soft);color:var(--wa-primary);overflow:hidden}.w-ibadge svg{width:24px;height:24px}.w-ibadge img{width:100%;height:100%;object-fit:cover}.w-ibadge--done{width:52px;height:52px;border-radius:999px;background:var(--wa-success-soft);color:var(--wa-success)}.w-ibadge--done svg{width:26px;height:26px}.w-ibadge-wrap{position:relative}.w-ibadge-x{position:absolute;top:-6px;right:-6px;width:20px;height:20px;display:grid;place-items:center;border-radius:999px;border:.5px solid var(--wa-border);background:var(--wa-surface);color:var(--wa-text-muted);cursor:pointer;box-shadow:0 1px 2px #1414161f}.w-ibadge-x svg{width:11px;height:11px}.w-create-foot{padding:13px 32px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle);text-align:center}.w-create-summary{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;padding:12px 16px;border:.5px solid var(--wa-border);border-radius:var(--wa-radius)}.w-auth-card{width:min(440px,100%)}.w-auth-head{display:flex;flex-direction:column;align-items:center;gap:14px;margin-bottom:24px}.w-auth-head-text{display:flex;flex-direction:column;gap:6px;text-align:center}.w-auth-title{margin:0;font:400 21px/1.2 var(--wa-font-sans);letter-spacing:-.025em;color:var(--wa-text)}.w-auth-sub{margin:0;font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);text-wrap:pretty}.w-auth-status{display:flex;flex-direction:column;align-items:center;gap:16px;padding-top:4px;text-align:center}.w-auth-foot{font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted)}.w-fineprint{margin:2px 2px 0;font:400 11px/1.5 var(--wa-font-sans);color:var(--wa-text-faint);text-align:center;text-wrap:pretty}.w-switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;-webkit-user-select:none;user-select:none}.w-switch .w-switch-track{width:36px;height:20px;border-radius:999px;background:var(--wa-border-strong);border:.5px solid transparent;position:relative;transition:background .16s ease;flex:none}.w-switch .w-switch-knob{position:absolute;top:1.5px;left:1.5px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform .16s ease}.w-switch[data-on] .w-switch-track{background:var(--wa-primary)}.w-switch[data-on] .w-switch-knob{transform:translate(16px)}.w-switch-label{font:400 13px/1 var(--wa-font-sans);color:var(--wa-text)}.w-search{display:flex;align-items:center;gap:8px;height:32px;width:240px;max-width:100%;padding:0 11px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface)}.w-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:14px}.w-search svg{width:15px;height:15px;color:var(--wa-text-faint);flex:none}.w-search input{border:0;background:none;outline:none;flex:1;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);min-width:0}.w-search input::placeholder{color:var(--wa-text-faint)}.w-combo{display:flex;align-items:center;gap:8px;height:34px;padding:0 10px 0 12px;width:100%;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);cursor:pointer;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);transition:border-color .14s ease}.w-combo:hover{border-color:var(--wa-text-muted)}.w-combo[data-open]{border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-combo .w-combo-val{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-combo .w-combo-val[data-ph]{color:var(--wa-text-faint)}.w-combo svg{width:15px;height:15px;color:var(--wa-text-muted);flex:none}.w-combo-menu{width:100%;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;padding:4px;overflow:hidden}.w-combo-opt{display:flex;align-items:center;justify-content:flex-start;gap:9px;height:30px;padding:0 8px;border-radius:5px;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);cursor:pointer;width:100%;border:0;background:none;text-align:left;white-space:nowrap}.w-combo-opt>svg{width:15px;height:15px;flex:none;color:var(--wa-text-muted)}.w-combo-opt:hover{background:var(--wa-surface-subtle)}.w-combo-opt .w-combo-check{margin-left:auto;color:var(--wa-primary);display:grid;place-items:center}.w-combo-opt .w-combo-check svg{width:14px;height:14px}.w-combo-opt[data-disabled]{opacity:.5;cursor:not-allowed}.w-combo-grp{font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);padding:9px 9px 5px}.w-phone{display:flex;align-items:stretch;gap:0;width:100%}.w-phone .w-phone-cc{display:flex;align-items:center;gap:7px;height:34px;padding:0 10px;border:.5px solid var(--wa-border-strong);border-right:0;border-radius:var(--wa-radius) 0 0 var(--wa-radius);background:var(--wa-surface-subtle);cursor:pointer;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);white-space:nowrap}.w-phone .w-phone-cc svg{width:13px;height:13px;color:var(--wa-text-muted)}.w-phone input{flex:1;height:34px;padding:0 12px;border:.5px solid var(--wa-border-strong);border-radius:0 var(--wa-radius) var(--wa-radius) 0;background:var(--wa-surface);font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);outline:none;min-width:0}.w-phone input:focus{border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft);position:relative}.w-flag{width:18px;height:13px;border-radius:2px;display:inline-block;flex:none;box-shadow:inset 0 0 0 .5px #00000026}.w-country-pop{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:260px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;overflow:hidden}.w-country-search{display:flex;align-items:center;gap:8px;padding:9px 11px;border-bottom:.5px solid var(--wa-border)}.w-country-search svg{width:14px;height:14px;color:var(--wa-text-faint);flex:none}.w-country-search input{border:0;background:none;outline:none;flex:1;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);min-width:0}.w-country-search input::placeholder{color:var(--wa-text-faint)}.w-country-list{max-height:220px;overflow-y:auto;padding:5px}.w-country-opt{display:flex;align-items:center;gap:9px;height:32px;padding:0 9px;border-radius:5px;cursor:pointer;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);width:100%;border:0;background:none;text-align:left}.w-country-opt:hover{background:var(--wa-surface-subtle)}.w-country-opt .dial{margin-left:auto;color:var(--wa-text-muted);font:400 12px/1 var(--wa-font-mono);flex:none}.w-method-stack{display:flex;flex-direction:column;gap:10px}.w-method{display:flex;align-items:center;gap:13px;width:100%;padding:13px 14px;border:.5px solid var(--wa-border-strong);border-radius:var(--wa-radius);background:var(--wa-surface);cursor:pointer;text-align:left;transition:background .14s ease,border-color .14s ease}.w-method .w-method-ic{width:34px;height:34px;border-radius:var(--wa-radius);display:grid;place-items:center;background:var(--wa-surface-subtle);color:var(--wa-text-secondary);flex:none}.w-method .w-method-ic svg{width:17px;height:17px}.w-method .w-method-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.w-method .w-method-title{font:400 13.5px/1 var(--wa-font-sans);color:var(--wa-text)}.w-method .w-method-desc{font:400 12px/1.4 var(--wa-font-sans);color:var(--wa-text-muted)}.w-method .w-method-go{color:var(--wa-text-faint);flex:none}.w-method .w-method-go svg{width:16px;height:16px}.w-method[data-disabled]{opacity:.5;cursor:not-allowed}.w-overlay{position:relative;width:100%;height:100%;background:color-mix(in srgb,#000 38%,transparent);display:grid;place-items:center;border-radius:inherit}.w-dialog{background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;width:100%;max-width:480px;overflow:hidden;display:flex;flex-direction:column}.w-dialog--panel{display:block;width:880px;max-width:100%;height:min(560px,calc(100dvh - 40px));overflow-y:auto}.w-dialog--panel .w-card{background:transparent;border-radius:0;box-shadow:none}@media(max-width:640px){.w-dialog--panel{height:calc(100dvh - 16px)}}.w-dialog--create{background:transparent;border:0;box-shadow:none;width:440px;max-width:100%;align-items:center;scrollbar-gutter:stable both-edges}.w-create-card{width:440px;max-width:100%}.w-create-body{padding:34px 32px 28px}.w-create-head{margin-bottom:24px}.w-create-steps{margin-bottom:22px}.w-text-center{text-align:center}.w-linkbtn{background:none;border:0;padding:0;cursor:pointer}.w-modal{position:fixed;top:0;right:0;bottom:0;left:0;background:#08080c80;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:flex;justify-content:center;align-items:center;padding:20px;z-index:99999}@media(max-width:640px){.w-modal{padding:8px}}.w-dialog-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:.5px solid var(--wa-border)}.w-dialog-title{margin:0;font:400 15px/1.2 var(--wa-font-sans);letter-spacing:-.01em;color:var(--wa-text)}.w-dialog-body{padding:20px;display:flex;flex-direction:column;gap:14px}.w-dialog-foot{display:flex;gap:8px;justify-content:flex-end;padding:14px 20px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-vtabs{display:flex;flex-direction:column;gap:2px}.w-vtab{display:flex;align-items:center;gap:10px;height:34px;padding:0 11px;border-radius:var(--wa-radius);font:400 13px/1 var(--wa-font-sans);color:var(--wa-text-muted);background:none;border:0;cursor:pointer;text-align:left;width:100%}.w-vtab svg{width:15px;height:15px}.w-vtab:hover,.w-vtab[data-on]{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-vtab[data-on] svg{color:var(--wa-primary)}@keyframes w-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.w-skel{border-radius:6px;background:linear-gradient(90deg,var(--wa-surface-subtle) 25%,var(--wa-border) 37%,var(--wa-surface-subtle) 63%);background-size:200% 100%;animation:w-shimmer 1.4s ease infinite}.w-auth-skel{display:flex;flex-direction:column;gap:22px}.w-auth-skel-head{display:flex;flex-direction:column;align-items:center;gap:12px;margin-bottom:2px}.w-auth-skel-fields{display:flex;flex-direction:column;gap:15px}.w-auth-skel-field{display:flex;flex-direction:column;gap:7px}.w-skel-avatar{width:44px;height:44px;border-radius:50%}.w-skel-line{height:10px}.w-skel-title{height:16px;width:56%}.w-skel-sub{height:11px;width:78%}.w-skel-label{height:9px;width:34%}.w-skel-input{height:38px;border-radius:var(--wa-radius)}.w-skel-btn{height:38px;border-radius:var(--wa-radius);margin-top:3px}.w-table{width:100%;border-collapse:separate;border-spacing:0;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);overflow:hidden}.w-table thead{background:var(--wa-surface-subtle)}.w-table th{text-align:left;padding:9px 16px;font:400 11px/1 var(--wa-font-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--wa-text-faint);white-space:nowrap;border-bottom:.5px solid var(--wa-border)}.w-table th:last-child{text-align:right}.w-table td{padding:11px 16px;font:400 13px/1.35 var(--wa-font-sans);color:var(--wa-text-secondary);vertical-align:middle;white-space:nowrap}.w-table tbody tr{transition:background .12s ease}.w-table tbody tr:not(:last-child) td{border-bottom:.5px solid var(--wa-border)}.w-table tbody tr:hover td{background:var(--wa-surface-subtle)}.w-table tbody tr:last-child td:last-child{overflow:visible}.w-td--flex>div{display:flex;align-items:center;gap:10px}.w-td--actions{text-align:right;width:auto;white-space:nowrap;position:relative;overflow:visible}.w-td--actions>*{width:fit-content;margin-left:auto}.w-td--actions>[data-dropdown-trigger]{display:inline-flex;width:fit-content;margin-left:auto}.w-actions{display:flex;gap:6px;justify-content:flex-end;align-items:center}.w-kebab{width:28px;height:28px;border-radius:6px;border:0;background:none;cursor:pointer;color:var(--wa-text-muted);display:grid;place-items:center}.w-kebab:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-kebab svg{width:16px;height:16px}.w-token{display:flex;align-items:center;gap:8px;height:36px;padding:0 6px 0 12px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-token code{flex:1;font:400 12px/1 var(--wa-font-mono);color:var(--wa-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-page-head{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:18px 22px}.w-tabsbar{flex:none;padding:0 22px;border-bottom:.5px solid var(--wa-border);overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.w-tabsbar::-webkit-scrollbar{display:none}.w-tabbody{flex:1;min-height:0;padding:20px 22px;overflow-y:auto;overflow-x:auto}.w-tabpane{min-width:300px}.w-card-head{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:16px;padding:16px 20px}.w-card-body{padding:16px 20px}.w-card-foot{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;padding:14px 20px;border-top:.5px solid var(--wa-border)}.w-sechead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.w-iconbox{width:22px;height:22px;flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}.w-iconbox svg,.w-iconbox img{width:22px;height:22px;display:block}.w-vrow{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 0}.w-vrow:not(:last-child){border-bottom:.5px solid var(--wa-border)}.w-row-act-top{align-self:flex-start;margin-top:20px}.w-rowitem{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px}.w-rowitem:not(:last-child){border-bottom:.5px solid var(--wa-border)}.w-aside-copy{max-width:220px;text-align:center}.w-split{display:flex;min-height:400px;border-radius:var(--wa-radius-lg);overflow:hidden;border:.5px solid var(--wa-border);background:var(--wa-surface)}.w-split-aside{width:35%;min-width:200px;flex:none;background:var(--wa-surface-subtle);border-right:.5px solid var(--wa-border);padding:28px;display:flex;flex-direction:column;gap:14px}.w-split-main{flex:1;min-width:0;padding:28px;display:flex;flex-direction:column;gap:16px}@media(max-width:600px){.w-split{flex-direction:column}.w-split-aside{width:100%;border-right:0;border-bottom:.5px solid var(--wa-border)}}.w-listrow{display:flex;align-items:center;gap:12px;width:100%;padding:12px 0;text-align:left;border:0;border-bottom:.5px solid var(--wa-border);background:transparent;cursor:pointer;transition:background .12s ease}.w-listrow:last-child{border-bottom:0}.w-listrow:hover{background:var(--wa-surface-subtle)}.w-listrow:disabled{opacity:.6;cursor:not-allowed}.w-tile{border:.5px solid var(--wa-border);border-radius:var(--wa-radius);padding:12px;background:var(--wa-surface-subtle)}.w-input--area{min-height:80px;padding-top:9px;padding-bottom:9px;resize:vertical;line-height:1.5}.w-input--mono{font-family:var(--wa-font-mono)}.w-pop--wide{width:372px;max-width:calc(100vw - 24px);overflow:visible}.w-pop .w-input:not(.w-input--area),.w-pop .w-combo{height:32px}.w-feature-badge{width:52px;height:52px;border-radius:999px;display:grid;place-items:center;color:var(--wa-primary-foreground);background:linear-gradient(135deg,var(--wa-primary),var(--wa-primary-tint, #9277ff));box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-primary) 55%,transparent);margin-bottom:18px}.w-narrow{max-width:420px;margin:0 auto}.w-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.w-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.w-grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}@media(max-width:600px){.w-grid-2,.w-grid-3,.w-grid-4{grid-template-columns:1fr}}.w-toast--fixed{position:fixed;bottom:20px;right:20px;z-index:1000}.w-toast--contained{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:20;width:max-content;max-width:calc(100% - 32px)}.w-notif-badge{position:absolute;top:4px;right:4px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--wa-error);color:#fff;font:500 9px/1 var(--wa-font-sans);display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--wa-surface)}.w-notif-badge[data-dot]{top:6px;right:6px;min-width:8px;height:8px;padding:0}.w-notif-row{cursor:pointer;padding:12px 16px;border-bottom:.5px solid var(--wa-border)}.w-notif-row[data-unread]{background:var(--wa-surface-subtle)}.w-notif-dot{width:8px;height:8px;border-radius:50%;background:var(--wa-primary);flex:none}.w-btn--icon[data-on]{color:var(--wa-warning)}.w-notif-pop{position:fixed;width:450px;max-width:calc(100vw - 24px);z-index:99999}.w-notif-panel{width:450px;max-width:100%;height:100%;background:var(--wa-surface);overflow:hidden}.w-notif-panel--fill{width:100%}.w-notif-head{padding:12px 16px;border-bottom:.5px solid var(--wa-border)}.w-notif-body{overflow-y:auto;background:var(--wa-surface)}.w-notif-menu{position:absolute;top:48px;right:12px;width:200px;z-index:100000}.w-banner--success{background:var(--wa-success-soft)}.w-banner--success svg{color:var(--wa-success)}@keyframes w-pop{0%{transform:scale(.5);opacity:0}60%{transform:scale(1.06)}to{transform:scale(1);opacity:1}}@keyframes w-ring{0%{transform:scale(.85);opacity:.45}to{transform:scale(1.9);opacity:0}}@keyframes w-draw{to{stroke-dashoffset:0}}@keyframes w-indeterminate{0%{transform:translate(-100%)}to{transform:translate(330%)}}.w-success{position:relative;display:grid;place-items:center;width:56px;height:56px}.w-success .ring{position:absolute;top:2px;right:2px;bottom:2px;left:2px;border-radius:999px;border:1.5px solid var(--wa-success);opacity:0}.w-success .disc{width:52px;height:52px;border-radius:999px;background:var(--wa-success);color:#fff;display:grid;place-items:center;box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-success) 55%,transparent)}.w-success .disc svg{width:26px;height:26px}.w-success--error .ring{border-color:var(--wa-error)}.w-success--error .disc{background:var(--wa-error);box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-error) 55%,transparent)}.w-success--info .ring{border-color:var(--wa-info)}.w-success--info .disc{background:var(--wa-info);box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-info) 55%,transparent)}.w-progress{position:relative;width:70%;height:3px;border-radius:999px;background:var(--wa-border);overflow:hidden}.w-progress:after{content:"";position:absolute;top:0;left:0;width:30%;height:100%;border-radius:999px;background:var(--wa-primary)}@media(prefers-reduced-motion:no-preference){.w-success .ring{animation:w-ring 1.7s ease-out infinite}.w-success .disc{animation:w-pop .42s cubic-bezier(.2,.9,.3,1.2)}.w-success .disc svg path{stroke-dasharray:26;stroke-dashoffset:26;animation:w-draw .4s .22s ease forwards}.w-progress:after{animation:w-indeterminate 1.15s ease-in-out infinite}}.w-sso-conn{padding-bottom:24px}.w-sso-conn:not(:last-child){margin-bottom:24px;border-bottom:.5px solid var(--wa-border)}.w-sso-detail{display:grid;grid-template-columns:auto 1fr;gap:4px 32px}.w-sso-scim{padding-top:16px;border-top:.5px solid var(--wa-border)}.w-sso-template{padding:12px;background:var(--wa-primary-soft);border-radius:var(--wa-radius);border:.5px solid var(--wa-primary)}.w-sso-check{padding:8px 12px;background:var(--wa-surface);border-radius:var(--wa-radius);border:.5px solid var(--wa-border)}.w-sso-check-mark{min-width:12px}.w-sso-tile{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 10px;border:.5px solid var(--wa-border);border-radius:var(--wa-radius);background:var(--wa-surface);cursor:pointer;transition:border-color .14s ease,background .14s ease}.w-sso-tile:hover{border-color:var(--wa-border-strong);background:var(--wa-surface-subtle)}.w-sso-logo{object-fit:contain;background:var(--wa-surface);padding:4px}.w-sso-logo--ph{background:var(--wa-surface)}.w-token-chip{background:var(--wa-surface-subtle);padding:2px 6px;border-radius:4px;color:var(--wa-text)}.w-disclosure{cursor:pointer;font:400 12.5px/1 var(--wa-font-sans)}.w-disclosure-caret{font-size:9px}.w-break-all{word-break:break-all}.w-col-full{grid-column:1 / -1}.dark .w-card{box-shadow:0 0 0 .5px var(--wa-border),0 2px 4px #0006,0 28px 60px -20px #000000b3}.dark .w-menu,.dark .w-pop,.dark .w-toast,.dark .w-dialog,.dark .w-combo-menu,.dark .w-country-pop{box-shadow:0 1px 2px #00000080,0 18px 44px -14px #000000b3}.dark .w-btn--secondary,.dark .w-social{box-shadow:inset 0 1px #ffffff0d,0 1px 1.5px #1414160a}.w-flex{display:flex}.w-inline{display:inline-flex}.w-items-center{align-items:center}.w-items-start{align-items:flex-start}.w-items-end{align-items:flex-end}.w-justify-start{justify-content:flex-start}.w-justify-center{justify-content:center}.w-justify-end{justify-content:flex-end}.w-justify-between{justify-content:space-between}',em=Q8`
99
+ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`),window[$s]+=1);const J8='.wacht-root{--wa-surface: var(--wa-ov-light-surface, #ffffff);--wa-surface-subtle: var(--wa-ov-light-surface_subtle, #fafaf8);--wa-background: var(--wa-ov-light-background, #f5f5f2);--wa-canvas: var(--wa-ov-light-canvas, #ebebe7);--wa-text: var(--wa-ov-light-text, #161618);--wa-text-secondary: var(--wa-ov-light-text_secondary, #3b3b3f);--wa-text-muted: var(--wa-ov-light-text_muted, #76767c);--wa-text-faint: var(--wa-ov-light-text_faint, #a8a8ad);--wa-border: var(--wa-ov-light-border, rgba(20, 20, 22, .08));--wa-border-strong: var(--wa-ov-light-border_strong, rgba(20, 20, 22, .14));--wa-primary: var(--wa-ov-light-primary, #6b3df5);--wa-primary-soft: var(--wa-ov-light-primary_soft, rgba(107, 61, 245, .1));--wa-primary-foreground: var(--wa-ov-light-primary_foreground, #ffffff);--wa-success: var(--wa-ov-light-success, #0f8a4a);--wa-success-soft: var(--wa-ov-light-success_soft, rgba(15, 138, 74, .12));--wa-info: var(--wa-ov-light-info, #2f6fdb);--wa-info-soft: var(--wa-ov-light-info_soft, rgba(47, 111, 219, .1));--wa-warning: var(--wa-ov-light-warning, #a8650a);--wa-warning-soft: var(--wa-ov-light-warning_soft, rgba(168, 101, 10, .12));--wa-error: var(--wa-ov-light-error, #c4271f);--wa-error-soft: var(--wa-ov-light-error_soft, rgba(196, 39, 31, .1));--wa-radius: var(--wa-ov-light-radius, 6px);--wa-radius-lg: var(--wa-ov-light-radius_lg, 10px);--wa-font-sans: var(--wa-ov-light-font_sans, "Geist", "Inter"), system-ui, -apple-system, sans-serif;--wa-font-mono: var(--wa-ov-light-font_mono, "Geist Mono"), ui-monospace, SFMono-Regular, Menlo, monospace;font-family:var(--wa-font-sans)}.dark .wacht-root,.wacht-root.dark{--wa-surface: var(--wa-ov-dark-surface, #131318);--wa-surface-subtle: var(--wa-ov-dark-surface_subtle, #101015);--wa-background: var(--wa-ov-dark-background, #0d0d10);--wa-canvas: var(--wa-ov-dark-canvas, #050507);--wa-text: var(--wa-ov-dark-text, #ececef);--wa-text-secondary: var(--wa-ov-dark-text_secondary, #c5c5cb);--wa-text-muted: var(--wa-ov-dark-text_muted, #8a8a92);--wa-text-faint: var(--wa-ov-dark-text_faint, #57575e);--wa-border: var(--wa-ov-dark-border, rgba(255, 255, 255, .07));--wa-border-strong: var(--wa-ov-dark-border_strong, rgba(255, 255, 255, .14));--wa-primary: var(--wa-ov-dark-primary, #9277ff);--wa-primary-soft: var(--wa-ov-dark-primary_soft, rgba(146, 119, 255, .16));--wa-primary-foreground: var(--wa-ov-dark-primary_foreground, #ffffff);--wa-success: var(--wa-ov-dark-success, #0f8a4a);--wa-success-soft: var(--wa-ov-dark-success_soft, rgba(15, 138, 74, .18));--wa-info: var(--wa-ov-dark-info, #2f6fdb);--wa-info-soft: var(--wa-ov-dark-info_soft, rgba(47, 111, 219, .18));--wa-warning: var(--wa-ov-dark-warning, #a8650a);--wa-warning-soft: var(--wa-ov-dark-warning_soft, rgba(168, 101, 10, .18));--wa-error: var(--wa-ov-dark-error, #c4271f);--wa-error-soft: var(--wa-ov-dark-error_soft, rgba(196, 39, 31, .18));--wa-radius: var(--wa-ov-dark-radius, 6px);--wa-radius-lg: var(--wa-ov-dark-radius_lg, 10px);--wa-font-sans: var(--wa-ov-dark-font_sans, "Geist", "Inter"), system-ui, -apple-system, sans-serif;--wa-font-mono: var(--wa-ov-dark-font_mono, "Geist Mono"), ui-monospace, SFMono-Regular, Menlo, monospace}.wacht-root *{box-sizing:border-box}',X8='.w-flex-col{display:flex;flex-direction:column}.w-inline{display:inline-flex;align-items:center}.w-wrap{flex-wrap:wrap}.w-grow{flex:1 1 auto;min-width:0}.w-none{flex:none}.w-full{width:100%}.w-gap-1{gap:4px}.w-gap-2{gap:8px}.w-gap-3{gap:12px}.w-gap-4{gap:16px}.w-gap-5{gap:20px}.w-gap-6{gap:24px}.w-truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-contents{display:contents}.w-h-full{height:100%}.w-minh-full{min-height:100%}.w-mono-sm{font:400 12px/1.4 var(--wa-font-mono);color:var(--wa-text-muted)}.w-text-primary{color:var(--wa-primary)}.w-text-secondary{color:var(--wa-text-secondary)}.w-text-muted{color:var(--wa-text-muted)}.w-text-faint{color:var(--wa-text-faint)}.w-text-error{color:var(--wa-error)}.w-text-success{color:var(--wa-success)}.w-text-warning{color:var(--wa-warning)}.w-mb-4{margin-bottom:16px}.w-mt-6{margin-top:24px}.w-maxw-sm{max-width:340px}.w-rolepick-btn{min-width:120px}.w-combo-menu--pop{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:60}.w-relative{position:relative}.w-card{background:var(--wa-surface);border:0;border-radius:var(--wa-radius-lg);box-shadow:0 0 0 .5px var(--wa-border),0 1px 1px #1414160a,0 4px 8px -4px #14141614,0 24px 48px -16px #14141629;overflow:hidden}.w-eyebrow{font:400 10px/1 var(--wa-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--wa-text-faint)}.w-title{font:400 17px/1.25 var(--wa-font-sans);letter-spacing:-.02em;color:var(--wa-text);margin:0}.w-title-lg{font:400 19px/1.2 var(--wa-font-sans);letter-spacing:-.022em;color:var(--wa-text);margin:0}.w-sub{font:400 13px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);margin:0}.w-sec{font:400 13px/1.3 var(--wa-font-sans);color:var(--wa-text);margin:0}.w-secsub{font:400 12px/1.45 var(--wa-font-sans);color:var(--wa-text-muted);margin:0}.w-btn{height:32px;padding:0 13px;border-radius:var(--wa-radius);border:.5px solid transparent;font:400 12.5px/1 var(--wa-font-sans);display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background .14s ease,border-color .14s ease,filter .14s ease,box-shadow .14s ease;background:transparent;color:var(--wa-text)}.w-btn:focus-visible{outline:none;box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-btn:disabled{opacity:.6;cursor:not-allowed}.w-btn svg{width:14px;height:14px;flex:none}.w-btn.w-notif-bell{width:32px;height:32px}.w-btn.w-notif-bell svg{width:18px;height:18px}.w-btn--primary{background:var(--wa-primary);color:var(--wa-primary-foreground);box-shadow:inset 0 1px #ffffff2e,0 1px 2px #1414161f,0 2px 8px -2px color-mix(in srgb,var(--wa-primary) 50%,transparent);background-image:linear-gradient(180deg,#ffffff1a,#fff0 42%)}.w-btn--primary:active:not(:disabled){filter:brightness(.97);box-shadow:inset 0 1px 2px #14141633}.w-btn--block{width:100%;height:38px;font-size:13px}.w-btn--secondary{background:var(--wa-surface);border-color:var(--wa-border-strong);color:var(--wa-text);box-shadow:inset 0 1px #ffffff80,0 1px 1.5px #1414160a}.w-btn--ghost{background:transparent;color:var(--wa-text-secondary)}.w-btn--danger{background:transparent;color:var(--wa-error);border-color:color-mix(in srgb,var(--wa-error) 26%,transparent)}.w-btn--danger-solid{background:var(--wa-error);color:#fff}.w-btn--sm{height:26px;padding:0 9px;font-size:11.5px}.w-btn--lg{height:42px;padding:0 18px;font-size:13.5px}.w-btn--icon{height:28px;width:28px;padding:0;color:var(--wa-text-muted)}.w-btn--icon:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-social{height:40px;width:100%;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);color:var(--wa-text);font:400 13px/1 var(--wa-font-sans);display:flex;align-items:center;justify-content:center;gap:10px;padding:0 14px;cursor:pointer;position:relative;box-shadow:inset 0 1px #ffffff80,0 1px 1.5px #1414160a;transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .1s ease}.w-social:active{transform:translateY(.5px)}.w-social:focus-visible{outline:none;box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-social svg,.w-social img{width:17px;height:17px;flex:none}.w-social .w-social-label{flex:none}.w-social .w-lastused{position:absolute;top:-9px;right:12px;white-space:nowrap;font:400 9.5px/1 var(--wa-font-mono);letter-spacing:.04em;color:var(--wa-text-muted);background:var(--wa-surface);border:.5px solid var(--wa-border);padding:3px 6px;border-radius:5px}.w-field{display:flex;flex-direction:column;gap:7px}.w-label{font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);display:flex;align-items:center;gap:4px;letter-spacing:-.005em;white-space:nowrap}.w-req{color:var(--wa-error);font-size:12px}.w-input{height:34px;padding:0 12px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);color:var(--wa-text);font:400 13px/1 var(--wa-font-sans);width:100%;box-shadow:inset 0 1px 2px #1414160d;transition:border-color .14s ease,box-shadow .14s ease}.w-input::placeholder{color:var(--wa-text-faint)}.w-input:focus{outline:none;border-color:var(--wa-primary);box-shadow:inset 0 1px 2px #1414160a,0 0 0 3px var(--wa-primary-soft)}.w-input-row{display:flex;align-items:center;gap:6px}.w-input-trail{margin-left:-34px;z-index:1}.w-input-wrap{position:relative}.w-input--valid:focus{border-color:var(--wa-success);box-shadow:0 0 0 3px var(--wa-success-soft)}.w-input--invalid,.w-input[aria-invalid=true]{border-color:color-mix(in srgb,var(--wa-error) 55%,var(--wa-border-strong))}.w-input--invalid:focus,.w-input[aria-invalid=true]:focus{border-color:var(--wa-error);box-shadow:0 0 0 3px var(--wa-error-soft)}.w-input:disabled,.w-input[data-disabled]{opacity:.55;cursor:not-allowed}.w-input-err{font:400 11.5px/1.3 var(--wa-font-sans);color:var(--wa-error)}.w-input-ok{font:400 11.5px/1.3 var(--wa-font-sans);color:var(--wa-success)}.w-input-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:28px;height:28px;display:grid;place-items:center;border:0;background:none;cursor:pointer;color:var(--wa-text-faint);border-radius:6px}.w-input-eye:hover{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-input-eye svg{width:15px;height:15px}.w-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font:400 var(--av-fs, 13px)/1 var(--wa-font-sans);color:#fff;flex:none;background:var( --av-bg, linear-gradient( 135deg, var(--wa-primary), var( --wa-primary-tint, color-mix(in srgb, var(--wa-primary), #fff 25%) ) ) );box-shadow:inset 0 0 0 .5px #ffffff29;letter-spacing:.01em;overflow:hidden}.w-avatar img{width:100%;height:100%;object-fit:cover}.w-avatar--square{border-radius:var(--wa-radius)}.w-avatar--sm{width:20px;height:20px;font-size:10px}.w-avatar--md{width:28px;height:28px;font-size:11px}.w-avatar--lg{width:44px;height:44px;font-size:15px}.w-avatar--xl{width:80px;height:80px;font-size:24px}.w-avatar-edit{position:relative;cursor:pointer;border:0;padding:0}.w-avatar-edit .w-avatar-veil{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;display:grid;place-items:center;color:#fff;background:color-mix(in srgb,#000 45%,transparent);opacity:0;transition:opacity .15s ease;font:400 11px/1.2 var(--wa-font-sans);text-align:center;padding:0 6px}.w-avatar-edit:hover .w-avatar-veil,.w-avatar-edit[data-busy] .w-avatar-veil{opacity:1}.w-avatar-veil svg{width:18px;height:18px}.w-pill{display:inline-flex;align-items:center;gap:6px;height:21px;padding:0 8px;border-radius:4px;font:400 10.5px/1 var(--wa-font-mono);text-transform:lowercase;letter-spacing:.01em;background:var(--wa-surface-subtle);color:var(--wa-text-muted);border:.5px solid var(--wa-border);white-space:nowrap;flex:none}.w-pill .w-dot{width:5px;height:5px;border-radius:999px;background:var(--wa-text-faint)}.w-pill--success{background:var(--wa-success-soft);color:var(--wa-success);border-color:color-mix(in srgb,var(--wa-success) 26%,transparent)}.w-pill--success .w-dot{background:var(--wa-success)}.w-pill--warning{background:var(--wa-warning-soft);color:var(--wa-warning);border-color:color-mix(in srgb,var(--wa-warning) 26%,transparent)}.w-pill--warning .w-dot{background:var(--wa-warning)}.w-pill--info{background:var(--wa-info-soft);color:var(--wa-info);border-color:color-mix(in srgb,var(--wa-info) 26%,transparent)}.w-pill--info .w-dot{background:var(--wa-info)}.w-pill--current{background:var(--wa-primary-soft);color:var(--wa-primary);border-color:color-mix(in srgb,var(--wa-primary) 26%,transparent)}.w-pill--error{background:var(--wa-error-soft);color:var(--wa-error);border-color:color-mix(in srgb,var(--wa-error) 26%,transparent)}.w-pill--error .w-dot{background:var(--wa-error)}.w-pill--pending{background:transparent;color:var(--wa-warning);border:.5px dashed color-mix(in srgb,var(--wa-warning) 55%,transparent)}.w-pill--pending .w-dot{background:var(--wa-warning)}.w-chip{display:inline-flex;align-items:center;gap:7px;height:24px;padding:0 5px 0 9px;border-radius:var(--wa-radius);background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);font:400 12px/1 var(--wa-font-mono);color:var(--wa-text-secondary)}.w-chip-x{display:grid;place-items:center;width:16px;height:16px;border-radius:3px;color:var(--wa-text-faint);cursor:pointer}.w-chip-x:hover{background:var(--wa-border);color:var(--wa-text)}.w-chip-x svg{width:11px;height:11px}.w-or{display:flex;align-items:center;gap:14px;margin:18px 0}.w-or:before,.w-or:after{content:"";height:.5px;background:var(--wa-border);flex:1}.w-or span{font:400 10px/1 var(--wa-font-mono);letter-spacing:.14em;color:var(--wa-text-faint)}.w-hr{height:.5px;background:var(--wa-border);border:0;margin:0;width:100%}.w-list{display:flex;flex-direction:column}.w-listhead{display:grid;align-items:center;padding:0 2px 8px;font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);border-bottom:.5px solid var(--wa-border)}.w-row{display:grid;align-items:center;padding:13px 2px;border-bottom:.5px solid var(--wa-border)}.w-row:last-child{border-bottom:0}.w-row--hover{border-radius:var(--wa-radius);margin:0 -8px;padding:11px 10px;border-bottom:0;transition:background .12s ease}.w-row--hover:hover{background:var(--wa-surface-subtle)}.w-acct{display:flex;align-items:center;gap:13px;width:100%;text-align:left;padding:11px 12px;border:.5px solid transparent;border-radius:var(--wa-radius-lg);background:none;cursor:pointer;transition:background .13s ease,border-color .13s ease}.w-acct:hover{background:var(--wa-surface-subtle)}.w-acct[data-active]{background:var(--wa-surface-subtle);border-color:var(--wa-border)}.w-acct .w-acct-go{color:var(--wa-text-faint);flex:none;opacity:0;transform:translate(-4px);transition:opacity .13s ease,transform .13s ease}.w-acct:hover .w-acct-go{opacity:1;transform:none;color:var(--wa-text-muted)}.w-acct[data-busy]{opacity:.55;pointer-events:none}.w-acct-list{border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);overflow:hidden;margin-bottom:18px}.w-acct-list-head{padding:11px 14px;border-bottom:.5px solid var(--wa-border)}.w-acct-list-body{padding:6px}.w-acct-text{flex:1;min-width:0;text-align:left}.w-acct-name{display:block;font:400 13px/1.3 var(--wa-font-sans);color:var(--wa-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-acct-text .w-secsub{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-acct .w-avatar{width:34px;height:34px;flex:none}.w-acct[data-active] .w-avatar{width:40px;height:40px}.w-acct-add-ic{width:36px;height:36px;border-radius:50%;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);display:grid;place-items:center;color:var(--wa-text-muted);flex:none;transition:color .13s ease,border-color .13s ease}.w-acct--add:hover .w-acct-add-ic{color:var(--wa-text);border-color:var(--wa-text-muted)}.w-acct-out{color:var(--wa-text-faint);flex:none;margin-right:-6px}.w-acct-out:hover{color:var(--wa-error);background:var(--wa-error-soft)}.w-acct--add:hover{background:var(--wa-surface-subtle)}.w-acct-foot{margin-top:8px;padding-top:10px}.w-acct-add{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;height:36px;border:0;background:none;cursor:pointer;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-muted);transition:background .13s ease,color .13s ease}.w-acct-add svg{width:15px;height:15px}.w-acct-add:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-tabs{display:flex;gap:2px}.w-tab{display:inline-flex;align-items:center;gap:7px;height:30px;flex:none;white-space:nowrap;padding:0 12px;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-muted);background:none;border:0;cursor:pointer;transition:color .14s ease,background .14s ease}.w-tab svg{width:14px;height:14px}.w-tab:hover,.w-tab--active{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-tab--active svg{color:var(--wa-primary)}.w-menu{width:264px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;padding:4px;overflow:hidden}.w-menu-head{display:flex;align-items:center;gap:11px;padding:11px 9px}.w-menu-item{display:flex;align-items:center;justify-content:flex-start;gap:10px;height:32px;padding:0 8px;border-radius:var(--wa-radius);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);cursor:pointer;transition:background .12s ease;width:100%;border:0;background:none;text-align:left;white-space:nowrap}.w-menu-item:hover{background:var(--wa-surface-subtle)}.w-menu-item svg{width:15px;height:15px;color:var(--wa-text-muted);flex:none}.w-menu-item--danger{color:var(--wa-error)}.w-menu-item--danger svg{color:var(--wa-error)}.w-menu-item--danger:hover{background:var(--wa-error-soft)}.w-menu-trail{margin-left:auto;font:400 10.5px/1 var(--wa-font-mono);color:var(--wa-text-faint)}.w-menu-label{font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);padding:10px 9px 5px}.w-orgtrigger{display:flex;align-items:center;gap:9px;width:100%;height:40px;padding:0 9px;border:0;border-radius:var(--wa-radius);background:transparent;color:var(--wa-text);cursor:pointer;font:400 13px/1 var(--wa-font-sans);text-align:left;transition:background .12s ease}.w-orgtrigger:hover,.w-orgtrigger[data-open]{background:var(--wa-surface-subtle)}.w-orgtrigger:disabled{opacity:.6;cursor:default}.w-orgtrigger>svg{color:var(--wa-text-faint);flex:none}.w-switch-body{overflow-y:auto;padding:4px 0}.w-switch-banner{margin:8px 8px 0}.w-switch-nest{display:flex;flex-direction:column;margin:2px 0 6px 24px;padding-left:8px;border-left:.5px solid var(--wa-border)}.w-menu-item--muted{color:var(--wa-text-muted)}.w-menu-item--muted svg{color:var(--wa-text-muted)}.w-rowact{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:5px;color:var(--wa-text-muted);cursor:pointer}.w-rowact:hover{color:var(--wa-text);background:var(--wa-border)}.w-rowact svg{width:13px;height:13px}.w-danger{border:.5px solid color-mix(in srgb,var(--wa-error) 30%,transparent);background:var(--wa-error-soft);border-radius:var(--wa-radius);padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:20px}.w-link{color:var(--wa-text);font-weight:400;cursor:pointer;text-decoration:none}.w-link--sm{font-size:12px}.w-link:hover{text-decoration:underline}.w-link--muted{color:var(--wa-text-muted)}.w-mono-faint{font:400 12px/1.4 var(--wa-font-mono);color:var(--wa-text-faint)}@keyframes w-spin{to{transform:rotate(360deg)}}.w-spin{display:inline-block;border-radius:50%;border:2px solid var(--wa-border-strong);border-top-color:var(--wa-primary);animation:w-spin .7s linear infinite}.w-spin--on-accent{border-color:#ffffff59;border-top-color:#fff}.w-loading{display:grid;place-items:center;gap:14px;padding:40px;text-align:center}.w-otp{display:flex;gap:8px}.w-otp .w-otp-cell{width:42px;height:48px;text-align:center;font:400 20px/1 var(--wa-font-mono);color:var(--wa-text);border:.5px solid var(--wa-border-strong);border-radius:var(--wa-radius);background:var(--wa-surface);display:grid;place-items:center}.w-otp .w-otp-cell[data-active],.w-otp .w-otp-cell:focus{outline:none;border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-otp .w-otp-cell[data-filled]{border-color:var(--wa-text-muted)}.w-otp[data-error] .w-otp-cell{border-color:color-mix(in srgb,var(--wa-error) 50%,var(--wa-border-strong))}.w-otp-caret{width:1.5px;height:22px;background:var(--wa-primary);animation:w-blink 1s steps(1) infinite}@keyframes w-blink{50%{opacity:0}}.w-addr-badge{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 6px 0 12px;border-radius:999px;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text-secondary)}.w-addr-badge button{border:0;background:none;cursor:pointer;color:var(--wa-primary);font:400 12px/1 var(--wa-font-sans);padding:4px 8px;border-radius:6px}.w-addr-badge button:hover{background:var(--wa-primary-soft)}.w-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:48px 24px}.w-empty .w-empty-ic{display:grid;place-items:center;width:44px;height:44px;border-radius:var(--wa-radius-lg);background:var(--wa-primary-soft);color:var(--wa-primary)}.w-empty .w-empty-ic svg{width:20px;height:20px;color:var(--wa-primary)}.w-empty-text{display:flex;flex-direction:column;gap:4px}.w-empty h4{margin:0;font:500 14px/1.4 var(--wa-font-sans);color:var(--wa-text)}.w-empty p{margin:0;font:400 12px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);max-width:384px;text-wrap:pretty}.w-empty-action{margin-top:4px}.w-empty--fill{height:100%}.w-empty-ic--accent{width:44px;height:44px}.w-toast{display:inline-flex;align-items:center;gap:11px;padding:11px 13px 11px 14px;border-radius:var(--wa-radius-lg);background:var(--wa-surface);border:.5px solid var(--wa-border);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;min-width:280px;max-width:380px}.w-toast .w-toast-ic{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;flex:none}.w-toast .w-toast-ic svg{width:12px;height:12px}.w-toast--success .w-toast-ic{background:var(--wa-success-soft);color:var(--wa-success)}.w-toast--error .w-toast-ic{background:var(--wa-error-soft);color:var(--wa-error)}.w-toast-msg{flex:1;font:400 13px/1.35 var(--wa-font-sans);color:var(--wa-text)}.w-toast-x{border:0;background:none;cursor:pointer;color:var(--wa-text-faint);width:22px;height:22px;border-radius:6px;display:grid;place-items:center;flex:none}.w-toast-x:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-toast-x svg{width:12px;height:12px}.w-pop{width:320px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;overflow:hidden}.w-pop-body{padding:15px 15px 13px;display:flex;flex-direction:column;gap:11px}.w-pop-title{margin:0;font:400 13.5px/1.3 var(--wa-font-sans);letter-spacing:-.01em;color:var(--wa-text)}.w-pop-sub{margin:0;font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);text-wrap:pretty}.w-pop-title+.w-pop-sub{margin-top:-7px}.w-pop-foot{display:flex;gap:8px;justify-content:flex-end;padding:10px 14px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-pop-foot .w-btn{width:auto}.w-pop-icon{width:38px;height:38px;border-radius:var(--wa-radius);display:grid;place-items:center;flex:none}.w-pop-icon--danger{background:var(--wa-error-soft);color:var(--wa-error)}.w-pop-icon--warn{background:var(--wa-warning-soft);color:var(--wa-warning)}.w-pop-icon svg{width:18px;height:18px}.w-locked{display:flex;align-items:center;gap:10px;height:38px;padding:0 8px 0 13px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-locked .w-locked-ic{color:var(--wa-text-faint);flex:none}.w-locked .w-locked-ic svg{width:15px;height:15px;display:block}.w-locked .w-locked-val{flex:1;font:400 13.5px/1 var(--wa-font-sans);color:var(--wa-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-restricted{opacity:.55;cursor:not-allowed}.w-restricted *{pointer-events:none}.w-warn-ic{color:var(--wa-warning);display:inline-grid;place-items:center}.w-warn-ic svg{width:15px;height:15px}.w-codes{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:14px;border-radius:var(--wa-radius);background:var(--wa-surface-subtle);border:.5px solid var(--wa-border)}.w-codes span{font:400 13px/1.6 var(--wa-font-mono);color:var(--wa-text);text-align:center;letter-spacing:.04em}.w-qr{width:148px;height:148px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface);display:grid;place-items:center;color:var(--wa-text)}.w-banner{display:flex;gap:11px;padding:12px 14px;border-radius:var(--wa-radius);align-items:flex-start}.w-banner svg{width:16px;height:16px;flex:none;margin-top:1px}.w-banner-txt{font:400 12.5px/1.5 var(--wa-font-sans);text-wrap:pretty;color:var(--wa-text-secondary)}.w-banner--error{background:var(--wa-error-soft)}.w-banner--warn{background:var(--wa-warning-soft)}.w-banner--info{background:var(--wa-info-soft)}.w-banner--error svg{color:var(--wa-error)}.w-banner--warn svg{color:var(--wa-warning)}.w-banner--info svg{color:var(--wa-info)}.w-seg{display:inline-flex;padding:3px;gap:2px;background:var(--wa-surface-subtle);border:.5px solid var(--wa-border);border-radius:var(--wa-radius)}.w-seg button{height:28px;padding:0 12px;border:0;background:none;cursor:pointer;border-radius:4px;font:400 12px/1 var(--wa-font-sans);color:var(--wa-text-muted);white-space:nowrap}.w-seg button[data-on]{background:var(--wa-surface);color:var(--wa-text);box-shadow:0 0 0 .5px var(--wa-border)}.w-steps{display:flex;gap:6px;justify-content:center}.w-steps i{width:5px;height:5px;border-radius:999px;background:var(--wa-border-strong);transition:background .2s ease,width .2s ease}.w-steps i[data-on]{background:var(--wa-primary);width:16px}.w-ibadge{display:grid;place-items:center;width:48px;height:48px;flex:none;border-radius:var(--wa-radius-lg);background:var(--wa-primary-soft);color:var(--wa-primary);overflow:hidden}.w-ibadge svg{width:24px;height:24px}.w-ibadge img{width:100%;height:100%;object-fit:cover}.w-ibadge--done{width:52px;height:52px;border-radius:999px;background:var(--wa-success-soft);color:var(--wa-success)}.w-ibadge--done svg{width:26px;height:26px}.w-ibadge-wrap{position:relative}.w-ibadge-x{position:absolute;top:-6px;right:-6px;width:20px;height:20px;display:grid;place-items:center;border-radius:999px;border:.5px solid var(--wa-border);background:var(--wa-surface);color:var(--wa-text-muted);cursor:pointer;box-shadow:0 1px 2px #1414161f}.w-ibadge-x svg{width:11px;height:11px}.w-create-foot{padding:13px 32px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle);text-align:center}.w-create-summary{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;padding:12px 16px;border:.5px solid var(--wa-border);border-radius:var(--wa-radius)}.w-auth-card{width:min(440px,100%)}.w-auth-head{display:flex;flex-direction:column;align-items:center;gap:14px;margin-bottom:24px}.w-auth-head-text{display:flex;flex-direction:column;gap:6px;text-align:center}.w-auth-title{margin:0;font:400 21px/1.2 var(--wa-font-sans);letter-spacing:-.025em;color:var(--wa-text)}.w-auth-sub{margin:0;font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted);text-wrap:pretty}.w-auth-status{display:flex;flex-direction:column;align-items:center;gap:16px;padding-top:4px;text-align:center}.w-auth-foot{font:400 12.5px/1.5 var(--wa-font-sans);color:var(--wa-text-muted)}.w-fineprint{margin:2px 2px 0;font:400 11px/1.5 var(--wa-font-sans);color:var(--wa-text-faint);text-align:center;text-wrap:pretty}.w-switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;-webkit-user-select:none;user-select:none}.w-switch .w-switch-track{width:36px;height:20px;border-radius:999px;background:var(--wa-border-strong);border:.5px solid transparent;position:relative;transition:background .16s ease;flex:none}.w-switch .w-switch-knob{position:absolute;top:1.5px;left:1.5px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform .16s ease}.w-switch[data-on] .w-switch-track{background:var(--wa-primary)}.w-switch[data-on] .w-switch-knob{transform:translate(16px)}.w-switch-label{font:400 13px/1 var(--wa-font-sans);color:var(--wa-text)}.w-search{display:flex;align-items:center;gap:8px;height:32px;width:240px;max-width:100%;padding:0 11px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface)}.w-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:14px}.w-search svg{width:15px;height:15px;color:var(--wa-text-faint);flex:none}.w-search input{border:0;background:none;outline:none;flex:1;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);min-width:0}.w-search input::placeholder{color:var(--wa-text-faint)}.w-combo{display:flex;align-items:center;gap:8px;height:34px;padding:0 10px 0 12px;width:100%;border-radius:var(--wa-radius);border:.5px solid var(--wa-border-strong);background:var(--wa-surface);cursor:pointer;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);transition:border-color .14s ease}.w-combo:hover{border-color:var(--wa-text-muted)}.w-combo[data-open]{border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft)}.w-combo .w-combo-val{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-combo .w-combo-val[data-ph]{color:var(--wa-text-faint)}.w-combo svg{width:15px;height:15px;color:var(--wa-text-muted);flex:none}.w-combo-menu{width:100%;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;padding:4px;overflow:hidden}.w-combo-opt{display:flex;align-items:center;justify-content:flex-start;gap:9px;height:30px;padding:0 8px;border-radius:5px;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);cursor:pointer;width:100%;border:0;background:none;text-align:left;white-space:nowrap}.w-combo-opt>svg{width:15px;height:15px;flex:none;color:var(--wa-text-muted)}.w-combo-opt:hover{background:var(--wa-surface-subtle)}.w-combo-opt .w-combo-check{margin-left:auto;color:var(--wa-primary);display:grid;place-items:center}.w-combo-opt .w-combo-check svg{width:14px;height:14px}.w-combo-opt[data-disabled]{opacity:.5;cursor:not-allowed}.w-combo-grp{font:400 10px/1 var(--wa-font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--wa-text-faint);padding:9px 9px 5px}.w-phone{display:flex;align-items:stretch;gap:0;width:100%}.w-phone .w-phone-cc{display:flex;align-items:center;gap:7px;height:34px;padding:0 10px;border:.5px solid var(--wa-border-strong);border-right:0;border-radius:var(--wa-radius) 0 0 var(--wa-radius);background:var(--wa-surface-subtle);cursor:pointer;font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);white-space:nowrap}.w-phone .w-phone-cc svg{width:13px;height:13px;color:var(--wa-text-muted)}.w-phone input{flex:1;height:34px;padding:0 12px;border:.5px solid var(--wa-border-strong);border-radius:0 var(--wa-radius) var(--wa-radius) 0;background:var(--wa-surface);font:400 13px/1 var(--wa-font-sans);color:var(--wa-text);outline:none;min-width:0}.w-phone input:focus{border-color:var(--wa-primary);box-shadow:0 0 0 3px var(--wa-primary-soft);position:relative}.w-flag{width:18px;height:13px;border-radius:2px;display:inline-block;flex:none;box-shadow:inset 0 0 0 .5px #00000026}.w-country-pop{position:absolute;top:calc(100% + 6px);left:0;z-index:50;width:260px;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;overflow:hidden}.w-country-search{display:flex;align-items:center;gap:8px;padding:9px 11px;border-bottom:.5px solid var(--wa-border)}.w-country-search svg{width:14px;height:14px;color:var(--wa-text-faint);flex:none}.w-country-search input{border:0;background:none;outline:none;flex:1;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);min-width:0}.w-country-search input::placeholder{color:var(--wa-text-faint)}.w-country-list{max-height:220px;overflow-y:auto;padding:5px}.w-country-opt{display:flex;align-items:center;gap:9px;height:32px;padding:0 9px;border-radius:5px;cursor:pointer;font:400 12.5px/1 var(--wa-font-sans);color:var(--wa-text);width:100%;border:0;background:none;text-align:left}.w-country-opt:hover{background:var(--wa-surface-subtle)}.w-country-opt .dial{margin-left:auto;color:var(--wa-text-muted);font:400 12px/1 var(--wa-font-mono);flex:none}.w-method-stack{display:flex;flex-direction:column;gap:10px}.w-method{display:flex;align-items:center;gap:13px;width:100%;padding:13px 14px;border:.5px solid var(--wa-border-strong);border-radius:var(--wa-radius);background:var(--wa-surface);cursor:pointer;text-align:left;transition:background .14s ease,border-color .14s ease}.w-method .w-method-ic{width:34px;height:34px;border-radius:var(--wa-radius);display:grid;place-items:center;background:var(--wa-surface-subtle);color:var(--wa-text-secondary);flex:none}.w-method .w-method-ic svg{width:17px;height:17px}.w-method .w-method-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.w-method .w-method-title{font:400 13.5px/1 var(--wa-font-sans);color:var(--wa-text)}.w-method .w-method-desc{font:400 12px/1.4 var(--wa-font-sans);color:var(--wa-text-muted)}.w-method .w-method-go{color:var(--wa-text-faint);flex:none}.w-method .w-method-go svg{width:16px;height:16px}.w-method[data-disabled]{opacity:.5;cursor:not-allowed}.w-overlay{position:relative;width:100%;height:100%;background:color-mix(in srgb,#000 38%,transparent);display:grid;place-items:center;border-radius:inherit}.w-dialog{background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);box-shadow:0 1px 2px #1414160d,0 12px 32px -10px #14141629;width:100%;max-width:480px;overflow:hidden;display:flex;flex-direction:column}.w-dialog--panel{display:block;width:880px;max-width:100%;height:min(560px,calc(100dvh - 40px));overflow-y:auto}.w-dialog--panel .w-card{background:transparent;border-radius:0;box-shadow:none}@media(max-width:640px){.w-dialog--panel{height:calc(100dvh - 16px)}}.w-dialog--create{background:transparent;border:0;box-shadow:none;width:440px;max-width:100%;align-items:center;scrollbar-gutter:stable both-edges}.w-create-card{width:440px;max-width:100%}.w-create-body{padding:34px 32px 28px}.w-create-head{margin-bottom:24px}.w-create-steps{margin-bottom:22px}.w-text-center{text-align:center}.w-linkbtn{background:none;border:0;padding:0;cursor:pointer}.w-modal{position:fixed;top:0;right:0;bottom:0;left:0;background:#08080c80;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:flex;justify-content:center;align-items:center;padding:20px;z-index:99999}@media(max-width:640px){.w-modal{padding:8px}}.w-dialog-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:.5px solid var(--wa-border)}.w-dialog-title{margin:0;font:400 15px/1.2 var(--wa-font-sans);letter-spacing:-.01em;color:var(--wa-text)}.w-dialog-body{padding:20px;display:flex;flex-direction:column;gap:14px}.w-dialog-foot{display:flex;gap:8px;justify-content:flex-end;padding:14px 20px;border-top:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-vtabs{display:flex;flex-direction:column;gap:2px}.w-vtab{display:flex;align-items:center;gap:10px;height:34px;padding:0 11px;border-radius:var(--wa-radius);font:400 13px/1 var(--wa-font-sans);color:var(--wa-text-muted);background:none;border:0;cursor:pointer;text-align:left;width:100%}.w-vtab svg{width:15px;height:15px}.w-vtab:hover,.w-vtab[data-on]{color:var(--wa-text);background:var(--wa-surface-subtle)}.w-vtab[data-on] svg{color:var(--wa-primary)}@keyframes w-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.w-skel{border-radius:6px;background:linear-gradient(90deg,var(--wa-surface-subtle) 25%,var(--wa-border) 37%,var(--wa-surface-subtle) 63%);background-size:200% 100%;animation:w-shimmer 1.4s ease infinite}.w-auth-skel{display:flex;flex-direction:column;gap:22px}.w-auth-skel-head{display:flex;flex-direction:column;align-items:center;gap:12px;margin-bottom:2px}.w-auth-skel-fields{display:flex;flex-direction:column;gap:15px}.w-auth-skel-field{display:flex;flex-direction:column;gap:7px}.w-skel-avatar{width:44px;height:44px;border-radius:50%}.w-skel-line{height:10px}.w-skel-title{height:16px;width:56%}.w-skel-sub{height:11px;width:78%}.w-skel-label{height:9px;width:34%}.w-skel-input{height:38px;border-radius:var(--wa-radius)}.w-skel-btn{height:38px;border-radius:var(--wa-radius);margin-top:3px}.w-table{width:100%;border-collapse:separate;border-spacing:0;background:var(--wa-surface);border:.5px solid var(--wa-border);border-radius:var(--wa-radius-lg);overflow:hidden}.w-table thead{background:var(--wa-surface-subtle)}.w-table th{text-align:left;padding:9px 16px;font:400 11px/1 var(--wa-font-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--wa-text-faint);white-space:nowrap;border-bottom:.5px solid var(--wa-border)}.w-table th:last-child{text-align:right}.w-table td{padding:11px 16px;font:400 13px/1.35 var(--wa-font-sans);color:var(--wa-text-secondary);vertical-align:middle;white-space:nowrap}.w-table tbody tr{transition:background .12s ease}.w-table tbody tr:not(:last-child) td{border-bottom:.5px solid var(--wa-border)}.w-table tbody tr:hover td{background:var(--wa-surface-subtle)}.w-table tbody tr:last-child td:last-child{overflow:visible}.w-td--flex>div{display:flex;align-items:center;gap:10px}.w-td--actions{text-align:right;width:auto;white-space:nowrap;position:relative;overflow:visible}.w-td--actions>*{width:fit-content;margin-left:auto}.w-td--actions>[data-dropdown-trigger]{display:inline-flex;width:fit-content;margin-left:auto}.w-actions{display:flex;gap:6px;justify-content:flex-end;align-items:center}.w-kebab{width:28px;height:28px;border-radius:6px;border:0;background:none;cursor:pointer;color:var(--wa-text-muted);display:grid;place-items:center}.w-kebab:hover{background:var(--wa-surface-subtle);color:var(--wa-text)}.w-kebab svg{width:16px;height:16px}.w-token{display:flex;align-items:center;gap:8px;height:36px;padding:0 6px 0 12px;border-radius:var(--wa-radius);border:.5px solid var(--wa-border);background:var(--wa-surface-subtle)}.w-token code{flex:1;font:400 12px/1 var(--wa-font-mono);color:var(--wa-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.w-page-head{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:18px 22px}.w-tabsbar{flex:none;padding:0 22px;border-bottom:.5px solid var(--wa-border);overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.w-tabsbar::-webkit-scrollbar{display:none}.w-tabbody{flex:1;min-height:0;padding:20px 22px;overflow-y:auto;overflow-x:auto}.w-tabpane{min-width:300px}.w-card-head{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:16px;padding:16px 20px}.w-card-body{padding:16px 20px}.w-card-foot{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;padding:14px 20px;border-top:.5px solid var(--wa-border)}.w-sechead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.w-iconbox{width:22px;height:22px;flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}.w-iconbox svg,.w-iconbox img{width:22px;height:22px;display:block}.w-vrow{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 0}.w-vrow:not(:last-child){border-bottom:.5px solid var(--wa-border)}.w-row-act-top{align-self:flex-start;margin-top:20px}.w-rowitem{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px}.w-rowitem:not(:last-child){border-bottom:.5px solid var(--wa-border)}.w-aside-copy{max-width:220px;text-align:center}.w-split{display:flex;min-height:400px;border-radius:var(--wa-radius-lg);overflow:hidden;border:.5px solid var(--wa-border);background:var(--wa-surface)}.w-split-aside{width:35%;min-width:200px;flex:none;background:var(--wa-surface-subtle);border-right:.5px solid var(--wa-border);padding:28px;display:flex;flex-direction:column;gap:14px}.w-split-main{flex:1;min-width:0;padding:28px;display:flex;flex-direction:column;gap:16px}@media(max-width:600px){.w-split{flex-direction:column}.w-split-aside{width:100%;border-right:0;border-bottom:.5px solid var(--wa-border)}}.w-listrow{display:flex;align-items:center;gap:12px;width:100%;padding:12px 0;text-align:left;border:0;border-bottom:.5px solid var(--wa-border);background:transparent;cursor:pointer;transition:background .12s ease}.w-listrow:last-child{border-bottom:0}.w-listrow:hover{background:var(--wa-surface-subtle)}.w-listrow:disabled{opacity:.6;cursor:not-allowed}.w-tile{border:.5px solid var(--wa-border);border-radius:var(--wa-radius);padding:12px;background:var(--wa-surface-subtle)}.w-input--area{min-height:80px;padding-top:9px;padding-bottom:9px;resize:vertical;line-height:1.5}.w-input--mono{font-family:var(--wa-font-mono)}.w-pop--wide{width:372px;max-width:calc(100vw - 24px);overflow:visible}.w-pop .w-input:not(.w-input--area),.w-pop .w-combo{height:32px}.w-feature-badge{width:52px;height:52px;border-radius:999px;display:grid;place-items:center;color:var(--wa-primary-foreground);background:linear-gradient(135deg,var(--wa-primary),var(--wa-primary-tint, #9277ff));box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-primary) 55%,transparent);margin-bottom:18px}.w-narrow{max-width:420px;margin:0 auto}.w-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.w-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.w-grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}@media(max-width:600px){.w-grid-2,.w-grid-3,.w-grid-4{grid-template-columns:1fr}}.w-toast--fixed{position:fixed;bottom:20px;right:20px;z-index:1000}.w-toast--contained{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:20;width:max-content;max-width:calc(100% - 32px)}.w-notif-badge{position:absolute;top:4px;right:4px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--wa-error);color:#fff;font:500 9px/1 var(--wa-font-sans);display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--wa-surface)}.w-notif-badge[data-dot]{top:6px;right:6px;min-width:8px;height:8px;padding:0}.w-notif-row{cursor:pointer;padding:12px 16px;border-bottom:.5px solid var(--wa-border)}.w-notif-row[data-unread]{background:var(--wa-surface-subtle)}.w-notif-dot{width:8px;height:8px;border-radius:50%;background:var(--wa-primary);flex:none}.w-btn--icon[data-on]{color:var(--wa-warning)}.w-notif-pop{position:fixed;width:450px;max-width:calc(100vw - 24px);z-index:99999}.w-notif-panel{width:450px;max-width:100%;height:100%;background:var(--wa-surface);overflow:hidden}.w-notif-panel--fill{width:100%}.w-notif-head{padding:12px 16px;border-bottom:.5px solid var(--wa-border)}.w-notif-body{overflow-y:auto;background:var(--wa-surface)}.w-notif-menu{position:absolute;top:48px;right:12px;width:200px;z-index:100000}.w-banner--success{background:var(--wa-success-soft)}.w-banner--success svg{color:var(--wa-success)}@keyframes w-pop{0%{transform:scale(.5);opacity:0}60%{transform:scale(1.06)}to{transform:scale(1);opacity:1}}@keyframes w-ring{0%{transform:scale(.85);opacity:.45}to{transform:scale(1.9);opacity:0}}@keyframes w-draw{to{stroke-dashoffset:0}}@keyframes w-indeterminate{0%{transform:translate(-100%)}to{transform:translate(330%)}}.w-success{position:relative;display:grid;place-items:center;width:56px;height:56px}.w-success .ring{position:absolute;top:2px;right:2px;bottom:2px;left:2px;border-radius:999px;border:1.5px solid var(--wa-success);opacity:0}.w-success .disc{width:52px;height:52px;border-radius:999px;background:var(--wa-success);color:#fff;display:grid;place-items:center;box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-success) 55%,transparent)}.w-success .disc svg{width:26px;height:26px}.w-success--error .ring{border-color:var(--wa-error)}.w-success--error .disc{background:var(--wa-error);box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-error) 55%,transparent)}.w-success--info .ring{border-color:var(--wa-info)}.w-success--info .disc{background:var(--wa-info);box-shadow:0 4px 14px -3px color-mix(in srgb,var(--wa-info) 55%,transparent)}.w-progress{position:relative;width:70%;height:3px;border-radius:999px;background:var(--wa-border);overflow:hidden}.w-progress:after{content:"";position:absolute;top:0;left:0;width:30%;height:100%;border-radius:999px;background:var(--wa-primary)}@media(prefers-reduced-motion:no-preference){.w-success .ring{animation:w-ring 1.7s ease-out infinite}.w-success .disc{animation:w-pop .42s cubic-bezier(.2,.9,.3,1.2)}.w-success .disc svg path{stroke-dasharray:26;stroke-dashoffset:26;animation:w-draw .4s .22s ease forwards}.w-progress:after{animation:w-indeterminate 1.15s ease-in-out infinite}}.w-sso-conn{padding-bottom:24px}.w-sso-conn:not(:last-child){margin-bottom:24px;border-bottom:.5px solid var(--wa-border)}.w-sso-detail{display:grid;grid-template-columns:auto 1fr;gap:4px 32px}.w-sso-scim{padding-top:16px;border-top:.5px solid var(--wa-border)}.w-sso-template{padding:12px;background:var(--wa-primary-soft);border-radius:var(--wa-radius);border:.5px solid var(--wa-primary)}.w-sso-check{padding:8px 12px;background:var(--wa-surface);border-radius:var(--wa-radius);border:.5px solid var(--wa-border)}.w-sso-check-mark{min-width:12px}.w-sso-tile{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 10px;border:.5px solid var(--wa-border);border-radius:var(--wa-radius);background:var(--wa-surface);cursor:pointer;transition:border-color .14s ease,background .14s ease}.w-sso-tile:hover{border-color:var(--wa-border-strong);background:var(--wa-surface-subtle)}.w-sso-logo{object-fit:contain;background:var(--wa-surface);padding:4px}.w-sso-logo--ph{background:var(--wa-surface)}.w-token-chip{background:var(--wa-surface-subtle);padding:2px 6px;border-radius:4px;color:var(--wa-text)}.w-disclosure{cursor:pointer;font:400 12.5px/1 var(--wa-font-sans)}.w-disclosure-caret{font-size:9px}.w-break-all{word-break:break-all}.w-col-full{grid-column:1 / -1}.dark .w-card{box-shadow:0 0 0 .5px var(--wa-border),0 2px 4px #0006,0 28px 60px -20px #000000b3}.dark .w-menu,.dark .w-pop,.dark .w-toast,.dark .w-dialog,.dark .w-combo-menu,.dark .w-country-pop{box-shadow:0 1px 2px #00000080,0 18px 44px -14px #000000b3}.dark .w-btn--secondary,.dark .w-social{box-shadow:inset 0 1px #ffffff0d,0 1px 1.5px #1414160a}.w-flex{display:flex}.w-inline{display:inline-flex}.w-items-center{align-items:center}.w-items-start{align-items:flex-start}.w-items-end{align-items:flex-end}.w-justify-start{justify-content:flex-start}.w-justify-center{justify-content:center}.w-justify-end{justify-content:flex-end}.w-justify-between{justify-content:space-between}',em=Q8`
100
100
  ${J8}
101
101
  ${X8}
102
102
  `,tm={display:"contents"};function am(e){const a={};if(!e)return a;const s=(n,i)=>{if(i)for(const l in i){const m=i[l];typeof m=="string"&&m.trim()!==""&&(a[`--wa-ov-${n}-${l}`]=m)}};return s("light",e.light),s("dark",e.dark),a}function ts(){var s,n;const e=o.useContext(fr),a=(n=(s=e==null?void 0:e.deployment)==null?void 0:s.ui_settings)==null?void 0:n.theme_tokens;return o.useMemo(()=>am(a),[a])}const Si=o.createContext(!1),sm=o.memo(function(){return t.jsx(em,{})});function Re({children:e,className:a,style:s,...n}){const i=o.useContext(Si),l=ts(),[m,c]=o.useState(!1);if(o.useEffect(()=>c(!0),[]),!m)return null;const d=t.jsx("div",{...n,className:a?`wacht-root ${a}`:"wacht-root",style:{...tm,...l,...s},children:e});return i?d:t.jsxs(Si.Provider,{value:!0,children:[t.jsx(sm,{}),d]})}function va({length:e=6,onComplete:a,onResend:s,error:n,isSubmitting:i=!1}){const[l,m]=o.useState(new Array(e).fill("")),[c,d]=o.useState(60),[p,u]=o.useState(!1),h=o.useRef([]),f=o.useCallback(()=>{const j=setInterval(()=>{d(v=>v<=1?(u(!0),clearInterval(j),0):v-1)},1e3);return j},[]);o.useEffect(()=>{const j=f();return()=>clearInterval(j)},[f]);const g=async()=>{var j;!p||i||!s||(await s(),u(!1),d(60),m(new Array(e).fill("")),(j=h.current[0])==null||j.focus(),f())},x=(j,v)=>{var C;if(i)return;const k=j.value,N=[...l];N[v]=k.replace(/[^0-9]/g,""),m(N);const _=N.join("");_.length===e&&a(_),k&&v<e-1&&((C=h.current[v+1])==null||C.focus())},w=(j,v)=>{var k;i||j.key==="Backspace"&&!l[v]&&v>0&&((k=h.current[v-1])==null||k.focus())},b=(j,v)=>{var C,y;if(i)return;j.preventDefault();const k=j.clipboardData.getData("text/plain").replace(/[^0-9]/g,"").slice(0,e);if(!k.length)return;const N=[...l];for(let E=0;E<k.length&&v+E<e;E++)N[v+E]=k[E];if(v===0&&k.length===e)for(let E=0;E<e;E++)N[E]=k[E];m(N);const _=N.join("");if(_.length===e)a(_),(C=h.current[e-1])==null||C.focus();else{const E=N.findIndex((M,F)=>F>=v&&!M);E!==-1&&((y=h.current[E])==null||y.focus())}};return t.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:16},children:[t.jsx("div",{className:"w-otp","data-error":n?"":void 0,children:l.map((j,v)=>t.jsx("input",{className:"w-otp-cell",type:"text",inputMode:"numeric",maxLength:1,value:j,"data-filled":j?"":void 0,onChange:k=>x(k.target,v),onKeyDown:k=>w(k,v),onPaste:k=>b(k,v),ref:k=>{h.current[v]=k},disabled:i,autoFocus:v===0},v))}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[n&&t.jsx("span",{className:"w-input-err",children:n}),s&&(p?t.jsx("button",{type:"button",className:"w-link",style:{background:"none",border:0,cursor:"pointer",fontSize:12.5},onClick:g,disabled:i,children:"Didn't receive a code? Resend"}):t.jsxs("span",{className:"w-secsub",children:["Resend code in ",c,"s"]}))]})]})}const bc=e=>t.jsxs("svg",{width:"800px",height:"800px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-labelledby":"githubIconTitle",...e,children:[t.jsx("title",{id:"githubIconTitle",children:"GitHub"}),t.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.109-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.91 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})]}),yc=e=>t.jsxs("svg",{width:"800px",height:"800px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",...e,children:[t.jsx("path",{fill:"#4285F4",d:"M14.9 8.161c0-.476-.039-.954-.121-1.422h-6.64v2.695h3.802a3.24 3.24 0 01-1.407 2.127v1.75h2.269c1.332-1.22 2.097-3.02 2.097-5.15z"}),t.jsx("path",{fill:"#34A853",d:"M8.14 15c1.898 0 3.499-.62 4.665-1.69l-2.268-1.749c-.631.427-1.446.669-2.395.669-1.836 0-3.393-1.232-3.952-2.888H1.85v1.803A7.044 7.044 0 008.14 15z"}),t.jsx("path",{fill:"#FBBC04",d:"M4.187 9.342a4.17 4.17 0 010-2.68V4.859H1.849a6.97 6.97 0 000 6.286l2.338-1.803z"}),t.jsx("path",{fill:"#EA4335",d:"M8.14 3.77a3.837 3.837 0 012.7 1.05l2.01-1.999a6.786 6.786 0 00-4.71-1.82 7.042 7.042 0 00-6.29 3.858L4.186 6.66c.556-1.658 2.116-2.89 3.952-2.89z"})]}),jc=e=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"50",height:"50",viewBox:"0 0 50 50",...e,children:t.jsx("path",{d:"M 6.9199219 6 L 21.136719 26.726562 L 6.2285156 44 L 9.40625 44 L 22.544922 28.777344 L 32.986328 44 L 43 44 L 28.123047 22.3125 L 42.203125 6 L 39.027344 6 L 26.716797 20.261719 L 16.933594 6 L 6.9199219 6 z"})}),nm=()=>t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),_c=()=>t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",children:t.jsx("path",{fill:"#0A66C2",d:"M12.225 12.225h-1.778V9.44c0-.664-.012-1.519-.925-1.519-.926 0-1.068.724-1.068 1.47v2.834H6.676V6.498h1.707v.783h.024c.348-.594.996-.95 1.684-.925 1.802 0 2.135 1.185 2.135 2.728l-.001 3.14zM4.67 5.715a1.037 1.037 0 01-1.032-1.031c0-.566.466-1.032 1.032-1.032.566 0 1.031.466 1.032 1.032 0 .566-.466 1.032-1.032 1.032zm.889 6.51h-1.78V6.498h1.78v5.727zM13.11 2H2.885A.88.88 0 002 2.866v10.268a.88.88 0 00.885.866h10.226a.882.882 0 00.889-.866V2.865a.88.88 0 00-.889-.864z"})}),kc=()=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M12 21.42L15.54 10.86H8.46L12 21.42Z",fill:"#E24329"}),t.jsx("path",{d:"M12 21.42L8.46 10.86H2.28L12 21.42Z",fill:"#FC6D26"}),t.jsx("path",{d:"M2.28 10.86L0.86 15.14C0.72 15.54 0.86 15.98 1.18 16.24L12 21.42L2.28 10.86Z",fill:"#FCA326"}),t.jsx("path",{d:"M2.28 10.86H8.46L6.12 3.58C5.98 3.18 5.42 3.18 5.28 3.58L2.28 10.86Z",fill:"#E24329"}),t.jsx("path",{d:"M12 21.42L15.54 10.86H21.72L12 21.42Z",fill:"#FC6D26"}),t.jsx("path",{d:"M21.72 10.86L23.14 15.14C23.28 15.54 23.14 15.98 22.82 16.24L12 21.42L21.72 10.86Z",fill:"#FCA326"}),t.jsx("path",{d:"M21.72 10.86H15.54L17.88 3.58C18.02 3.18 18.58 3.18 18.72 3.58L21.72 10.86Z",fill:"#E24329"})]}),rm=()=>t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}),Cc=()=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("circle",{cx:"512",cy:"512",r:"512",style:{fill:"#5865f2"}}),t.jsx("path",{d:"M689.43 349a422.21 422.21 0 0 0-104.22-32.32 1.58 1.58 0 0 0-1.68.79 294.11 294.11 0 0 0-13 26.66 389.78 389.78 0 0 0-117.05 0 269.75 269.75 0 0 0-13.18-26.66 1.64 1.64 0 0 0-1.68-.79A421 421 0 0 0 334.44 349a1.49 1.49 0 0 0-.69.59c-66.37 99.17-84.55 195.9-75.63 291.41a1.76 1.76 0 0 0 .67 1.2 424.58 424.58 0 0 0 127.85 64.63 1.66 1.66 0 0 0 1.8-.59 303.45 303.45 0 0 0 26.15-42.54 1.62 1.62 0 0 0-.89-2.25 279.6 279.6 0 0 1-39.94-19 1.64 1.64 0 0 1-.16-2.72c2.68-2 5.37-4.1 7.93-6.22a1.58 1.58 0 0 1 1.65-.22c83.79 38.26 174.51 38.26 257.31 0a1.58 1.58 0 0 1 1.68.2c2.56 2.11 5.25 4.23 8 6.24a1.64 1.64 0 0 1-.14 2.72 262.37 262.37 0 0 1-40 19 1.63 1.63 0 0 0-.87 2.28 340.72 340.72 0 0 0 26.13 42.52 1.62 1.62 0 0 0 1.8.61 423.17 423.17 0 0 0 128-64.63 1.64 1.64 0 0 0 .67-1.18c10.68-110.44-17.88-206.38-75.7-291.42a1.3 1.3 0 0 0-.63-.63zM427.09 582.85c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.02 28.44-20.37 51.6-46 51.6zm170.13 0c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.01 28.44-20.17 51.6-46 51.6z",style:{fill:"#fff"}})]}),im={google_oauth:{label:"Continue with Google",icon:t.jsx(yc,{})},github_oauth:{label:"Continue with GitHub",icon:t.jsx(bc,{})},x_oauth:{label:"Continue with X",icon:t.jsx(jc,{})},facebook_oauth:{label:"Continue with Facebook",icon:t.jsx(nm,{})},linkedin_oauth:{label:"Continue with LinkedIn",icon:t.jsx(_c,{})},gitlab_oauth:{label:"Continue with GitLab",icon:t.jsx(kc,{})},apple_oauth:{label:"Continue with Apple",icon:t.jsx(rm,{})},discord_oauth:{label:"Continue with Discord",icon:t.jsx(Cc,{})}},Nr=({connections:e,callback:a})=>{const s=e.map(n=>({connection:n,config:im[n.provider]})).filter(n=>n.config);if(!s.length)return null;if(s.length>3){const n=Math.min(s.length,4);return t.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${n}, 1fr)`,gap:8},children:s.map(({connection:i,config:l})=>t.jsx("button",{type:"button",className:"w-social",style:{justifyContent:"center",padding:0},onClick:()=>a(i),title:l.label,"aria-label":l.label,children:l.icon},i.provider))})}return t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:s.map(({connection:n,config:i})=>t.jsxs("button",{type:"button",className:"w-social",onClick:()=>a(n),children:[i.icon,t.jsx("span",{className:"w-social-label",children:i.label})]},n.provider))})},Et=({to:e,replace:a,children:s,...n})=>{const{navigate:i}=kt(),l=o.useCallback(m=>{m.preventDefault(),i(e,{replace:a})},[e,a,i]);return t.jsx("a",{href:e||void 0,onClick:l,...n,children:s})},qt=o.forwardRef(({onFocus:e,readOnly:a,...s},n)=>{const[i,l]=o.useState(!1);return t.jsx("input",{ref:n,...s,readOnly:a||!i,onFocus:m=>{i||l(!0),e==null||e(m)}})});qt.displayName="NoPrefillInput";const Gs=[{name:"Afghanistan",code:"AF",dialCode:"+93",flag:"🇦🇫"},{name:"Albania",code:"AL",dialCode:"+355",flag:"🇦🇱"},{name:"Algeria",code:"DZ",dialCode:"+213",flag:"🇩🇿"},{name:"American Samoa",code:"AS",dialCode:"+1684",flag:"🇺🇸"},{name:"Andorra",code:"AD",dialCode:"+376",flag:"🇦🇩"},{name:"Angola",code:"AO",dialCode:"+244",flag:"🇦🇴"},{name:"Anguilla",code:"AI",dialCode:"+1264",flag:"🇦🇮"},{name:"Antarctica",code:"AQ",dialCode:"+672",flag:"🇦🇶"},{name:"Antigua and Barbuda",code:"AG",dialCode:"+1268",flag:"🇦🇬"},{name:"Argentina",code:"AR",dialCode:"+54",flag:"🇦🇷"},{name:"Armenia",code:"AM",dialCode:"+374",flag:"🇦🇲"},{name:"Aruba",code:"AW",dialCode:"+297",flag:"🇦🇼"},{name:"Australia",code:"AU",dialCode:"+61",flag:"🇦🇺"},{name:"Austria",code:"AT",dialCode:"+43",flag:"🇦🇹"},{name:"Azerbaijan",code:"AZ",dialCode:"+994",flag:"🇦🇿"},{name:"Bahamas",code:"BS",dialCode:"+1242",flag:"🇧🇸"},{name:"Bahrain",code:"BH",dialCode:"+973",flag:"🇧🇭"},{name:"Bangladesh",code:"BD",dialCode:"+880",flag:"🇧🇩"},{name:"Barbados",code:"BB",dialCode:"+1246",flag:"🇧🇧"},{name:"Belarus",code:"BY",dialCode:"+375",flag:"🇧🇾"},{name:"Belgium",code:"BE",dialCode:"+32",flag:"🇧🇪"},{name:"Belize",code:"BZ",dialCode:"+501",flag:"🇧🇿"},{name:"Benin",code:"BJ",dialCode:"+229",flag:"🇧🇯"},{name:"Bermuda",code:"BM",dialCode:"+1441",flag:"🇧🇲"},{name:"Bhutan",code:"BT",dialCode:"+975",flag:"🇧🇹"},{name:"Bolivia",code:"BO",dialCode:"+591",flag:"🇧🇴"},{name:"Bosnia and Herzegovina",code:"BA",dialCode:"+387",flag:"🇧🇦"},{name:"Botswana",code:"BW",dialCode:"+267",flag:"🇧🇼"},{name:"Brazil",code:"BR",dialCode:"+55",flag:"🇧🇷"},{name:"British Indian Ocean Territory",code:"IO",dialCode:"+246",flag:"🇮🇴"},{name:"British Virgin Islands",code:"VG",dialCode:"+1284",flag:"🇻🇬"},{name:"Brunei",code:"BN",dialCode:"+673",flag:"🇧🇳"},{name:"Bulgaria",code:"BG",dialCode:"+359",flag:"🇧🇬"},{name:"Burkina Faso",code:"BF",dialCode:"+226",flag:"🇧🇫"},{name:"Burundi",code:"BI",dialCode:"+257",flag:"🇧🇮"},{name:"Cambodia",code:"KH",dialCode:"+855",flag:"🇰🇭"},{name:"Cameroon",code:"CM",dialCode:"+237",flag:"🇨🇲"},{name:"Canada",code:"CA",dialCode:"+1",flag:"🇨🇦"},{name:"Cape Verde",code:"CV",dialCode:"+238",flag:"🇨🇻"},{name:"Cayman Islands",code:"KY",dialCode:"+1345",flag:"🇰🇾"},{name:"Central African Republic",code:"CF",dialCode:"+236",flag:"🇨🇫"},{name:"Chad",code:"TD",dialCode:"+235",flag:"🇹🇩"},{name:"Chile",code:"CL",dialCode:"+56",flag:"🇨🇱"},{name:"China",code:"CN",dialCode:"+86",flag:"🇨🇳"},{name:"Christmas Island",code:"CX",dialCode:"+61",flag:"🇨🇽"},{name:"Cocos Islands",code:"CC",dialCode:"+61",flag:"🇨🇨"},{name:"Colombia",code:"CO",dialCode:"+57",flag:"🇨🇴"},{name:"Comoros",code:"KM",dialCode:"+269",flag:"🇰🇲"},{name:"Cook Islands",code:"CK",dialCode:"+682",flag:"🇨🇰"},{name:"Costa Rica",code:"CR",dialCode:"+506",flag:"🇨🇷"},{name:"Croatia",code:"HR",dialCode:"+385",flag:"🇭🇷"},{name:"Cuba",code:"CU",dialCode:"+53",flag:"🇨🇺"},{name:"Curacao",code:"CW",dialCode:"+599",flag:"🇨🇼"},{name:"Cyprus",code:"CY",dialCode:"+357",flag:"🇨🇾"},{name:"Czech Republic",code:"CZ",dialCode:"+420",flag:"🇨🇿"},{name:"Democratic Republic of the Congo",code:"CD",dialCode:"+243",flag:"🇨🇩"},{name:"Denmark",code:"DK",dialCode:"+45",flag:"🇩🇰"},{name:"Djibouti",code:"DJ",dialCode:"+253",flag:"🇩🇯"},{name:"Dominica",code:"DM",dialCode:"+1767",flag:"🇩🇲"},{name:"Dominican Republic",code:"DO",dialCode:"+1849",flag:"🇩🇴"},{name:"East Timor",code:"TL",dialCode:"+670",flag:"🇹🇱"},{name:"Ecuador",code:"EC",dialCode:"+593",flag:"🇪🇨"},{name:"Egypt",code:"EG",dialCode:"+20",flag:"🇪🇬"},{name:"El Salvador",code:"SV",dialCode:"+503",flag:"🇸🇻"},{name:"Equatorial Guinea",code:"GQ",dialCode:"+240",flag:"🇬🇶"},{name:"Eritrea",code:"ER",dialCode:"+291",flag:"🇪🇷"},{name:"Estonia",code:"EE",dialCode:"+372",flag:"🇪🇪"},{name:"Ethiopia",code:"ET",dialCode:"+251",flag:"🇪🇹"},{name:"Falkland Islands",code:"FK",dialCode:"+500",flag:"🇫🇰"},{name:"Faroe Islands",code:"FO",dialCode:"+298",flag:"🇫🇴"},{name:"Fiji",code:"FJ",dialCode:"+679",flag:"🇫🇯"},{name:"Finland",code:"FI",dialCode:"+358",flag:"🇫🇮"},{name:"France",code:"FR",dialCode:"+33",flag:"🇫🇷"},{name:"French Polynesia",code:"PF",dialCode:"+689",flag:"🇵🇫"},{name:"Gabon",code:"GA",dialCode:"+241",flag:"🇬🇦"},{name:"Gambia",code:"GM",dialCode:"+220",flag:"🇬🇲"},{name:"Georgia",code:"GE",dialCode:"+995",flag:"🇬🇪"},{name:"Germany",code:"DE",dialCode:"+49",flag:"🇩🇪"},{name:"Ghana",code:"GH",dialCode:"+233",flag:"🇬🇭"},{name:"Gibraltar",code:"GI",dialCode:"+350",flag:"🇬🇮"},{name:"Greece",code:"GR",dialCode:"+30",flag:"🇬🇷"},{name:"Greenland",code:"GL",dialCode:"+299",flag:"🇬🇱"},{name:"Grenada",code:"GD",dialCode:"+1473",flag:"🇬🇩"},{name:"Guam",code:"GU",dialCode:"+1671",flag:"🇬🇺"},{name:"Guatemala",code:"GT",dialCode:"+502",flag:"🇬🇹"},{name:"Guernsey",code:"GG",dialCode:"+44",flag:"🇬🇬"},{name:"Guinea",code:"GN",dialCode:"+224",flag:"🇬🇳"},{name:"Guinea-Bissau",code:"GW",dialCode:"+245",flag:"🇬🇼"},{name:"Guyana",code:"GY",dialCode:"+592",flag:"🇬🇾"},{name:"Haiti",code:"HT",dialCode:"+509",flag:"🇭🇹"},{name:"Honduras",code:"HN",dialCode:"+504",flag:"🇭🇳"},{name:"Hong Kong",code:"HK",dialCode:"+852",flag:"🇭🇰"},{name:"Hungary",code:"HU",dialCode:"+36",flag:"🇭🇺"},{name:"Iceland",code:"IS",dialCode:"+354",flag:"🇮🇸"},{name:"India",code:"IN",dialCode:"+91",flag:"🇮🇳"},{name:"Indonesia",code:"ID",dialCode:"+62",flag:"🇮🇩"},{name:"Iran",code:"IR",dialCode:"+98",flag:"🇮🇷"},{name:"Iraq",code:"IQ",dialCode:"+964",flag:"🇮🇶"},{name:"Ireland",code:"IE",dialCode:"+353",flag:"🇮🇪"},{name:"Isle of Man",code:"IM",dialCode:"+44",flag:"🇮🇲"},{name:"Israel",code:"IL",dialCode:"+972",flag:"🇮🇱"},{name:"Italy",code:"IT",dialCode:"+39",flag:"🇮🇹"},{name:"Ivory Coast",code:"CI",dialCode:"+225",flag:"🇨🇮"},{name:"Jamaica",code:"JM",dialCode:"+1876",flag:"🇯🇲"},{name:"Japan",code:"JP",dialCode:"+81",flag:"🇯🇵"},{name:"Jersey",code:"JE",dialCode:"+44",flag:"🇬🇬"},{name:"Jordan",code:"JO",dialCode:"+962",flag:"🇯🇴"},{name:"Kazakhstan",code:"KZ",dialCode:"+7",flag:"🇰🇿"},{name:"Kenya",code:"KE",dialCode:"+254",flag:"🇰🇪"},{name:"Kiribati",code:"KI",dialCode:"+686",flag:"🇰🇮"},{name:"Kosovo",code:"XK",dialCode:"+383",flag:"🇽🇰"},{name:"Kuwait",code:"KW",dialCode:"+965",flag:"🇰🇼"},{name:"Kyrgyzstan",code:"KG",dialCode:"+996",flag:"🇰🇬"},{name:"Laos",code:"LA",dialCode:"+856",flag:"🇱🇦"},{name:"Latvia",code:"LV",dialCode:"+371",flag:"🇱🇻"},{name:"Lebanon",code:"LB",dialCode:"+961",flag:"🇱🇧"},{name:"Lesotho",code:"LS",dialCode:"+266",flag:"🇱🇸"},{name:"Liberia",code:"LR",dialCode:"+231",flag:"🇱🇷"},{name:"Libya",code:"LY",dialCode:"+218",flag:"🇱🇾"},{name:"Liechtenstein",code:"LI",dialCode:"+423",flag:"🇱🇮"},{name:"Lithuania",code:"LT",dialCode:"+370",flag:"🇱🇹"},{name:"Luxembourg",code:"LU",dialCode:"+352",flag:"🇱🇺"},{name:"Macau",code:"MO",dialCode:"+853",flag:"🇲🇴"},{name:"Macedonia",code:"MK",dialCode:"+389",flag:"🇲🇰"},{name:"Madagascar",code:"MG",dialCode:"+261",flag:"🇲🇬"},{name:"Malawi",code:"MW",dialCode:"+265",flag:"🇲🇼"},{name:"Malaysia",code:"MY",dialCode:"+60",flag:"🇲🇾"},{name:"Maldives",code:"MV",dialCode:"+960",flag:"🇲🇻"},{name:"Mali",code:"ML",dialCode:"+223",flag:"🇲🇱"},{name:"Malta",code:"MT",dialCode:"+356",flag:"🇲🇹"},{name:"Marshall Islands",code:"MH",dialCode:"+692",flag:"🇲🇭"},{name:"Mauritania",code:"MR",dialCode:"+222",flag:"🇲🇷"},{name:"Mauritius",code:"MU",dialCode:"+230",flag:"🇲🇺"},{name:"Mayotte",code:"YT",dialCode:"+262",flag:"🇾🇹"},{name:"Mexico",code:"MX",dialCode:"+52",flag:"🇲🇽"},{name:"Micronesia",code:"FM",dialCode:"+691",flag:"🇫🇲"},{name:"Moldova",code:"MD",dialCode:"+373",flag:"🇲🇩"},{name:"Monaco",code:"MC",dialCode:"+377",flag:"🇲🇨"},{name:"Mongolia",code:"MN",dialCode:"+976",flag:"🇲🇳"},{name:"Montenegro",code:"ME",dialCode:"+382",flag:"🇲🇪"},{name:"Montserrat",code:"MS",dialCode:"+1664",flag:"🇲🇸"},{name:"Morocco",code:"MA",dialCode:"+212",flag:"🇲🇦"},{name:"Mozambique",code:"MZ",dialCode:"+258",flag:"🇲🇿"},{name:"Myanmar",code:"MM",dialCode:"+95",flag:"🇲🇲"},{name:"Namibia",code:"NA",dialCode:"+264",flag:"🇳🇦"},{name:"Nauru",code:"NR",dialCode:"+674",flag:"🇳🇷"},{name:"Nepal",code:"NP",dialCode:"+977",flag:"🇳🇵"},{name:"Netherlands",code:"NL",dialCode:"+31",flag:"🇳🇱"},{name:"Netherlands Antilles",code:"AN",dialCode:"+599",flag:"🇳🇱"},{name:"New Caledonia",code:"NC",dialCode:"+687",flag:"🇳🇨"},{name:"New Zealand",code:"NZ",dialCode:"+64",flag:"🇳🇿"},{name:"Nicaragua",code:"NI",dialCode:"+505",flag:"🇳🇮"},{name:"Niger",code:"NE",dialCode:"+227",flag:"🇳🇪"},{name:"Nigeria",code:"NG",dialCode:"+234",flag:"🇳🇬"},{name:"Niue",code:"NU",dialCode:"+683",flag:"🇳🇺"},{name:"North Korea",code:"KP",dialCode:"+850",flag:"🇰🇵"},{name:"Northern Mariana Islands",code:"MP",dialCode:"+1670",flag:"🇲🇵"},{name:"Norway",code:"NO",dialCode:"+47",flag:"🇳🇴"},{name:"Oman",code:"OM",dialCode:"+968",flag:"🇴🇲"},{name:"Pakistan",code:"PK",dialCode:"+92",flag:"🇵🇰"},{name:"Palau",code:"PW",dialCode:"+680",flag:"🇵🇼"},{name:"Palestine",code:"PS",dialCode:"+970",flag:"🇵🇸"},{name:"Panama",code:"PA",dialCode:"+507",flag:"🇵🇦"},{name:"Papua New Guinea",code:"PG",dialCode:"+675",flag:"🇵🇬"},{name:"Paraguay",code:"PY",dialCode:"+595",flag:"🇵🇾"},{name:"Peru",code:"PE",dialCode:"+51",flag:"🇵🇪"},{name:"Philippines",code:"PH",dialCode:"+63",flag:"🇵🇭"},{name:"Pitcairn",code:"PN",dialCode:"+64",flag:"🇵🇳"},{name:"Poland",code:"PL",dialCode:"+48",flag:"🇵🇱"},{name:"Portugal",code:"PT",dialCode:"+351",flag:"🇵🇹"},{name:"Puerto Rico",code:"PR",dialCode:"+1939",flag:"🇵🇷"},{name:"Qatar",code:"QA",dialCode:"+974",flag:"🇶🇦"},{name:"Republic of the Congo",code:"CG",dialCode:"+242",flag:"🇨🇬"},{name:"Reunion",code:"RE",dialCode:"+262",flag:"🇷🇪"},{name:"Romania",code:"RO",dialCode:"+40",flag:"🇷🇴"},{name:"Russia",code:"RU",dialCode:"+7",flag:"🇷🇺"},{name:"Rwanda",code:"RW",dialCode:"+250",flag:"🇷🇼"},{name:"Saint Barthelemy",code:"BL",dialCode:"+590",flag:"🇧🇱"},{name:"Saint Helena",code:"SH",dialCode:"+290",flag:"🇸🇭"},{name:"Saint Kitts and Nevis",code:"KN",dialCode:"+1869",flag:"🇰🇳"},{name:"Saint Lucia",code:"LC",dialCode:"+1758",flag:"🇱🇨"},{name:"Saint Martin",code:"MF",dialCode:"+590",flag:"🇲🇫"},{name:"Saint Pierre and Miquelon",code:"PM",dialCode:"+508",flag:"🇵🇲"},{name:"Saint Vincent and the Grenadines",code:"VC",dialCode:"+1784",flag:"🇻🇨"},{name:"Samoa",code:"WS",dialCode:"+685",flag:"🇼🇸"},{name:"San Marino",code:"SM",dialCode:"+378",flag:"🇸🇲"},{name:"Sao Tome and Principe",code:"ST",dialCode:"+239",flag:"🇸🇹"},{name:"Saudi Arabia",code:"SA",dialCode:"+966",flag:"🇸🇦"},{name:"Senegal",code:"SN",dialCode:"+221",flag:"🇸🇳"},{name:"Serbia",code:"RS",dialCode:"+381",flag:"🇷🇸"},{name:"Seychelles",code:"SC",dialCode:"+248",flag:"🇸🇨"},{name:"Sierra Leone",code:"SL",dialCode:"+232",flag:"🇸🇱"},{name:"Singapore",code:"SG",dialCode:"+65",flag:"🇸🇬"},{name:"Sint Maarten",code:"SX",dialCode:"+1721",flag:"🇸🇽"},{name:"Slovakia",code:"SK",dialCode:"+421",flag:"🇸🇰"},{name:"Slovenia",code:"SI",dialCode:"+386",flag:"🇸🇮"},{name:"Solomon Islands",code:"SB",dialCode:"+677",flag:"🇸🇧"},{name:"Somalia",code:"SO",dialCode:"+252",flag:"🇸🇴"},{name:"South Africa",code:"ZA",dialCode:"+27",flag:"🇿🇦"},{name:"South Korea",code:"KR",dialCode:"+82",flag:"🇰🇷"},{name:"South Sudan",code:"SS",dialCode:"+211",flag:"🇸🇸"},{name:"Spain",code:"ES",dialCode:"+34",flag:"🇪🇸"},{name:"Sri Lanka",code:"LK",dialCode:"+94",flag:"🇱🇰"},{name:"Sudan",code:"SD",dialCode:"+249",flag:"🇸🇩"},{name:"Suriname",code:"SR",dialCode:"+597",flag:"🇸🇷"},{name:"Svalbard and Jan Mayen",code:"SJ",dialCode:"+47",flag:"🇸🇯"},{name:"Swaziland",code:"SZ",dialCode:"+268",flag:"🇸🇿"},{name:"Sweden",code:"SE",dialCode:"+46",flag:"🇸🇪"},{name:"Switzerland",code:"CH",dialCode:"+41",flag:"🇨🇭"},{name:"Syria",code:"SY",dialCode:"+963",flag:"🇸🇾"},{name:"Taiwan",code:"TW",dialCode:"+886",flag:"🇹🇼"},{name:"Tajikistan",code:"TJ",dialCode:"+992",flag:"🇹🇯"},{name:"Tanzania",code:"TZ",dialCode:"+255",flag:"🇹🇿"},{name:"Thailand",code:"TH",dialCode:"+66",flag:"🇹🇭"},{name:"Togo",code:"TG",dialCode:"+228",flag:"🇹🇬"},{name:"Tokelau",code:"TK",dialCode:"+690",flag:"🇹🇰"},{name:"Tonga",code:"TO",dialCode:"+676",flag:"🇹🇴"},{name:"Trinidad and Tobago",code:"TT",dialCode:"+1868",flag:"🇹🇹"},{name:"Tunisia",code:"TN",dialCode:"+216",flag:"🇹🇳"},{name:"Turkey",code:"TR",dialCode:"+90",flag:"🇹🇷"},{name:"Turkmenistan",code:"TM",dialCode:"+993",flag:"🇹🇲"},{name:"Turks and Caicos Islands",code:"TC",dialCode:"+1649",flag:"🇹🇨"},{name:"Tuvalu",code:"TV",dialCode:"+688",flag:"🇹🇻"},{name:"U.S. Virgin Islands",code:"VI",dialCode:"+1340",flag:"🇻🇮"},{name:"Uganda",code:"UG",dialCode:"+256",flag:"🇺🇬"},{name:"Ukraine",code:"UA",dialCode:"+380",flag:"🇺🇦"},{name:"United Arab Emirates",code:"AE",dialCode:"+971",flag:"🇦🇪"},{name:"United Kingdom",code:"GB",dialCode:"+44",flag:"🇬🇧"},{name:"United States",code:"US",dialCode:"+1",flag:"🇺🇸"},{name:"Uruguay",code:"UY",dialCode:"+598",flag:"🇺🇾"},{name:"Uzbekistan",code:"UZ",dialCode:"+998",flag:"🇺🇿"},{name:"Vanuatu",code:"VU",dialCode:"+678",flag:"🇻🇺"},{name:"Vatican",code:"VA",dialCode:"+379",flag:"🇻🇦"},{name:"Venezuela",code:"VE",dialCode:"+58",flag:"🇻🇪"},{name:"Vietnam",code:"VN",dialCode:"+84",flag:"🇻🇳"},{name:"Wallis and Futuna",code:"WF",dialCode:"+681",flag:"🇼🇫"},{name:"Western Sahara",code:"EH",dialCode:"+212",flag:"🇪🇭"},{name:"Yemen",code:"YE",dialCode:"+967",flag:"🇾🇪"},{name:"Zambia",code:"ZM",dialCode:"+260",flag:"🇿🇲"},{name:"Zimbabwe",code:"ZW",dialCode:"+263",flag:"🇿🇼"}],ys=({value:e,onChange:a,error:s,countryCode:n,setCountryCode:i})=>{const[l,m]=o.useState(!1),[c,d]=o.useState(Gs.find(x=>x.code===n)||Gs[0]),p=o.useRef(null),[u,h]=o.useState(""),f=o.useRef(null);o.useEffect(()=>{function x(w){p.current&&!p.current.contains(w.target)&&m(!1)}return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]);const g=Gs.filter(x=>x.name.toLowerCase().includes(u.toLowerCase())||x.dialCode.includes(u));return o.useEffect(()=>{i(c.dialCode)},[c,i]),t.jsxs("div",{className:"w-phone",children:[t.jsxs("div",{style:{position:"relative"},ref:p,children:[t.jsxs("button",{type:"button",className:"w-phone-cc",style:{height:"100%"},onClick:()=>m(x=>!x),children:[t.jsx("span",{children:c.flag}),t.jsx("span",{children:c.dialCode}),t.jsx(Ut,{weight:"bold"})]}),l&&t.jsxs("div",{className:"w-country-pop",children:[t.jsxs("div",{className:"w-country-search",children:[t.jsx(Cl,{}),t.jsx("input",{type:"text",placeholder:"Search country…",value:u,onChange:x=>h(x.target.value),onClick:x=>x.stopPropagation()})]}),t.jsx("div",{className:"w-country-list",children:g.map(x=>t.jsxs("button",{type:"button",className:"w-country-opt",onClick:w=>{var b;w.stopPropagation(),w.preventDefault(),d(x),m(!1),(b=f.current)==null||b.focus()},children:[t.jsx("span",{children:x.flag}),t.jsx("span",{children:x.name}),t.jsx("span",{className:"dial",children:x.dialCode})]},x.code))})]})]}),t.jsx("input",{type:"tel",id:"phone",name:"phone",required:!0,minLength:7,maxLength:15,ref:f,value:e,onChange:a,placeholder:"Phone number","aria-invalid":!!s,pattern:"^\\d{7,15}$"})]})};function Sr({placement:e="center"}){var m;const{deployment:a}=ke(),[s,n]=o.useState(!1),i=(m=a==null?void 0:a.ui_settings)==null?void 0:m.logo_image_url;if(!i||s)return null;const l=e==="left"?"flex-start":e==="right"?"flex-end":"center";return t.jsx("div",{style:{display:"flex",justifyContent:l,width:"100%"},children:t.jsx("img",{src:i,alt:"Logo",onError:()=>n(!0),style:{maxWidth:40,maxHeight:40,width:"auto",height:"auto",objectFit:"contain"}})})}function et({children:e,footer:a}){return t.jsxs("div",{className:"w-card w-auth-card",children:[t.jsx("div",{className:"w-create-body",children:e}),a&&t.jsx("div",{className:"w-create-foot",children:a})]})}function nt({title:e,sub:a,children:s}){return t.jsxs("div",{className:"w-auth-head",children:[t.jsx(Sr,{}),t.jsxs("div",{className:"w-auth-head-text",children:[t.jsx("h1",{className:"w-auth-title",children:e}),a&&t.jsx("p",{className:"w-auth-sub",children:a})]}),s]})}function vt({size:e=16,onAccent:a}){return t.jsx("span",{className:a?"w-spin w-spin--on-accent":"w-spin",style:{width:e,height:e}})}function js(){return t.jsx(Re,{children:t.jsx("div",{className:"w-card w-auth-card",children:t.jsx("div",{className:"w-create-body",children:t.jsxs("div",{className:"w-auth-skel","aria-hidden":"true",children:[t.jsxs("div",{className:"w-auth-skel-head",children:[t.jsx("span",{className:"w-skel w-skel-avatar"}),t.jsx("span",{className:"w-skel w-skel-title"}),t.jsx("span",{className:"w-skel w-skel-sub"})]}),t.jsxs("div",{className:"w-auth-skel-fields",children:[t.jsxs("div",{className:"w-auth-skel-field",children:[t.jsx("span",{className:"w-skel w-skel-label"}),t.jsx("span",{className:"w-skel w-skel-input"})]}),t.jsxs("div",{className:"w-auth-skel-field",children:[t.jsx("span",{className:"w-skel w-skel-label"}),t.jsx("span",{className:"w-skel w-skel-input"})]}),t.jsx("span",{className:"w-skel w-skel-btn"})]})]})})})})}function om(e){const a=e.indexOf(":");return a>=0?e.slice(0,a):e}function lm(e){const a=e.trim();if(!a)return null;try{return new URL(a.includes("://")?a:`https://${a}`).hostname.toLowerCase()||null}catch{return null}}function cm(e){try{return new URL(e)}catch{if(typeof window>"u")return null;try{return new URL(e,window.location.origin)}catch{return null}}}function dm(e,a){return!e||!a?!1:e===a?!0:e.endsWith(`.${a}`)}function um(e,a){if(!a)return!1;const s=cm(a);if(!s||s.protocol!=="https:"&&s.protocol!=="http:")return!1;if((e==null?void 0:e.mode)==="staging")return!0;if(s.protocol!=="https:"||!(e!=null&&e.frontend_host))return!1;const n=lm(om(e.frontend_host));return n?dm(s.hostname.toLowerCase(),n):!1}function gt(e,a){return a&&um(e,a)?a:null}function mm(){var B,Q,ue,we,ne,ae,re,Me,q,tt,Ie,De,Ee,ce,W,G;const{loading:e,signUp:a,signupAttempt:s,discardSignupAttempt:n}=ho(),{signIn:i}=ls("oauth"),{deployment:l}=ke(),{navigate:m}=kt(),{session:c,refetch:d,loading:p}=it(),[u,h]=o.useState({first_name:"",last_name:"",email:"",password:"",username:"",phone_number:""}),[f,g]=o.useState({}),[x,w]=o.useState(!1),[b,j]=o.useState(void 0),[v,k]=o.useState(null),[N,_]=o.useState(null),[C,y]=o.useState(!1),E=((B=l==null?void 0:l.restrictions)==null?void 0:B.sign_up_mode)==="restricted",M=((Q=l==null?void 0:l.restrictions)==null?void 0:Q.sign_up_mode)==="waitlist",F=((we=(ue=l==null?void 0:l.auth_settings)==null?void 0:ue.multi_session_support)==null?void 0:we.enabled)??!1;o.useEffect(()=>{var K;if(!p&&(c!=null&&c.active_signin)&&!F&&!C){y(!0);let V=gt(l,new URLSearchParams(window.location.search).get("redirect_uri"));V||(V=((K=l==null?void 0:l.ui_settings)==null?void 0:K.after_signin_redirect_url)||null),!V&&(l!=null&&l.frontend_host)&&(V=`https://${l.frontend_host}`),V&&m(V)}},[c,p,F,l,m,C]),o.useEffect(()=>{var de;if(!l)return;const V=new URLSearchParams(window.location.search).get("invite_token");if(M&&!V){y(!0);const z=((de=l.ui_settings)==null?void 0:de.waitlist_page_url)||`https://${l.frontend_host}/waitlist`;m(z);return}V&&!v&&a&&(_(V),a.validateDeploymentInvitation(V).then(z=>{k(z),z.valid&&h(le=>({...le,first_name:z.first_name||le.first_name,last_name:z.last_name||le.last_name,email:z.email||le.email}))}).catch(()=>{g(z=>({...z,submit:"Failed to validate invitation."}))}))},[l,M,m,v,a]);const[A,T]=o.useState(!1),[P,S]=o.useState(""),$=K=>{let{name:V,value:de}=K.target;V==="phone_number"?de=de.replace(/[^0-9-]/g,""):V==="email"&&(de=de.toLowerCase()),h(z=>({...z,[V]:de})),g(z=>({...z,[V]:""}))},H=()=>{h({first_name:"",last_name:"",email:"",password:"",username:"",phone_number:""}),g({}),T(!1),S(""),n()},R=async K=>{if(K.preventDefault(),e||x)return;const V={},de=/^[a-zA-Z]{3,30}$/,z=/^[a-zA-Z][a-zA-Z0-9_.]{2,29}$/,le=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Je=/^\d{7,15}$/,ot=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,125}$/;if(L!=null&&L.first_name.enabled&&(L!=null&&L.first_name.required&&!u.first_name?V.first_name="First name is required":u.first_name&&!de.test(u.first_name)&&(V.first_name="Invalid name")),L!=null&&L.last_name.enabled&&(L!=null&&L.last_name.required&&!u.last_name?V.last_name="Last name is required":u.last_name&&!de.test(u.last_name)&&(V.last_name="Invalid last name")),L!=null&&L.username.enabled&&(L!=null&&L.username.required&&!u.username?V.username="Username is required":u.username&&!z.test(u.username)&&(V.username="Username must be 3-20 characters")),L!=null&&L.email_address.enabled&&(L!=null&&L.email_address.required&&!u.email?V.email="Email address is required":u.email&&!le.test(u.email)&&(V.email="Invalid email address")),L!=null&&L.phone_number.enabled&&(L!=null&&L.phone_number.required&&!u.phone_number?V.phone_number="Phone number is required":u.phone_number&&!Je.test(u.phone_number)&&(V.phone_number="Phone number must contain 7-15 digits")),L!=null&&L.password.enabled&&(u.password?ot.test(u.password)||(V.password="Password must be 8-125 characters and include uppercase, lowercase, number, and special character"):V.password="Password is required"),g(V),!(Object.keys(V).length>0)){w(!0);try{const ge={...u};u.phone_number&&b&&(ge.phone_country_code=b),N&&(ge.invite_token=N),await a.create(ge)}catch(ge){g({submit:ge.message})}finally{w(!1)}}},O=async K=>{if(!(e||x)){w(!0);try{const V=new URLSearchParams(window.location.search),de=gt(l,V.get("redirect_uri"))||void 0,{data:z}=await i.create({provider:K.provider,redirectUri:de});z&&typeof z=="object"&&"oauth_url"in z&&(window.location.href=z.oauth_url)}catch(V){g({submit:V.message})}finally{w(!1)}}},Z=(l==null?void 0:l.social_connections.filter(K=>K.enabled))||[],L=l==null?void 0:l.auth_settings,U=!!((ne=L==null?void 0:L.first_name)!=null&&ne.enabled&&((ae=L==null?void 0:L.last_name)!=null&&ae.enabled)),D=async K=>{var de;if(K.preventDefault(),e||x)return;w(!0);const V={};if(!P){V.otp="OTP code is required",g(V),w(!1);return}g(V);try{const z=await a.completeVerification(P);"data"in z&&((de=z.data)!=null&&de.active_signin)&&await d()}catch{g(z=>({...z,submit:"Verification failed. Please try again."}))}finally{w(!1)}};if(o.useEffect(()=>{var K;if(s){if(s.completed){let V=gt(l,new URLSearchParams(window.location.search).get("redirect_uri"));if(V||(V=((K=l==null?void 0:l.ui_settings)==null?void 0:K.after_signup_redirect_url)||null),!V&&(l!=null&&l.frontend_host)&&(V=`https://${l.frontend_host}`),V){let de;try{de=new URL(V)}catch{de=new URL(V,window.location.origin)}(l==null?void 0:l.mode)==="staging"&&de.searchParams.set("__dev_session__",xt(l.backend_host)||""),m(de.toString())}return}if(!A){switch(s.current_step){case"verify_email":a.prepareVerification({strategy:"email_otp"});break;case"verify_phone":a.prepareVerification({strategy:"phone_otp"});break}T(!0)}}},[s,a,A,l,c,m]),p||C)return t.jsx(js,{});const Y=((re=l==null?void 0:l.ui_settings)==null?void 0:re.app_name)||"App";if(E)return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Need assistance?"," ",t.jsx(Et,{className:"w-link",to:(Me=l==null?void 0:l.ui_settings)!=null&&Me.sign_in_page_url?`${l.ui_settings.sign_in_page_url}?help=true`:"#",children:"Get help"})]}),children:[t.jsx(nt,{title:"Sign-up restricted",sub:"This app isn't open for public sign-up right now."}),t.jsx("div",{className:"w-banner w-banner--warn",children:t.jsx("span",{className:"w-banner-txt",children:"New account registration is currently restricted. Please check back later or contact your administrator for an invitation."})})]})});if(A){const K=(s==null?void 0:s.current_step)==="verify_phone";return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx(Et,{className:"w-link",to:((q=l==null?void 0:l.ui_settings)==null?void 0:q.support_page_url)||"#",children:"Get help"})]}),children:[t.jsx(nt,{title:K?"Check your phone":"Enter the code",sub:K?"We sent a verification code via SMS.":"We sent a 6-digit code to your email.",children:t.jsxs("button",{type:"button",className:"w-addr-badge",onClick:H,children:[t.jsx(Al,{weight:"bold"}),K?`+${u.phone_number}`:u.email]})}),t.jsxs("form",{onSubmit:D,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[t.jsx(va,{onComplete:async V=>{S(V)},onResend:async()=>{const V=K?"phone_otp":"email_otp";await a.prepareVerification({strategy:V})},error:f.otp,isSubmitting:x}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:x||e||!P,children:x&&P?t.jsx(vt,{size:15,onAccent:!0}):`Continue to ${Y}`})]})]})})}return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Already have an account?"," ",t.jsx(Et,{className:"w-link",to:`${((tt=l==null?void 0:l.ui_settings)==null?void 0:tt.sign_in_page_url)??""}${window.location.search}`,children:"Sign in"})]}),children:[t.jsx(nt,{title:"Create your account",sub:v!=null&&v.valid?"You've been invited — complete your registration below.":"Get started in a few seconds."}),Z.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(Nr,{connections:Z,callback:O}),t.jsx("div",{className:"w-or",children:t.jsx("span",{children:"OR"})})]}),t.jsxs("form",{onSubmit:R,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:13},children:[(((Ie=L==null?void 0:L.first_name)==null?void 0:Ie.enabled)||((De=L==null?void 0:L.last_name)==null?void 0:De.enabled))&&t.jsxs("div",{className:U?"w-grid-2":"",children:[((Ee=L==null?void 0:L.first_name)==null?void 0:Ee.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["First name",((ce=L==null?void 0:L.first_name)==null?void 0:ce.required)&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(qt,{className:"w-input",type:"text",id:"first_name",name:"first_name",autoComplete:"given-name",required:!0,minLength:3,maxLength:30,value:u.first_name,onChange:$,placeholder:"Jane","aria-invalid":!!f.first_name,pattern:"^[a-zA-Z]{3,30}$"}),f.first_name&&t.jsx("span",{className:"w-input-err",children:f.first_name})]}),((W=L==null?void 0:L.last_name)==null?void 0:W.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Last name",((G=L==null?void 0:L.last_name)==null?void 0:G.required)&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(qt,{className:"w-input",type:"text",id:"last_name",name:"last_name",autoComplete:"family-name",required:!0,minLength:3,maxLength:30,value:u.last_name,onChange:$,placeholder:"Doe","aria-invalid":!!f.last_name,pattern:"^[a-zA-Z]{3,30}$"}),f.last_name&&t.jsx("span",{className:"w-input-err",children:f.last_name})]})]}),(L==null?void 0:L.username.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Username",L.username.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(qt,{className:"w-input",type:"text",id:"username",name:"username",autoComplete:"username",minLength:3,maxLength:20,value:u.username,onChange:$,placeholder:"yourname","aria-invalid":!!f.username,required:!0,pattern:"^[a-zA-Z][a-zA-Z0-9_.]{2,29}$"}),f.username&&t.jsx("span",{className:"w-input-err",children:f.username})]}),(L==null?void 0:L.email_address.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Email address",L.email_address.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(qt,{className:"w-input",type:"email",id:"email",name:"email",autoComplete:"email",maxLength:320,value:u.email,onChange:$,placeholder:"you@company.com","aria-invalid":!!f.email,required:!0,readOnly:(v==null?void 0:v.valid)&&!!(v!=null&&v.email),pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"}),f.email&&t.jsx("span",{className:"w-input-err",children:f.email})]}),(L==null?void 0:L.phone_number.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Phone number",L.phone_number.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(ys,{value:u.phone_number,onChange:$,error:f.phone_number,countryCode:b,setCountryCode:j}),f.phone_number&&t.jsx("span",{className:"w-input-err",children:f.phone_number})]}),(L==null?void 0:L.password.enabled)&&t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Password",L.password.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(qt,{className:"w-input",type:"password",id:"password",name:"password",autoComplete:"new-password",value:u.password,onChange:$,placeholder:"Create a password","aria-invalid":!!f.password,required:!0,minLength:8,maxLength:128,pattern:"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,125}$"}),f.password&&t.jsx("span",{className:"w-input-err",children:f.password})]}),f.submit&&t.jsx("span",{className:"w-input-err",children:f.submit}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:x||e,children:x?t.jsx(vt,{size:15,onAccent:!0}):"Continue"}),(()=>{var de,z;const K=(de=l==null?void 0:l.ui_settings)==null?void 0:de.tos_page_url,V=(z=l==null?void 0:l.ui_settings)==null?void 0:z.privacy_policy_url;return!K&&!V?null:t.jsxs("p",{className:"w-fineprint",children:["By continuing you agree to our"," ",K&&t.jsx(Et,{className:"w-link w-link--muted",to:K,children:"Terms of Service"}),K&&V&&" and ",V&&t.jsx(Et,{className:"w-link w-link--muted",to:V,children:"Privacy Policy"}),"."]})})()]})]})})}function Nc({icon:e,label:a,description:s,onClick:n,disabled:i,type:l="button"}){return t.jsxs("button",{type:l,className:"w-method",onClick:n,disabled:i,"data-disabled":i?"":void 0,children:[t.jsx("span",{className:"w-method-ic",children:e}),t.jsxs("span",{className:"w-method-body",children:[t.jsx("span",{className:"w-method-title",children:a}),s&&t.jsx("span",{className:"w-method-desc",children:s})]}),t.jsx("span",{className:"w-method-go",children:t.jsx(Qt,{})})]})}const Sc=o.createContext(void 0);function Ec(){const e=o.useContext(Sc);if(!e)throw new Error("useSignIn must be used within a SignInProvider");return e}function pm({children:e}){var j;const{deployment:a}=ke(),[s,n]=o.useState((a==null?void 0:a.auth_settings.first_factor)||"email_password"),i=o.useRef(!!(a!=null&&a.auth_settings.first_factor)),[l,m]=o.useState(""),[c,d]=o.useState(!1),[p,u]=o.useState(!1),[h,f]=o.useState(!1),[g,x]=o.useState("identifier"),w=(a==null?void 0:a.social_connections.filter(v=>v.enabled))||[],b=a==null?void 0:a.auth_settings;return o.useEffect(()=>{var k;const v=(k=a==null?void 0:a.auth_settings)==null?void 0:k.first_factor;!i.current&&v&&(n(v),i.current=!0)},[(j=a==null?void 0:a.auth_settings)==null?void 0:j.first_factor]),t.jsx(Sc.Provider,{value:{email:l,showOtherOptions:c,showForgotPassword:p,otpSent:h,setFirstFactor:n,setEmail:m,setShowOtherOptions:d,setShowForgotPassword:u,setOtpSent:f,enabledSocialsProviders:w,authSettings:b,firstFactor:s,signInStep:g,setSignInStep:x},children:e})}const hm=[{key:"email_magic_link",icon:t.jsx(Ru,{}),label:"Magic link",description:"We'll email you a one-click sign-in link"},{key:"email_password",icon:t.jsx(Mu,{}),label:"Email and password",description:"Sign in with your email and password"},{key:"email_otp",icon:t.jsx(xl,{}),label:"Email one-time code",description:"We'll send a verification code to your email"},{key:"phone_otp",icon:t.jsx(Nu,{}),label:"Phone number",description:"We'll send a verification code via SMS"},{key:"username_password",icon:t.jsx(hs,{}),label:"Username and password",description:"Sign in with your username and password"}];function Ac(){const{deployment:e}=ke(),{signIn:a}=ls("oauth"),{setFirstFactor:s,firstFactor:n,setShowOtherOptions:i,setSignInStep:l}=Ec(),[m,c]=o.useState(!1),d=e==null?void 0:e.auth_settings,p=(e==null?void 0:e.social_connections.filter(x=>x.enabled))||[],u=async x=>{if(!m){c(!0);try{const{data:w}=await a.create({provider:x.provider});w&&typeof w=="object"&&"oauth_url"in w&&(window.location.href=w.oauth_url)}catch{}finally{c(!1)}}},h=hm.filter(x=>{if(x.key===n)return!1;const w=d==null?void 0:d.auth_factors_enabled;return w?w[x.key]:!1}),f=p.length>0,g=h.length>0;return t.jsxs(t.Fragment,{children:[f&&t.jsx(Nr,{connections:p,callback:u}),f&&g&&t.jsx("div",{className:"w-or",children:t.jsx("span",{children:"or"})}),g&&t.jsx("div",{className:"w-method-stack",children:h.map(x=>t.jsx(Nc,{icon:x.icon,label:x.label,description:x.description,onClick:()=>{s(x.key),l("identifier"),i(!1)}},x.key))})]})}function fm({onBack:e}){var F;const{deployment:a}=ke(),{navigate:s}=kt(),[n,i]=o.useState("start"),[l,m]=o.useState(""),[c,d]=o.useState(""),[p,u]=o.useState(""),[h,f]=o.useState(""),[g,x]=o.useState(""),{forgotPassword:w,verifyOtp:b,resetPassword:j}=Ao(),[v,k]=o.useState(!1),[N,_]=o.useState(null),C=async A=>{if(A.preventDefault(),!!l){k(!0),_(null);try{await w(l),i("otp")}catch(T){_(T)}finally{k(!1)}}},y=async A=>{if(A.preventDefault(),c.length===6){k(!0),_(null);try{const T=await b(l,c);T.data&&(u(T.data.token),i("reset"))}catch(T){_(T)}finally{k(!1)}}},E=async A=>{var T,P;if(A.preventDefault(),h===g&&!(h.length<8)){k(!0),_(null);try{const S=await j(p,h);if(S.data){const $=S.data,H=$.signin_attempts&&$.signin_attempts.length>0?$.signin_attempts[$.signin_attempts.length-1]:null;if(H&&!H.completed){const R=(T=a==null?void 0:a.ui_settings)==null?void 0:T.sign_in_page_url;if(R){const O=new URL(R,window.location.origin);O.searchParams.set("signin_attempt_id",H.id),s(O.toString())}else e()}else{const R=((P=a==null?void 0:a.ui_settings)==null?void 0:P.after_signin_redirect_url)||"/";s(R)}}}catch(S){_(S)}finally{k(!1)}}},M=t.jsx("span",{className:"w-auth-foot",children:t.jsx("span",{className:"w-link",style:{cursor:"pointer"},onClick:e,children:"Back to sign in"})});return t.jsxs(Re,{children:[n==="start"&&t.jsxs(et,{footer:M,children:[t.jsx(nt,{title:"Forgot your password?",sub:"Reset it, or sign in another way."}),t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:()=>i("email"),disabled:v,children:"Reset your password"}),t.jsx("div",{className:"w-or",children:t.jsx("span",{children:"OR"})}),t.jsx(Ac,{}),t.jsxs("p",{className:"w-secsub",style:{textAlign:"center",marginTop:16},children:["Unable to reset password?"," ",t.jsx("a",{className:"w-link",href:((F=a==null?void 0:a.ui_settings)==null?void 0:F.support_page_url)||"#",children:"Get help"})]})]}),n==="email"&&t.jsxs(et,{footer:M,children:[t.jsx(nt,{title:"Forgot password",sub:"Enter your email and we'll send you a code to reset your password."}),t.jsxs("form",{onSubmit:C,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:13},children:[t.jsxs("label",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"Email address"}),t.jsx("input",{className:"w-input",type:"email",id:"email",value:l,onChange:A=>m(A.target.value),placeholder:"you@company.com",required:!0})]}),N&&t.jsx("span",{className:"w-input-err",children:N.message}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:v,children:v?t.jsx(vt,{size:15,onAccent:!0}):"Send code"})]})]}),n==="otp"&&t.jsxs(et,{footer:M,children:[t.jsx(nt,{title:"Enter verification code",sub:`We sent a 6-digit code to ${l}.`}),t.jsxs("form",{onSubmit:y,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[t.jsx(va,{onComplete:A=>d(A),isSubmitting:v,error:N==null?void 0:N.message,onResend:async()=>{await w(l)}}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:v||c.length!==6,children:v?t.jsx(vt,{size:15,onAccent:!0}):"Verify"})]})]}),n==="reset"&&t.jsxs(et,{footer:M,children:[t.jsx(nt,{title:"Reset password",sub:"Create a new password for your account."}),t.jsxs("form",{onSubmit:E,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:13},children:[t.jsxs("label",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"New password"}),t.jsx("input",{className:"w-input",type:"password",id:"password",value:h,onChange:A=>f(A.target.value),placeholder:"Enter new password",required:!0})]}),t.jsxs("label",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"Confirm new password"}),t.jsx("input",{className:"w-input",type:"password",id:"confirmPassword",value:g,onChange:A=>x(A.target.value),placeholder:"Confirm new password",required:!0})]}),N&&t.jsx("span",{className:"w-input-err",children:N.message}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:v,children:v?t.jsx(vt,{size:15,onAccent:!0}):"Reset password"})]})]})]})}function wm({onBack:e}){var n;const{deployment:a}=ke(),s=(n=a==null?void 0:a.ui_settings)==null?void 0:n.app_name;return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsx("span",{className:"w-auth-foot",children:t.jsx("button",{type:"button",className:"w-link",onClick:e,children:"Back to sign in"})}),children:[t.jsx(nt,{title:"All sign-in methods",sub:`Choose another way to sign in to ${s||"your account"}`}),t.jsx(Ac,{})]})})}function Mc({methods:e,onSelectMethod:a,onBack:s}){return t.jsx(Re,{children:t.jsxs(et,{footer:s?t.jsx("span",{className:"w-auth-foot",children:t.jsx("button",{type:"button",className:"w-link",onClick:s,children:"Back to login"})}):void 0,children:[t.jsx(nt,{title:"Two-factor authentication",sub:"Choose how you'd like to verify your identity"}),t.jsx("div",{className:"w-method-stack",children:e.map(n=>t.jsx(Nc,{icon:n.icon,label:n.name,description:n.phoneNumber?`${n.description} ${n.phoneNumber}`:n.description,onClick:()=>a(n.id),disabled:!n.available},n.id))})]})})}function Rc({onVerify:e,onBack:a,loading:s}){const[n,i]=o.useState(""),[l,m]=o.useState(""),c=p=>{if(p.preventDefault(),n.length!==4){m("Please enter the last 4 digits of your phone number");return}e(n)},d=p=>{const u=p.target.value.replace(/\D/g,"").slice(0,4);i(u),m("")};return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsx("span",{className:"w-auth-foot",children:t.jsx("button",{type:"button",className:"w-link",onClick:a,children:"Choose a different method"})}),children:[t.jsx(nt,{title:"Verify phone",sub:"Enter the last 4 digits of your phone number."}),t.jsxs("form",{onSubmit:c,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{className:"w-field",children:[t.jsx("label",{className:"w-label",htmlFor:"lastDigits",children:"Last 4 digits"}),t.jsx("input",{className:`w-input${l?" w-input--invalid":""}`,type:"text",id:"lastDigits",name:"lastDigits",value:n,onChange:d,placeholder:"0000",maxLength:4,autoComplete:"off","aria-invalid":!!l,autoFocus:!0}),l&&t.jsx("span",{className:"w-input-err",children:l})]}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:s||n.length!==4,children:s?t.jsx(vt,{onAccent:!0}):"Send code"})]})]})})}const gm=()=>t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),xm=()=>t.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),t.jsx("path",{d:"M12 18h.01"})]}),vm=()=>t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m21 2-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0 3 3L22 7l-3-3m-3.5 3.5L19 4"})});function Lc({onBack:e,attempt:a,completeVerification:s,prepareVerification:n}){const{deployment:i}=ke(),[l,m]=o.useState(""),[c,d]=o.useState({}),[p,u]=o.useState(!1),[h,f]=o.useState(null),[g,x]=o.useState(!0),[w,b]=o.useState(!1),[j,v]=o.useState(""),[k,N]=o.useState(!1),{navigate:_}=kt(),C=(a==null?void 0:a.available_2fa_methods)||[],y=[{id:"authenticator",name:"Authenticator app",description:"Use your authenticator app",icon:t.jsx(gm,{}),available:C.includes("authenticator")},{id:"phone_otp",name:"Text message",description:"Get a code via SMS",icon:t.jsx(xm,{}),available:C.includes("phone_otp"),phoneNumber:j},{id:"backup_code",name:"Backup code",description:"Use one of your backup codes",icon:t.jsx(vm,{}),available:C.includes("backup_code")}].filter(P=>P.available),E=async P=>{f(P),x(!1),P==="phone_otp"&&b(!0)},M=async P=>{var S,$;if(a){u(!0);try{const H=await n({strategy:"phone_otp",lastDigits:P});H&&"data"in H&&((S=H.data)!=null&&S.otp_sent)?(($=H.data)!=null&&$.masked_phone&&v(H.data.masked_phone),b(!1)):d({phone:"Phone number verification failed"})}catch(H){d({phone:H.message})}finally{u(!1)}}},F=async(P,S)=>{if(P.preventDefault(),p)return;const $=S||l,H={};if($?h==="authenticator"&&$.length!==6?H.code="Authentication code must be 6 digits":h==="phone_otp"&&$.length!==6&&(H.code="SMS code must be 6 digits"):H.code="Verification code is required",d(H),!(Object.keys(H).length>0)){u(!0);try{await s($)}catch(R){d({submit:R.message})}finally{u(!1)}}},A=P=>{let S=P.target.value;h!=="backup_code"&&(S=S.replace(/\D/g,"").slice(0,6)),m(S),d($=>({...$,code:""}))};if(o.useEffect(()=>{var P;if(a.completed){N(!0);let S=gt(i,new URLSearchParams(window.location.search).get("redirect_uri"));if(S||(S=((P=i==null?void 0:i.ui_settings)==null?void 0:P.after_signin_redirect_url)||null),!S&&(i!=null&&i.frontend_host)&&(S=`https://${i.frontend_host}`),S){let $;try{$=new URL(S)}catch{$=new URL(S,window.location.origin)}(i==null?void 0:i.mode)==="staging"&&$.searchParams.set("__dev_session__",xt(i.backend_host)||""),_($.toString())}return}},[a,i]),k)return t.jsx(js,{});if(g)return y.length===0?t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx(Et,{to:(i==null?void 0:i.ui_settings.support_page_url)||"#",className:"w-link",children:"Get help"})]}),children:[t.jsx(nt,{title:"Set up two-factor authentication",sub:"Your account requires two-factor authentication, but you haven't set up any methods yet. Please contact your administrator to set up 2FA."}),e&&t.jsx("div",{style:{textAlign:"center"},children:t.jsx("button",{type:"button",className:"w-link",onClick:e,children:"Back to login"})})]})}):t.jsx(Mc,{methods:y,onSelectMethod:E,onBack:e});if(w&&h==="phone_otp")return t.jsx(Rc,{onVerify:M,onBack:()=>{b(!1),x(!0),f(null)},loading:p});const T=h==="authenticator"?"Enter the 6-digit code from your authenticator app":h==="phone_otp"?`Enter the 6-digit code sent to your phone ${j}`:"Enter one of your backup codes";return t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx(Et,{to:(i==null?void 0:i.ui_settings.support_page_url)||"#",className:"w-link",children:"Get help"})]}),children:[t.jsx(nt,{title:"Two-factor authentication",sub:T}),t.jsxs("form",{onSubmit:F,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:16},children:[h==="backup_code"?t.jsxs("div",{className:"w-field",children:[t.jsx("label",{className:"w-label",htmlFor:"code",children:"Backup code"}),t.jsx("input",{className:`w-input${c.code?" w-input--invalid":""}`,type:"text",id:"code",name:"code",value:l,onChange:A,placeholder:"Enter backup code",maxLength:20,autoComplete:"one-time-code","aria-invalid":!!c.code,autoFocus:!0}),c.code&&t.jsx("span",{className:"w-input-err",children:c.code})]}):t.jsx(va,{onComplete:async P=>{if(m(P),h!=="backup_code"){const S=new Event("submit",{bubbles:!0,cancelable:!0});await F(S,P)}},onResend:h==="phone_otp"?async()=>{try{await n({strategy:"phone_otp",lastDigits:j.slice(-4)})}catch(P){d({submit:P.message})}}:void 0,error:c.code,isSubmitting:p}),c.submit&&t.jsx("span",{className:"w-input-err",children:c.submit}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:p||!l,children:p?t.jsx(vt,{onAccent:!0}):"Verify"})]}),t.jsxs("div",{style:{marginTop:18,textAlign:"center",display:"flex",flexDirection:"column",gap:8},children:[t.jsx("button",{type:"button",className:"w-link",onClick:()=>{x(!0),f(null),m(""),d({})},children:"Try another method"}),e&&t.jsx("button",{type:"button",className:"w-link w-link--muted",onClick:e,children:"Back to login"})]})]})})}function Pc({attempt:e,onBack:a,completeProfile:s,completeVerification:n,prepareVerification:i}){var Z,L,U,D,Y,B,Q,ue,we;const{deployment:l}=ke(),{navigate:m}=kt(),[c,d]=o.useState({}),[p,u]=o.useState({}),[h,f]=o.useState("US"),[g,x]=o.useState(!1),[w,b]=o.useState(!1),[j,v]=o.useState(null),[k,N]=o.useState(!1),_=j,C=w,y=()=>{var ae;N(!0);let ne=gt(l,new URLSearchParams(window.location.search).get("redirect_uri"));if(ne||(ne=((ae=l==null?void 0:l.ui_settings)==null?void 0:ae.after_signin_redirect_url)||null),!ne&&(l!=null&&l.frontend_host)&&(ne=`https://${l.frontend_host}`),ne){let re;try{re=new URL(ne)}catch{re=new URL(ne,window.location.origin)}(l==null?void 0:l.mode)==="staging"&&re.searchParams.set("__dev_session__",xt(l.backend_host)||""),m(re.toString())}},E=async ne=>{b(!0),v(null);try{await s(ne)&&y()}catch(ae){const re=ae;throw v(re),re}finally{b(!1)}},M=async ne=>{b(!0),v(null);try{return await n(ne)&&y(),!0}catch(ae){return v(ae),!1}finally{b(!1)}};if(k||!e)return t.jsx(js,{});const F=e.missing_fields||[],A=l==null?void 0:l.auth_settings,T=(e==null?void 0:e.current_step)==="verify_phone_otp"||(e==null?void 0:e.current_step)==="verify_email_otp"||g,P=ne=>{const{name:ae,value:re}=ne.target;d(Me=>({...Me,[ae]:re})),p[ae]&&u(Me=>({...Me,[ae]:""}))},S=()=>{const ne={};return F.forEach(ae=>{var q,tt,Ie,De,Ee;const re=c[ae];let Me=!1;switch(ae){case"first_name":Me=((q=A==null?void 0:A.first_name)==null?void 0:q.enabled)||!1;break;case"last_name":Me=((tt=A==null?void 0:A.last_name)==null?void 0:tt.enabled)||!1;break;case"username":Me=((Ie=A==null?void 0:A.username)==null?void 0:Ie.enabled)||!1;break;case"phone_number":Me=((De=A==null?void 0:A.phone_number)==null?void 0:De.enabled)||!1;break;case"email_address":Me=((Ee=A==null?void 0:A.email_address)==null?void 0:Ee.enabled)||!1;break;default:Me=!0}if(Me&&(!re||re.trim()==="")){const ce=ae.replace("_"," ").replace(/\b\w/g,W=>W.toUpperCase());ne[ae]=`${ce} is required`}}),c.username&&F.includes("username")&&(/^[a-zA-Z0-9_-]{3,30}$/.test(c.username)||(ne.username="Username must be 3-30 characters and contain only letters, numbers, underscores, and hyphens")),c.phone_number&&F.includes("phone_number")&&(/^\d{7,15}$/.test(c.phone_number)||(ne.phone_number="Phone number must contain 7-15 digits")),c.email&&F.includes("email_address")&&(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(c.email)||(ne.email_address="Please enter a valid email address")),u(ne),Object.keys(ne).length===0},$=async ne=>{if(ne.preventDefault(),!S())return;const ae={...c};c.phone_number&&h&&(ae.phone_country_code=h),await E(ae)},H=ne=>{const ae=ne.target.value;d(re=>({...re,phone_number:ae})),p.phone_number&&u(re=>({...re,phone_number:""}))},R=t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx(Et,{to:(l==null?void 0:l.ui_settings.support_page_url)||"#",className:"w-link",children:"Get help"})]});if(T){const ne=e.current_step==="verify_phone_otp"?"Verify your phone number":"Verify your email",ae=e.current_step==="verify_phone_otp"?"Enter the 6-digit code sent to your phone":"Enter the 6-digit code sent to your email",re=e.current_step==="verify_phone_otp"?"phone_otp":"email_otp";return t.jsx(Re,{children:t.jsxs(et,{footer:R,children:[t.jsx(nt,{title:ne,sub:ae}),t.jsxs("form",{onSubmit:Me=>Me.preventDefault(),noValidate:!0,style:{display:"flex",flexDirection:"column",gap:14},children:[t.jsx(va,{onComplete:M,onResend:async()=>{await i({strategy:re})},error:_==null?void 0:_.message,isSubmitting:C}),_&&t.jsx("span",{className:"w-input-err",children:_.message})]}),t.jsx("div",{style:{marginTop:16,textAlign:"center"},children:t.jsx("button",{type:"button",className:"w-link",onClick:()=>x(!1),children:"Back to profile completion"})})]})})}const O=!!((Z=A==null?void 0:A.first_name)!=null&&Z.enabled&&((L=A==null?void 0:A.last_name)!=null&&L.enabled)&&F.includes("first_name")&&F.includes("last_name"));return t.jsx(Re,{children:t.jsxs(et,{footer:a?t.jsx("span",{className:"w-auth-foot",children:t.jsx("button",{type:"button",className:"w-link",onClick:a,children:"Back to login"})}):R,children:[t.jsx(nt,{title:"Complete your profile",sub:"Please provide the following information to continue"}),t.jsxs("form",{onSubmit:$,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:16},children:[(F.includes("first_name")||F.includes("last_name"))&&(((U=A==null?void 0:A.first_name)==null?void 0:U.enabled)||((D=A==null?void 0:A.last_name)==null?void 0:D.enabled))&&t.jsxs("div",{className:O?"w-grid-2":"",children:[F.includes("first_name")&&((Y=A==null?void 0:A.first_name)==null?void 0:Y.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"first_name",children:["First name",A.first_name.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:`w-input${p.first_name?" w-input--invalid":""}`,type:"text",id:"first_name",name:"first_name",value:c.first_name||"",onChange:P,placeholder:"Enter your first name",disabled:C,autoComplete:"given-name"}),p.first_name&&t.jsx("span",{className:"w-input-err",children:p.first_name})]}),F.includes("last_name")&&((B=A==null?void 0:A.last_name)==null?void 0:B.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"last_name",children:["Last name",A.last_name.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:`w-input${p.last_name?" w-input--invalid":""}`,type:"text",id:"last_name",name:"last_name",value:c.last_name||"",onChange:P,placeholder:"Enter your last name",disabled:C,autoComplete:"family-name"}),p.last_name&&t.jsx("span",{className:"w-input-err",children:p.last_name})]})]}),F.includes("username")&&((Q=A==null?void 0:A.username)==null?void 0:Q.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"username",children:["Username",A.username.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:`w-input${p.username?" w-input--invalid":""}`,type:"text",id:"username",name:"username",value:c.username||"",onChange:P,placeholder:"Choose a username",disabled:C,autoComplete:"username"}),p.username&&t.jsx("span",{className:"w-input-err",children:p.username})]}),F.includes("phone_number")&&((ue=A==null?void 0:A.phone_number)==null?void 0:ue.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"phone_number",children:["Phone number",A.phone_number.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx(ys,{value:c.phone_number||"",onChange:H,error:p.phone_number,countryCode:h,setCountryCode:f}),p.phone_number&&t.jsx("span",{className:"w-input-err",children:p.phone_number})]}),F.includes("email_address")&&((we=A==null?void 0:A.email_address)==null?void 0:we.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"email",children:["Email address",A.email_address.required&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:`w-input${p.email_address?" w-input--invalid":""}`,type:"email",id:"email",name:"email",value:c.email||"",onChange:P,placeholder:"Enter your email address",disabled:C,autoComplete:"email"}),p.email_address&&t.jsx("span",{className:"w-input-err",children:p.email_address})]}),_&&t.jsx("span",{className:"w-input-err",children:_.message}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:C,children:C?t.jsx(vt,{onAccent:!0}):"Continue"})]})]})})}function $c({onComplete:e,onSkip:a}){var u;const[s,n]=o.useState(!1),[i,l]=o.useState(null),{registerPasskey:m}=xa(),{deployment:c}=ke(),d=async()=>{n(!0),l(null);try{await m(),e==null||e()}catch(h){l(h instanceof Error?h.message:"Failed to register passkey")}finally{n(!1)}},p=((u=c==null?void 0:c.ui_settings)==null?void 0:u.app_name)||"this app";return t.jsxs("div",{className:"w-flex w-flex-col w-items-center w-text-center",children:[t.jsx("div",{className:"w-feature-badge",children:t.jsx(ar,{size:26})}),t.jsx("h1",{className:"w-title-lg",children:"Add a passkey"}),t.jsxs("p",{className:"w-sub",style:{marginTop:6,maxWidth:320},children:["Sign in faster and more securely with a passkey. Use your fingerprint, face, or screen lock to access ",p,"."]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,width:"100%",marginTop:24},children:[t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:d,disabled:s,children:s?t.jsxs(t.Fragment,{children:[t.jsx(vt,{size:15,onAccent:!0}),"Registering…"]}):t.jsxs(t.Fragment,{children:[t.jsx(ar,{}),"Add passkey"]})}),t.jsx("button",{type:"button",className:"w-social",onClick:a,children:"Maybe later"})]}),i&&t.jsx("p",{className:"w-input-err",style:{marginTop:14},children:i})]})}function bm(){return t.jsx(pm,{children:t.jsx(ym,{})})}function ym(){var Wt,ba,ya,yt,aa,sa,na,ra,oe,xe,Ne,J,ve,Ye,Ve,jt,_t,Be,wt,Bt,ia,oa,la;const{deployment:e}=ke(),{navigate:a}=kt(),{session:s,loading:n,refetch:i,exchangeTicket:l,switchSignIn:m}=it(),c=((ba=(Wt=e==null?void 0:e.auth_settings)==null?void 0:Wt.multi_session_support)==null?void 0:ba.enabled)??!1,{setEmail:d,otpSent:p,setOtpSent:u,showForgotPassword:h,setShowForgotPassword:f,showOtherOptions:g,setShowOtherOptions:x,enabledSocialsProviders:w,firstFactor:b,setFirstFactor:j,signInStep:v,setSignInStep:k}=Ec(),{loading:N,signIn:_,signinAttempt:C,discardSignInAttempt:y,setSignInAttempt:E}=ls("generic"),{signIn:M}=ls("oauth"),{signIn:F}=ls("passkey"),[A,T]=o.useState({email:"",username:"",password:"",phone:""}),[P,S]=o.useState({}),[$,H]=o.useState(!1),[R,O]=o.useState(""),[Z,L]=o.useState("US"),[U,D]=o.useState(!1),[Y,B]=o.useState(null),[Q,ue]=o.useState(!1),[we,ne]=o.useState(!1),[ae,re]=o.useState(!1),[Me,q]=o.useState(60),[tt,Ie]=o.useState(!1),[De,Ee]=o.useState(null),ce=[...(s==null?void 0:s.signins)||[]].sort((X,te)=>{var pe,Pe;return X.id===((pe=s==null?void 0:s.active_signin)==null?void 0:pe.id)?-1:te.id===((Pe=s==null?void 0:s.active_signin)==null?void 0:Pe.id)?1:0});o.useEffect(()=>{const X=new URLSearchParams(window.location.search),te=X.get("error"),pe=X.get("error_description");if(te==="access_denied"&&pe){B(pe),X.delete("error"),X.delete("error_description");const Pe=X.toString()?`${window.location.pathname}?${X.toString()}`:window.location.pathname;window.history.replaceState({},"",Pe)}},[]),o.useEffect(()=>{if(b!=="email_magic_link"||!p)return;q(60),Ie(!1);const X=setInterval(()=>{q(te=>te<=1?(Ie(!0),clearInterval(X),0):te-1)},1e3);return()=>clearInterval(X)},[b,p]),o.useEffect(()=>{var X,te,pe,Pe;if(!n&&(s!=null&&s.active_signin)&&!c&&!U&&!Q){let Ae=gt(e,new URLSearchParams(window.location.search).get("redirect_uri"));Ae||(Ae=((X=e==null?void 0:e.ui_settings)==null?void 0:X.after_signin_redirect_url)||null),!Ae&&(e!=null&&e.frontend_host)&&(Ae=`https://${e.frontend_host}`);const ut=(te=e==null?void 0:e.auth_settings)==null?void 0:te.passkey;(ut==null?void 0:ut.enabled)&&(ut==null?void 0:ut.prompt_registration_on_auth)&&!((Pe=(pe=s.active_signin)==null?void 0:pe.user)!=null&&Pe.has_passkeys)?(Ee(Ae),ue(!0)):Ae&&(D(!0),a(Ae))}},[s,n,c,e,a,U]);const W=X=>{let{name:te,value:pe}=X.target;te==="phone"?pe=pe.replace(/[^0-9]/g,""):te==="email"&&(d(pe),pe=pe.toLowerCase()),T(Pe=>({...Pe,[te]:pe})),S(Pe=>({...Pe,[te]:""}))},G=()=>{T({email:"",username:"",password:"",phone:""}),S({}),L("US"),k("identifier")},K=async X=>{if(!X){S({email:"Email address is required"});return}H(!0),S({});try{const te=await _.identify(X);if(te.strategy==="sso"&&te.connection_id){const pe=new URLSearchParams(window.location.search),Pe=gt(e,pe.get("redirect_uri"))||void 0,Ae=await _.initEnterpriseSso(te.connection_id,Pe);if(Ae&&Ae.sso_url){D(!0),window.location.href=Ae.sso_url;return}}else if(te.strategy==="social"&&te.provider){const pe=w.find(Pe=>Pe.provider===te.provider);if(pe){const Pe=new URLSearchParams(window.location.search),Ae=gt(e,Pe.get("redirect_uri"))||void 0,{data:ut}=await M.create({provider:pe.provider,redirectUri:Ae});if(ut&&typeof ut=="object"&&"oauth_url"in ut){D(!0),window.location.href=ut.oauth_url;return}}else k("password")}else k("password")}catch(te){S({submit:te.message})}finally{U||H(!1)}},V=async X=>{if(X.preventDefault(),N||$)return;y();const te={};if(v==="identifier"&&b==="email_password"){if(!A.email){S({email:"Email address is required"});return}await K(A.email);return}if(v==="identifier"&&b==="username_password"){if(!A.username){S({username:"Username is required"});return}S({}),k("password");return}if(b==="email_password"?(A.email||(te.email="Email address is required"),A.password||(te.password="Password is required")):b==="username_password"?(A.username||(te.username="Username is required"),A.password||(te.password="Password is required")):b==="email_otp"||b==="email_magic_link"?A.email||(te.email="Email address is required"):b==="phone_otp"&&(A.phone?/^\d{7,15}$/.test(A.phone)||(te.phone="Phone number must contain 7-15 digits"):te.phone="Phone number is required"),S(te),Object.keys(te).length>0)return;let pe="";switch(b){case"email_password":pe="plain_email";break;case"username_password":pe="plain_username";break;case"email_otp":pe="email_otp";break;case"email_magic_link":pe="magic_link";break;case"phone_otp":pe="phone_otp";break}const Pe=b==="email_otp"||b==="email_magic_link"||b==="phone_otp";H(!0);try{const Ae={...A,strategy:pe};b==="phone_otp"&&Z&&(Ae.phone_country_code=Z),await _.create(Ae),Pe||H(!1)}catch(Ae){S({submit:Ae.message}),H(!1)}},de=async X=>{if(X.preventDefault(),N||$)return;const te={};if(!R){te.otp="OTP code is required",S(te);return}H(!0),S({});try{await _.completeVerification(R),u(!1),O("")}catch(pe){S({otp:pe.message||"Verification failed"})}finally{H(!1)}},z=async X=>{if(!(N||$)){H(!0);try{const te=new URLSearchParams(window.location.search),pe=gt(e,te.get("redirect_uri"))||void 0,{data:Pe}=await M.create({provider:X.provider,redirectUri:pe});Pe&&typeof Pe=="object"&&"oauth_url"in Pe&&(window.location.href=Pe.oauth_url)}catch(te){S({submit:te.message})}finally{H(!1)}}},le=async()=>{var X;if(!(N||$)){H(!0),S({});try{const te=await F.create();if("data"in te&&te.data){await i();let pe=gt(e,new URLSearchParams(window.location.search).get("redirect_uri"));pe||(pe=((X=e==null?void 0:e.ui_settings)==null?void 0:X.after_signin_redirect_url)||null),!pe&&(e!=null&&e.frontend_host)&&(pe=`https://${e.frontend_host}`),D(!0),pe&&a(pe)}}catch(te){S({submit:te.message||"Passkey sign-in failed"})}finally{H(!1)}}},Je=()=>{var pe;let X=gt(e,new URLSearchParams(window.location.search).get("redirect_uri"));if(X||(X=((pe=e==null?void 0:e.ui_settings)==null?void 0:pe.after_signin_redirect_url)||null),!X&&(e!=null&&e.frontend_host)&&(X=`https://${e.frontend_host}`),!X)return null;let te;try{te=new URL(X)}catch{te=new URL(X,window.location.origin)}return(e==null?void 0:e.mode)==="staging"&&te.searchParams.set("__dev_session__",xt(e.backend_host)||""),te.toString()},ot=async X=>{if(!(N||$)){S({}),H(!0);try{await m(X);const te=Je();te&&(D(!0),a(te))}catch(te){S({submit:te.message||"Failed to continue with selected account"})}finally{H(!1)}}},ge=(X,te)=>`${X||""} ${te||""}`.trim().split(" ").filter(Boolean).map(pe=>pe[0]).join("").toUpperCase().slice(0,2)||"?",lt=o.useRef(!1);if(o.useEffect(()=>{if(n)return;const X=new URLSearchParams(window.location.search),te=X.get("ticket");if(te&&!lt.current&&!N){lt.current=!0,X.delete("ticket");const Pe=X.toString()?`${window.location.pathname}?${X.toString()}`:window.location.pathname;window.history.replaceState({},"",Pe),(async()=>{var ut;try{H(!0),await l(te),D(!0);let It=gt(e,new URLSearchParams(window.location.search).get("redirect_uri"));if(It||(It=((ut=e==null?void 0:e.ui_settings)==null?void 0:ut.after_signin_redirect_url)||null),!It&&(e!=null&&e.frontend_host)&&(It=`https://${e.frontend_host}`),It){let Ns;try{Ns=new URL(It)}catch{Ns=new URL(It,window.location.origin)}(e==null?void 0:e.mode)==="staging"&&Ns.searchParams.set("__dev_session__",xt(e.backend_host)||""),a(Ns.toString())}return}catch(It){S({submit:It.message||"Failed to exchange ticket"}),lt.current=!1}finally{H(!1)}})();return}const pe=X.get("signin_attempt_id");if(pe&&(s!=null&&s.signin_attempts)&&!C){const Pe=s.signin_attempts.find(Ae=>Ae.id===pe);if(Pe){E(Pe),X.delete("signin_attempt_id");const Ae=X.toString()?`${window.location.pathname}?${X.toString()}`:window.location.pathname;window.history.replaceState({},"",Ae)}}},[s,n,C,E,N]),o.useEffect(()=>{var Pe;if(!C)return;if(C.completed){D(!0);let Ae=new URLSearchParams(window.location.search).get("redirect_uri");if(Ae||(Ae=((Pe=e==null?void 0:e.ui_settings)==null?void 0:Pe.after_signin_redirect_url)||null),!Ae&&(e!=null&&e.frontend_host)&&(Ae=`https://${e.frontend_host}`),Ae){let ut;try{ut=new URL(Ae)}catch{ut=new URL(Ae,window.location.origin)}(e==null?void 0:e.mode)==="staging"&&ut.searchParams.set("__dev_session__",xt(e.backend_host)||""),a(ut.toString())}return}if(!_||p)return;const te={verify_email:"email_otp",verify_email_otp:"email_otp",verify_email_link:"magic_link",verify_phone:"phone_otp",verify_phone_otp:"phone_otp"}[C.current_step];if(!te)return;(async()=>{try{await _.prepareVerification({strategy:te}),H(!1),u(!0)}catch{S({submit:"Failed to send verification. Please try again."}),H(!1)}})()},[C,_,p,u,a,e]),g)return t.jsx(wm,{onBack:()=>x(!1)});if(h)return t.jsx(fm,{onBack:()=>f(!1)});if((C==null?void 0:C.current_step)==="verify_second_factor")return t.jsx(Lc,{attempt:C,completeVerification:_.completeVerification,prepareVerification:_.prepareVerification,onBack:()=>{y(),G(),u(!1)}});if((C==null?void 0:C.current_step)==="complete_profile")return t.jsx(Pc,{attempt:C,completeProfile:_.completeProfile,completeVerification:_.completeVerification,prepareVerification:_.prepareVerification,onBack:()=>{y(),G(),u(!1)}});if(Q){const X=()=>{ue(!1),De&&(D(!0),a(De))},te=()=>{ue(!1),De&&(D(!0),a(De))};return t.jsx(Re,{children:t.jsx(et,{children:t.jsx($c,{onComplete:X,onSkip:te})})})}if(n||U)return t.jsx(js,{});const Ke=((ya=e==null?void 0:e.ui_settings)==null?void 0:ya.app_name)||"App",ie=(C==null?void 0:C.current_step)&&["verify_email","verify_email_otp","verify_email_link","verify_phone","verify_phone_otp"].includes(C.current_step)&&p,me=b==="email_magic_link",Ze=c&&!ie&&ce.length>0&&!ae,He=()=>{u(!1),y(),G()};let Ge;if(ie){const X=b==="phone_otp"?"Check your phone":me?"Check your inbox":"Enter the code",te=me?"We sent a magic link to your email — click it to sign in instantly.":b==="phone_otp"?"We sent a verification code via SMS.":"We sent a 6-digit code to your email.",pe=(b==="email_otp"||me)&&A.email?A.email:b==="phone_otp"&&A.phone?`+${A.phone}`:null;Ge=t.jsx(nt,{title:X,sub:te,children:pe&&t.jsxs("button",{type:"button",className:"w-addr-badge",onClick:He,children:[t.jsx(Al,{weight:"bold"}),pe]})})}else Ge=t.jsx(nt,{title:"Sign in to your account",sub:`Please enter your details to continue to ${Ke}.`});let ct;ie?ct=t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx(Et,{className:"w-link",to:((yt=e==null?void 0:e.ui_settings)==null?void 0:yt.support_page_url)||"#",children:"Get help"})]}):ct=t.jsxs("span",{className:"w-auth-foot",children:["Don't have an account?"," ",t.jsx(Et,{className:"w-link",to:`${((aa=e==null?void 0:e.ui_settings)==null?void 0:aa.sign_up_page_url)??""}${window.location.search}`,children:"Sign up"})]});let Rt;if(ie&&me)Rt=t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:16,padding:"12px 0 4px"},children:tt?t.jsx("button",{type:"button",className:"w-link w-linkbtn",onClick:async()=>{Ie(!1),q(60);try{await _.prepareVerification({strategy:"magic_link"})}catch{}},children:"Resend magic link"}):t.jsxs("span",{className:"w-secsub",children:["Resend in ",Me,"s"]})});else if(ie)Rt=t.jsxs("form",{onSubmit:de,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[t.jsx(va,{onComplete:async X=>{if(O(X),X&&X.length===6){H(!0),S({});try{await _.completeVerification(X),u(!1)}catch(te){S({otp:te.message||"Verification failed"})}finally{H(!1)}}},onResend:async()=>{const X=b==="email_otp"?"email_otp":"phone_otp";await _.prepareVerification({strategy:X})},error:P.otp,isSubmitting:$}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:$||N||!R,children:$&&R?t.jsx(vt,{size:15,onAccent:!0}):`Continue to ${Ke}`})]});else{const X=(b==="email_password"||b==="email_otp"||b==="email_magic_link")&&((na=(sa=e==null?void 0:e.auth_settings)==null?void 0:sa.email_address)==null?void 0:na.enabled),te=b==="username_password"&&((oe=(ra=e==null?void 0:e.auth_settings)==null?void 0:ra.username)==null?void 0:oe.enabled),pe=b==="phone_otp"&&((Ne=(xe=e==null?void 0:e.auth_settings)==null?void 0:xe.phone_number)==null?void 0:Ne.enabled),Pe=v==="password"&&(b==="email_password"||b==="username_password")&&((ve=(J=e==null?void 0:e.auth_settings)==null?void 0:J.password)==null?void 0:ve.enabled);Rt=t.jsxs(t.Fragment,{children:[w.length>0&&t.jsx(Nr,{connections:w,callback:z}),((Ve=(Ye=e==null?void 0:e.auth_settings)==null?void 0:Ye.passkey)==null?void 0:Ve.enabled)&&t.jsxs("button",{type:"button",className:"w-social",style:{marginTop:w.length>0?10:0},onClick:le,disabled:$,children:[t.jsx(ar,{}),t.jsx("span",{children:"Sign in with a passkey"})]}),(w.length>0||((_t=(jt=e==null?void 0:e.auth_settings)==null?void 0:jt.passkey)==null?void 0:_t.enabled))&&t.jsx("div",{className:"w-or",children:t.jsx("span",{children:"OR"})}),t.jsxs("form",{onSubmit:V,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:13},children:[X&&t.jsxs("label",{className:"w-field",children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("span",{className:"w-label",children:"Email address"}),v==="identifier"&&t.jsx("span",{className:"w-link w-link--muted w-link--sm",onClick:()=>x(!0),children:"Other methods"})]}),v==="password"&&b==="email_password"&&A.email?t.jsxs("div",{className:"w-locked",children:[t.jsx("span",{className:"w-locked-ic",children:t.jsx(ui,{})}),t.jsx("span",{className:"w-locked-val",children:A.email}),t.jsx("button",{type:"button",className:"w-link w-link--muted",style:{fontSize:12,cursor:"pointer",background:"none",border:0},onClick:()=>k("identifier"),children:"Edit"})]}):t.jsx(qt,{className:"w-input",type:"email",id:"email",name:"email",autoComplete:"email",value:A.email,onChange:W,placeholder:"you@company.com","aria-invalid":!!P.email}),P.email&&t.jsx("span",{className:"w-input-err",children:P.email})]}),te&&t.jsxs("label",{className:"w-field",children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("span",{className:"w-label",children:"Username"}),v==="identifier"&&t.jsx("span",{className:"w-link w-link--muted w-link--sm",onClick:()=>x(!0),children:"Other methods"})]}),v==="password"&&A.username?t.jsxs("div",{className:"w-locked",children:[t.jsx("span",{className:"w-locked-ic",children:t.jsx(ui,{})}),t.jsx("span",{className:"w-locked-val",children:A.username}),t.jsx("button",{type:"button",className:"w-link w-link--muted",style:{fontSize:12,cursor:"pointer",background:"none",border:0},onClick:()=>{k("identifier"),T(Ae=>({...Ae,password:""}))},children:"Edit"})]}):t.jsx(qt,{className:"w-input",type:"text",id:"username",name:"username",value:A.username,onChange:W,placeholder:"yourname","aria-invalid":!!P.username,autoComplete:"username"}),P.username&&t.jsx("span",{className:"w-input-err",children:P.username})]}),pe&&t.jsxs("label",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"Phone number"}),t.jsx(ys,{value:A.phone,onChange:W,error:P.phone,countryCode:Z,setCountryCode:L}),P.phone&&t.jsx("span",{className:"w-input-err",children:P.phone})]}),Pe&&t.jsxs("label",{className:"w-field",children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{className:"w-label",children:"Password"}),t.jsx("span",{className:"w-link w-link--muted",style:{fontSize:12,cursor:"pointer"},onClick:()=>f(!0),children:"Forgot?"})]}),t.jsx(qt,{className:"w-input",type:"password",id:"password",name:"password",autoComplete:"current-password",value:A.password,onChange:W,placeholder:"••••••••","aria-invalid":!!P.password}),P.password&&t.jsx("span",{className:"w-input-err",children:P.password})]}),P.submit&&t.jsx("span",{className:"w-input-err",children:P.submit}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:$||N,children:$?t.jsx(vt,{size:15,onAccent:!0}):t.jsxs(t.Fragment,{children:[v==="identifier"?"Continue":"Sign in",t.jsx(Qt,{weight:"bold"})]})}),v==="password"&&((wt=(Be=e==null?void 0:e.auth_settings)==null?void 0:Be.auth_factors_enabled)==null?void 0:wt.email_otp)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-or",style:{margin:"5px 0"},children:t.jsx("span",{children:"OR"})}),t.jsxs("button",{type:"button",className:"w-method",disabled:$,onClick:async()=>{H(!0),S({});try{await _.create({email:A.email,strategy:"email_otp"}),j("email_otp")}catch(Ae){S({submit:Ae.message}),H(!1)}},children:[t.jsx("span",{className:"w-method-ic",children:t.jsx(xl,{})}),t.jsxs("span",{className:"w-method-body",children:[t.jsx("span",{className:"w-method-title",children:"Sign in with a code"}),t.jsx("span",{className:"w-method-desc",children:"We'll send a 6-digit code to your email"})]}),t.jsx("span",{className:"w-method-go",children:t.jsx(Qt,{})})]})]})]})]})}return t.jsx(Re,{children:t.jsxs(et,{footer:ct,children:[Ge,Y&&t.jsxs("div",{className:"w-banner w-banner--error",style:{marginBottom:18},children:[t.jsx(Fa,{weight:"fill"}),t.jsxs("span",{className:"w-banner-txt",children:[t.jsx("strong",{children:"Access denied."})," ",Y," ",t.jsx("span",{className:"w-link",onClick:()=>B(null),children:"Try again"})]})]}),Ze&&(we?t.jsxs("div",{className:"w-acct-list",children:[t.jsx("div",{className:"w-secsub w-acct-list-head",children:"Choose an account"}),t.jsxs("div",{className:"w-acct-list-body",children:[ce.map(X=>{var te,pe,Pe,Ae;return t.jsxs("button",{type:"button",className:"w-acct",onClick:()=>ot(X.id),disabled:$||N,children:[t.jsx("span",{className:"w-avatar",children:X.user.has_profile_picture?t.jsx("img",{src:X.user.profile_picture_url,alt:((te=X.user.primary_email_address)==null?void 0:te.email)||"account"}):ge(X.user.first_name,X.user.last_name)}),t.jsxs("span",{className:"w-acct-text",children:[t.jsx("span",{className:"w-acct-name",children:X.user.first_name&&X.user.last_name?`${X.user.first_name} ${X.user.last_name}`:X.user.first_name||((Pe=(pe=X.user.primary_email_address)==null?void 0:pe.email)==null?void 0:Pe.split("@")[0])||"Account"}),t.jsx("span",{className:"w-secsub",children:(Ae=X.user.primary_email_address)==null?void 0:Ae.email})]}),t.jsx(Qt,{className:"w-acct-go"})]},X.id)}),t.jsxs("button",{type:"button",className:"w-acct",onClick:()=>{ne(!1),re(!0),G()},children:[t.jsx("span",{className:"w-avatar",style:{background:"var(--wa-surface-subtle)",color:"var(--wa-text-muted)"},children:t.jsx(Hu,{size:16})}),t.jsx("span",{className:"w-acct-text w-acct-name",children:"Use a different account"}),t.jsx(Qt,{className:"w-acct-go"})]})]})]}):t.jsxs("button",{type:"button",className:"w-acct","data-active":!0,style:{marginBottom:18},onClick:()=>ot(ce[0].id),disabled:$||N,children:[t.jsx("span",{className:"w-avatar",children:ce[0].user.has_profile_picture?t.jsx("img",{src:ce[0].user.profile_picture_url,alt:((Bt=ce[0].user.primary_email_address)==null?void 0:Bt.email)||"account"}):ge(ce[0].user.first_name,ce[0].user.last_name)}),t.jsxs("span",{className:"w-acct-text",children:[t.jsxs("span",{className:"w-acct-name",children:["Welcome back,"," ",ce[0].user.first_name||((oa=(ia=ce[0].user.primary_email_address)==null?void 0:ia.email)==null?void 0:oa.split("@")[0])||"back"]}),t.jsx("span",{className:"w-secsub",children:(la=ce[0].user.primary_email_address)==null?void 0:la.email})]}),t.jsx("span",{className:"w-link w-link--muted w-link--sm",style:{flex:"none"},onClick:X=>{X.stopPropagation(),ce.length>1?ne(!0):(re(!0),G())},children:"Not you?"})]})),Rt]})})}function jm(){var b,j,v,k,N,_,C,y,E,M,F,A;const{deployment:e}=ke(),{loading:a,joinWaitlist:s}=No(),[n,i]=o.useState({first_name:"",last_name:"",email:""}),[l,m]=o.useState(!1),[c,d]=o.useState(!1),[p,u]=o.useState(null),h=()=>{if(p)return p.message},f=e==null?void 0:e.auth_settings,g=!!((b=f==null?void 0:f.first_name)!=null&&b.enabled&&((j=f==null?void 0:f.last_name)!=null&&j.enabled)),x=T=>{const{name:P,value:S}=T.target;i($=>({...$,[P]:S}))},w=async T=>{if(T.preventDefault(),!!f){d(!0),u(null);try{(await s(n)).data&&m(!0)}catch(P){u(P)}finally{d(!1)}}};return l?t.jsx(Re,{children:t.jsx(et,{children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:16,textAlign:"center"},children:[t.jsxs("div",{className:"w-success",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(qe,{weight:"bold"})})]}),t.jsx("h1",{className:"w-auth-title",children:"You're on the waitlist"}),t.jsxs("p",{className:"w-auth-sub",children:["Thanks for your interest! We'll notify you at"," ",n.email," when we're ready for you to join."]})]})})}):t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-auth-foot",children:["Need assistance?"," ",t.jsx("a",{href:"/contact",className:"w-link",children:"Get help"})]}),children:[t.jsx(nt,{title:"Join the waitlist",sub:"Be the first to know when we launch!"}),t.jsxs("form",{onSubmit:w,noValidate:!0,style:{display:"flex",flexDirection:"column",gap:16},children:[(((v=f==null?void 0:f.first_name)==null?void 0:v.enabled)||((k=f==null?void 0:f.last_name)==null?void 0:k.enabled))&&t.jsxs("div",{className:g?"w-grid-2":"",children:[((N=f==null?void 0:f.first_name)==null?void 0:N.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"first_name",children:["First name",((_=f==null?void 0:f.first_name)==null?void 0:_.required)&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:"w-input",type:"text",id:"first_name",name:"first_name",required:(C=f==null?void 0:f.first_name)==null?void 0:C.required,minLength:2,maxLength:50,value:n.first_name,onChange:x,placeholder:"First name"})]}),((y=f==null?void 0:f.last_name)==null?void 0:y.enabled)&&t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"last_name",children:["Last name",((E=f==null?void 0:f.last_name)==null?void 0:E.required)&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:"w-input",type:"text",id:"last_name",name:"last_name",required:(M=f==null?void 0:f.last_name)==null?void 0:M.required,minLength:2,maxLength:50,value:n.last_name,onChange:x,placeholder:"Last name"})]})]}),t.jsxs("div",{className:"w-field",children:[t.jsxs("label",{className:"w-label",htmlFor:"email",children:["Email address",((F=f==null?void 0:f.email_address)==null?void 0:F.required)&&t.jsx("span",{className:"w-req",children:"*"})]}),t.jsx("input",{className:"w-input",type:"email",id:"email",name:"email",required:(A=f==null?void 0:f.email_address)==null?void 0:A.required,value:n.email,onChange:x,placeholder:"Enter your email address"})]}),h()&&t.jsx("span",{className:"w-input-err",children:h()}),t.jsx("button",{type:"submit",className:"w-btn w-btn--primary w-btn--block",disabled:c||a,children:c||a?t.jsx(vt,{onAccent:!0}):"Join waitlist"})]})]})})}function On({title:e,sub:a,icon:s,message:n,action:i,footer:l}){return t.jsx(Re,{children:t.jsxs(et,{footer:l,children:[t.jsx(nt,{title:e,sub:a}),t.jsxs("div",{className:"w-auth-status",children:[s,t.jsx("p",{className:"w-auth-sub",children:n}),i]})]})})}function _m(){const{deployment:e}=ke(),{navigate:a}=kt(),{error:s,session:n,processed:i,signinAttempt:l,redirectUri:m,loading:c}=So(),[d,p]=o.useState(!1),[u,h]=o.useState(null),f=()=>{window.location.reload()},g=()=>{var j;const b=((j=e==null?void 0:e.ui_settings)==null?void 0:j.sign_in_page_url)||"/sign-in";a(b)},x=()=>{p(!1),u&&a(u)},w=()=>{p(!1),u&&a(u)};if(o.useEffect(()=>{var b,j,v,k,N;if(!(!i||c||d)){if(l&&!l.completed){const _=(b=e==null?void 0:e.ui_settings)==null?void 0:b.sign_in_page_url;if(_){const C=new URL(_,window.location.origin);C.searchParams.set("signin_attempt_id",l.id),m&&C.searchParams.set("redirect_uri",m),a(C.toString())}return}if(l!=null&&l.completed){const C=gt(e,m)||((j=e==null?void 0:e.ui_settings)==null?void 0:j.after_signin_redirect_url)||(e==null?void 0:e.frontend_host)||"/";let y;try{y=new URL(C)}catch{y=new URL(C,window.location.origin)}if(y){(e==null?void 0:e.mode)==="staging"&&y.searchParams.set("__dev_session__",xt(e.backend_host)||"");const E=(v=e==null?void 0:e.auth_settings)==null?void 0:v.passkey;(E==null?void 0:E.enabled)&&(E==null?void 0:E.prompt_registration_on_auth)&&!((N=(k=n==null?void 0:n.active_signin)==null?void 0:k.user)!=null&&N.has_passkeys)?(h(y.toString()),p(!0)):a(y.toString())}}}},[n,i,c,m,e,l,a]),o.useEffect(()=>{s&&s.message.includes("No OAuth callback data found")&&setTimeout(()=>{var j;const b=((j=e==null?void 0:e.ui_settings)==null?void 0:j.sign_in_page_url)||(e==null?void 0:e.frontend_host);b&&a(b)},2e3)},[s,e,a]),d)return t.jsx(Re,{children:t.jsx(et,{children:t.jsx($c,{onComplete:x,onSkip:w})})});if(n&&i&&!s)return t.jsx(On,{title:"Success",sub:"Authentication completed successfully",icon:t.jsxs("div",{className:"w-success",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(qe,{weight:"bold"})})]}),message:"You'll be redirected to your destination shortly."});if(s){const b=s.message.includes("No OAuth callback data found");return t.jsx(On,{title:"Something went wrong",sub:"We couldn't complete your sign in",icon:t.jsxs("div",{className:"w-success w-success--error",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(La,{weight:"bold"})})]}),message:s.message||"An unexpected error occurred during authentication.",action:b?void 0:t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:f,children:"Try again"}),footer:b?void 0:t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx("button",{type:"button",className:"w-link",onClick:g,children:"Return to sign in"})]})})}return t.jsx(On,{title:"Completing sign in",sub:"Please wait while we authenticate you",icon:t.jsx(vt,{size:32}),message:"Verifying your credentials… this will only take a moment."})}function km({onSuccess:e,onError:a}={}){const[s,n]=o.useState("loading"),[i,l]=o.useState(""),{token:m,attempt:c,redirectUri:d}=W1(),{verifyMagicLink:p}=Eo(),{navigate:u}=kt(),{deployment:h}=ke(),f=o.useRef(!1);o.useEffect(()=>{(async()=>{if(!f.current){if(!m||!c){n("error"),l("The magic link appears to be malformed. Please try signing in again."),a==null||a("Invalid magic link parameters");return}f.current=!0,n("loading"),l("Please wait while we verify your magic link.");try{await p({token:m,attempt:c,redirectUri:d}),n("success"),l("You will be redirected to your account shortly."),e==null||e(),setTimeout(()=>{var b;let w=gt(h,d);if(w||(w=(b=h==null?void 0:h.ui_settings)==null?void 0:b.after_signin_redirect_url),!w&&(h!=null&&h.frontend_host)&&(w=`https://${h.frontend_host}`),w){const j=new URL(w);(h==null?void 0:h.mode)==="staging"&&j.searchParams.set("__dev_session__",xt(h.backend_host)||""),u(j.toString())}},2e3)}catch(w){n("error"),l("The magic link may have expired or already been used. Please try signing in again."),a==null||a(w.message)}}})()},[m,c]);const g=()=>{var x;(x=h==null?void 0:h.ui_settings)!=null&&x.sign_in_page_url&&u(h.ui_settings.sign_in_page_url)};return t.jsx(Re,{children:t.jsxs(et,{children:[t.jsx(nt,{title:"Magic link",sub:"Verifying your magic link"}),t.jsxs("div",{className:"w-auth-status",children:[s==="loading"&&t.jsx(vt,{size:32}),s==="success"&&t.jsxs("div",{className:"w-success",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(qe,{weight:"bold"})})]}),s==="error"&&t.jsxs("div",{className:"w-success w-success--error",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(La,{weight:"bold"})})]}),t.jsx("p",{className:"w-auth-sub",children:i}),s==="error"&&t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:g,children:"Try again"})]})]})})}function Cm(e){var n,i;return e?((n=e.signin_attempts)==null?void 0:n.find(l=>l.requires_completion&&!l.completed))?!0:!!((i=e.signup_attempts)==null?void 0:i.find(l=>{var m,c;return((m=l.missing_fields)==null?void 0:m.length)>0||((c=l.remaining_steps)==null?void 0:c.length)>0&&!l.completed})):!1}function Nm(e){const a=e?`/profile-completion?redirect_uri=${encodeURIComponent(e)}`:"/profile-completion";window.location.href=a}function ns({kind:e}){const a=e==="success"?"w-success":e==="error"?"w-success w-success--error":"w-success w-success--info",s=e==="success"?qe:e==="error"?La:Au;return t.jsxs("div",{className:a,children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(s,{weight:"bold"})})]})}function _a({title:e,sub:a,icon:s,message:n,action:i,footer:l}){return t.jsx(Re,{children:t.jsxs(et,{footer:l,children:[t.jsx(nt,{title:e,sub:a}),t.jsxs("div",{className:"w-auth-status",children:[s,t.jsx("p",{className:"w-auth-sub",children:n}),i]})]})})}function Sm({token:e,onSuccess:a,onError:s}){var b;const{acceptInvitation:n,invitationData:i,loading:l,error:m}=Ho(),{navigate:c}=kt(),{deployment:d}=ke(),p=o.useRef(!1),u=()=>{var v;const j=new URLSearchParams(window.location.search);return{token:e||j.get("invite_token")||j.get("token"),redirectUri:gt(d,j.get("redirect_uri"))||((v=d==null?void 0:d.ui_settings)==null?void 0:v.after_signin_redirect_url)||"/"}};o.useEffect(()=>{if(p.current)return;const{token:j}=u();j&&(p.current=!0,n(j))},[n]),o.useEffect(()=>{var j;i&&(i.organization&&!i.requires_signin&&a&&a(i.organization.id,(j=i.workspace)==null?void 0:j.id),i.error_code&&s&&s(i.message||"Failed to accept invitation"))},[i,a,s]);const h=()=>{const{redirectUri:j}=u();c(j)},f=()=>{var E,M;const{token:j}=u(),v=((E=d==null?void 0:d.ui_settings)==null?void 0:E.sign_in_page_url)||"/sign-in",k=((M=d==null?void 0:d.ui_settings)==null?void 0:M.sign_up_page_url)||"/sign-up",N=new URLSearchParams;j&&N.set("invite_token",j),i!=null&&i.invited_email&&N.set("invited_email",i.invited_email);const C=`${window.location.pathname}?token=${j}`;N.set("redirect_uri",C),i!=null&&i.message&&N.set("message",i.message);const y=(i==null?void 0:i.error_code)==="INVITATION_REQUIRES_SIGNUP";c(`${y?k:v}?${N.toString()}`)},g=()=>{const{token:j}=u();j&&(p.current=!1,n(j))},x=(j,v)=>t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:v,children:j}),{token:w}=u();if(!w&&!l)return t.jsx(_a,{title:"Invalid invitation",sub:"No invitation token found",icon:t.jsx(ns,{kind:"error"}),message:"The invitation link appears to be invalid or incomplete.",action:x("Go to home",()=>c("/"))});if(l)return t.jsx(_a,{title:"Processing invitation",sub:"Please wait while we verify your invitation",icon:t.jsx(vt,{size:32}),message:"Verifying invitation… this will only take a moment."});if(i!=null&&i.organization&&!i.requires_signin)return t.jsx(_a,{title:"Invitation accepted",sub:"You've successfully joined the organization",icon:t.jsx(ns,{kind:"success"}),message:t.jsxs(t.Fragment,{children:["Welcome to"," ",t.jsx("strong",{children:i.organization.name}),i.workspace?`. You've been added to the ${i.workspace.name} workspace.`:"."]}),action:x("Continue to application",h)});if(i!=null&&i.already_member)return t.jsx(_a,{title:"Already a member",sub:"You're already part of this organization",icon:t.jsx(ns,{kind:"info"}),message:`You're already a member of ${((b=i.organization)==null?void 0:b.name)||"this organization"}. No action needed.`,action:x("Continue to application",h)});if(i!=null&&i.requires_signin){const j=i.error_code==="INVITATION_REQUIRES_SIGNUP";return t.jsx(_a,{title:j?"Sign up required":"Sign in required",sub:"To accept this invitation",icon:t.jsx(ns,{kind:"info"}),message:t.jsxs(t.Fragment,{children:["This invitation is for"," ",t.jsx("strong",{className:"w-text-primary",children:i.invited_email}),"."," ",j?"Create an account with this email address to accept it.":i.error_code==="INVITATION_EMAIL_MISMATCH"?"You're signed in with a different account. Please sign in with the invited email.":"Please sign in to accept this invitation."]}),action:x(j?"Sign up to accept":"Sign in to accept",f)})}return(i==null?void 0:i.error_code)==="INVITATION_EXPIRED"?t.jsx(_a,{title:"Invitation expired",sub:"This invitation is no longer valid",icon:t.jsxs("div",{className:"w-success w-success--error",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(Cu,{weight:"bold"})})]}),message:t.jsxs(t.Fragment,{children:["Invitation for"," ",t.jsx("strong",{className:"w-text-primary",children:i.invited_email})," ","has expired. Invitations are valid for 10 days — please request a new one from your organization administrator."]})}):m||i!=null&&i.error_code?t.jsx(_a,{title:"Invitation error",sub:"Unable to process invitation",icon:t.jsx(ns,{kind:"error"}),message:(i==null?void 0:i.message)||m||"Failed to accept invitation",action:x("Try again",g),footer:t.jsxs("span",{className:"w-auth-foot",children:["Having trouble?"," ",t.jsx("button",{type:"button",className:"w-link",onClick:f,children:"Sign in manually"})]})}):null}const Oc=o.createContext(void 0),Zc=()=>{const e=o.useContext(Oc);if(!e)throw new Error("Dialog components must be used within a Dialog");return e},Em=({isOpen:e,onClose:a,children:s})=>{const[n,i]=o.useState(!1),l=ts();return o.useEffect(()=>{i(!0);const m=c=>{c.key==="Escape"&&e&&(a==null||a())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e,a]),!e||!n?null:en.createPortal(t.jsx("div",{className:"wacht-root",style:l,children:t.jsx(Oc.Provider,{value:{isOpen:e,onClose:a},children:s})}),document.body)},Am=({children:e})=>{const{onClose:a}=Zc(),s=o.useRef(null),n=i=>{s.current&&!s.current.contains(i.target)&&(a==null||a())};return t.jsx("div",{className:"w-modal",onClick:n,children:t.jsx("div",{ref:s,style:{maxWidth:"100%",minWidth:0},children:e})})},Mm=({children:e,style:a,className:s})=>t.jsx("div",{className:`w-dialog${s?` ${s}`:""}`,style:{maxHeight:"90vh",overflowY:"auto",...a},children:e}),Rm=({children:e,showCloseButton:a=!0})=>{const{onClose:s}=Zc();return t.jsxs("div",{className:"w-dialog-head",children:[typeof e=="string"?t.jsx("h2",{className:"w-dialog-title",children:e}):e,a&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:s,children:t.jsx(La,{size:18})})]})},Lm=({children:e,style:a,className:s})=>t.jsx("div",{className:`w-dialog-body${s?` ${s}`:""}`,style:a,children:e}),Pm=({children:e})=>t.jsx("div",{className:"w-dialog-foot",children:e}),ze=Object.assign(Em,{Overlay:Am,Content:Mm,Header:Rm,Body:Lm,Footer:Pm}),$m=({isOpen:e,onClose:a,title:s,children:n,showCloseButton:i=!0})=>t.jsx(ze,{isOpen:e,onClose:a,children:t.jsx(ze.Overlay,{children:t.jsxs(ze.Content,{children:[s&&t.jsx(ze.Header,{showCloseButton:i,children:s}),t.jsx(ze.Body,{children:n})]})})}),Om=({trigger:e,renderDialog:a})=>{const[s,n]=o.useState(!1),i=()=>n(!0),l=()=>n(!1);return t.jsxs(t.Fragment,{children:[e({onClick:i}),a({isOpen:s,onClose:l})]})},Hc=o.createContext(void 0),Fc=()=>{const e=o.useContext(Hc);if(!e)throw new Error("useDropdownContext must be used within a DropdownProvider");return e},_s=({children:e,open:a,openChange:s,style:n})=>{const i=o.useRef(null),[l,m]=o.useState(!1);return o.useEffect(()=>{const c=d=>{i.current&&!i.current.contains(d.target)&&m(!1)};return l&&document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[l,s]),o.useEffect(()=>{s==null||s(l)},[l]),o.useEffect(()=>{m(!!a)},[a]),t.jsx(Hc.Provider,{value:{open:l,openChange:c=>m(c)},children:t.jsx("div",{style:{width:"fit-content",...n},ref:i,children:e})})},ks=({children:e,style:a,className:s})=>{const{open:n}=Fc(),[i,l]=o.useState({top:0,left:0}),[m,c]=o.useState(!1),d=o.useRef(null);return o.useEffect(()=>{n&&d.current?(c(!1),requestAnimationFrame(()=>{var h,f;const p=(h=d.current)==null?void 0:h.parentElement;if(!p)return;const u=p.querySelector("[data-dropdown-trigger]")||p.firstElementChild;if(u&&u!==d.current){const g=u.getBoundingClientRect(),x=(f=d.current)==null?void 0:f.getBoundingClientRect(),w=window.innerWidth,b=window.innerHeight;let j=g.bottom+4,v=g.right-((x==null?void 0:x.width)||200);v<8&&(v=g.left),v+((x==null?void 0:x.width)||200)>w-8&&(v=w-((x==null?void 0:x.width)||200)-8),x&&j+x.height>b-8&&(j=g.top-(x.height+4)),l({top:j,left:v}),c(!0)}})):c(!1)},[n]),n?t.jsx("div",{className:s?`w-menu ${s}`:"w-menu",ref:d,style:{position:"fixed",zIndex:1e3,width:"max-content",minWidth:140,maxWidth:240,...a,top:`${i.top}px`,left:`${i.left}px`,visibility:m?"visible":"hidden",opacity:m?1:0,transition:m?"opacity 0.15s ease-in-out":"none"},children:e}):null},Cs=({children:e})=>{const{openChange:a,open:s}=Fc(),n=o.useCallback(()=>{a(!s)},[s,a]);return t.jsx("div",{style:{position:"relative",display:"inline-flex"},onClick:n,"data-dropdown-trigger":!0,children:e})},ea=o.forwardRef(({$destructive:e,className:a,...s},n)=>t.jsx("button",{ref:n,className:`w-menu-item${e?" w-menu-item--danger":""}${a?` ${a}`:""}`,...s}));ea.displayName="DropdownItem";const Tc=()=>t.jsx("div",{style:{height:"0.5px",background:"var(--wa-border)",width:"100%",margin:"4px 0"}}),Ic=o.forwardRef(({className:e,style:a,...s},n)=>t.jsx("form",{ref:n,className:e,style:{display:"flex",flexDirection:"column",gap:16,...a},...s}));Ic.displayName="Form";const We=o.forwardRef(({className:e,...a},s)=>t.jsx("div",{ref:s,className:`w-field${e?` ${e}`:""}`,...a}));We.displayName="FormGroup";const Te=o.forwardRef(({className:e,...a},s)=>t.jsx("label",{ref:s,className:`w-label${e?` ${e}`:""}`,...a}));Te.displayName="Label";const be=o.forwardRef(({as:e="input",className:a,...s},n)=>{const i=`w-input${a?` ${a}`:""}`;return e==="textarea"?t.jsx("textarea",{className:i,...s}):t.jsx("input",{ref:n,className:i,...s})});be.displayName="Input";const je=({size:e,className:a})=>t.jsx("div",{className:a,style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:e?`${e}px`:"100%"},children:t.jsx("span",{className:"w-spin",style:{width:e??40,height:e??40}})}),Za=({checked:e,onChange:a})=>t.jsxs("label",{className:"w-switch","data-on":e?"":void 0,children:[t.jsx("input",{type:"checkbox",checked:e,onChange:s=>a(s.target.checked),style:{position:"absolute",opacity:0,width:0,height:0}}),t.jsx("span",{className:"w-switch-track",children:t.jsx("span",{className:"w-switch-knob"})})]}),Kt=(e=!1)=>{const[a,s]=o.useState(e),n=o.useCallback(()=>{s(!0)},[]),i=o.useCallback(()=>{s(!1)},[]),l=o.useCallback(()=>{s(m=>!m)},[]);return{isOpen:a,open:n,close:i,toggle:l}},Vc=({onChange:e,placeholder:a,value:s})=>t.jsxs("div",{className:"w-search",children:[t.jsx(Cl,{}),t.jsx("input",{type:"text",placeholder:a,value:s,onChange:n=>e(n.target.value)})]}),se=o.forwardRef(({$primary:e,$outline:a,$destructive:s,$fullWidth:n,$size:i,className:l,style:m,...c},d)=>{const h=`w-btn ${s?"w-btn--danger-solid":a?"w-btn--secondary":"w-btn--primary"}${i==="sm"?" w-btn--sm":i==="lg"?" w-btn--lg":""}${l?` ${l}`:""}`;return t.jsx("button",{ref:d,className:h,style:n?{width:"100%",...m}:m,...c})});se.displayName="Button";const zc=e=>({position:"absolute",top:"calc(100% + 6px)",left:0,width:"100%",maxHeight:260,overflowY:"auto",zIndex:1e3,opacity:e?1:0,transform:e?"scale(1)":"scale(0.97)",transformOrigin:"top",pointerEvents:e?"auto":"none",transition:"opacity 0.15s ease, transform 0.15s ease"}),Dc={width:"100%",height:32,padding:"0 9px",border:"none",borderBottom:"0.5px solid var(--wa-border)",borderRadius:0,fontFamily:"var(--wa-font-sans)",fontSize:13,outline:"none",background:"transparent",color:"var(--wa-text)",marginBottom:4},Qs=({children:e})=>t.jsx("div",{style:{padding:"10px 9px",color:"var(--wa-text-faint)",fontFamily:"var(--wa-font-sans)",fontSize:12.5,textAlign:"center"},children:e}),un=({options:e,value:a,onChange:s,placeholder:n="Select an option",disabled:i=!1,searchable:l=!1,width:m,name:c,id:d,groupsEnabled:p=!1,className:u})=>{const[h,f]=o.useState(!1),[g,x]=o.useState(""),w=o.useRef(null),b=o.useRef(null),j=p&&"options"in e[0],k=(j?e.flatMap(y=>y.options):e).find(y=>y.value===a),N=g?j?e.map(y=>({...y,options:y.options.filter(E=>E.label.toLowerCase().includes(g.toLowerCase()))})).filter(y=>y.options.length>0):e.filter(y=>y.label.toLowerCase().includes(g.toLowerCase())):e,_=(y,E=!1)=>{E||(s(y),f(!1),x(""))},C=()=>{i||f(!h)};return o.useEffect(()=>{h&&l&&b.current&&setTimeout(()=>{var y;(y=b.current)==null||y.focus()},10)},[h,l]),o.useEffect(()=>{const y=E=>{w.current&&!w.current.contains(E.target)&&(f(!1),x(""))};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),t.jsxs("div",{ref:w,style:{position:"relative",width:m||"100%"},className:u,children:[t.jsxs("button",{type:"button",className:"w-combo","data-open":h?"":void 0,onClick:C,disabled:i,"aria-haspopup":"listbox","aria-expanded":h,id:d,children:[t.jsx("span",{className:"w-combo-val","data-ph":k?void 0:"",children:k?k.label:n}),h?t.jsx(Jo,{size:16}):t.jsx(Ut,{size:16})]}),t.jsxs("div",{className:"w-combo-menu",style:zc(h),role:"listbox",children:[l&&t.jsx("input",{ref:b,type:"text",style:Dc,placeholder:"Search...",value:g,onChange:y=>x(y.target.value),onClick:y=>y.stopPropagation()}),j?N.map((y,E)=>t.jsxs(o.Fragment,{children:[t.jsx("div",{className:"w-combo-grp",children:y.label}),y.options.length===0?t.jsx(Qs,{children:"No options available"}):y.options.map(M=>t.jsxs("button",{type:"button",className:"w-combo-opt","data-disabled":M.disabled?"":void 0,onClick:()=>_(M.value,M.disabled),role:"option","aria-selected":M.value===a,children:[M.label,M.value===a&&t.jsx("span",{className:"w-combo-check",children:t.jsx(qe,{size:16})})]},M.value))]},`group-${E}`)):t.jsx(t.Fragment,{children:N.length===0?t.jsx(Qs,{children:"No options available"}):N.map(y=>t.jsxs("button",{type:"button",className:"w-combo-opt","data-disabled":y.disabled?"":void 0,onClick:()=>_(y.value,y.disabled),role:"option","aria-selected":y.value===a,children:[y.label,y.value===a&&t.jsx("span",{className:"w-combo-check",children:t.jsx(qe,{size:16})})]},y.value))})]}),c&&t.jsx("input",{type:"hidden",name:c,value:a||""})]})},Uc=({options:e,value:a,onChange:s,placeholder:n="Select options",disabled:i=!1,searchable:l=!1,width:m,name:c,id:d,groupsEnabled:p=!1,className:u})=>{const[h,f]=o.useState(!1),[g,x]=o.useState(""),w=o.useRef(null),b=o.useRef(null),j=p&&"options"in e[0],k=(j?e.flatMap(y=>y.options):e).filter(y=>a.includes(y.value)),N=g?j?e.map(y=>({...y,options:y.options.filter(E=>E.label.toLowerCase().includes(g.toLowerCase()))})).filter(y=>y.options.length>0):e.filter(y=>y.label.toLowerCase().includes(g.toLowerCase())):e,_=(y,E=!1)=>{E||(a.includes(y)?s(a.filter(M=>M!==y)):s([...a,y]))},C=()=>{i||f(!h)};return o.useEffect(()=>{h&&l&&b.current&&setTimeout(()=>{var y;(y=b.current)==null||y.focus()},10)},[h,l]),o.useEffect(()=>{const y=E=>{w.current&&!w.current.contains(E.target)&&(f(!1),x(""))};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),t.jsxs("div",{ref:w,style:{position:"relative",width:m||"100%"},className:u,children:[t.jsxs("button",{type:"button",className:"w-combo","data-open":h?"":void 0,onClick:C,disabled:i,"aria-haspopup":"listbox","aria-expanded":h,id:d,children:[t.jsx("span",{className:"w-combo-val","data-ph":k.length>0?void 0:"",children:k.length>0?k.map(y=>y.label).join(", "):n}),h?t.jsx(Jo,{size:16}):t.jsx(Ut,{size:16})]}),t.jsxs("div",{className:"w-combo-menu",style:zc(h),role:"listbox",children:[l&&t.jsx("input",{ref:b,type:"text",style:Dc,placeholder:"Search...",value:g,onChange:y=>x(y.target.value),onClick:y=>y.stopPropagation()}),j?N.map((y,E)=>t.jsxs(o.Fragment,{children:[t.jsx("div",{className:"w-combo-grp",children:y.label}),y.options.length===0?t.jsx(Qs,{children:"No options available"}):y.options.map(M=>t.jsxs("button",{type:"button",className:"w-combo-opt","data-disabled":M.disabled?"":void 0,onClick:()=>_(M.value,M.disabled),role:"option","aria-selected":a.includes(M.value),children:[M.label,a.includes(M.value)&&t.jsx("span",{className:"w-combo-check",children:t.jsx(qe,{size:16})})]},M.value))]},`group-${E}`)):t.jsx(t.Fragment,{children:N.length===0?t.jsx(Qs,{children:"No options available"}):N.map(y=>t.jsxs("button",{type:"button",className:"w-combo-opt","data-disabled":y.disabled?"":void 0,onClick:()=>_(y.value,y.disabled),role:"option","aria-selected":a.includes(y.value),children:[y.label,a.includes(y.value)&&t.jsx("span",{className:"w-combo-check",children:t.jsx(qe,{size:16})})]},y.value))})]}),c&&t.jsx("input",{type:"hidden",name:c,value:a.join(",")})]})},Os=e=>e.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2)||"?",Ei=e=>e.trim().replace(/[<>"'&]/g,""),Zm=e=>e.length>=2&&e.length<=100&&/^[a-zA-Z0-9\s_.-]+$/.test(e),Hm=e=>/.+@.+\..+/.test(e),Ai=(e,a)=>e.length?e.find(s=>s.name===a)||e[0]:null,Fm=({roles:e,value:a,onChange:s,fullWidth:n})=>{const[i,l]=o.useState(!1),m=o.useRef(null);return o.useEffect(()=>{if(!i)return;const c=d=>{m.current&&!m.current.contains(d.target)&&l(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),t.jsxs("div",{ref:m,className:`w-relative${n?" w-full":" w-none"}`,children:[t.jsxs("button",{type:"button",className:`w-combo${n?" w-full":" w-rolepick-btn"}`,"data-open":i?"":void 0,onClick:()=>l(c=>!c),disabled:!e.length,children:[t.jsx("span",{className:"w-combo-val",children:(a==null?void 0:a.name)||"Role"}),t.jsx(Ut,{size:14})]}),i&&t.jsx("div",{className:"w-combo-menu w-combo-menu--pop",children:e.map(c=>t.jsxs("button",{type:"button",className:"w-combo-opt",onClick:()=>{s(c),l(!1)},children:[c.name,c.id===(a==null?void 0:a.id)&&t.jsx("span",{className:"w-combo-check",children:t.jsx(qe,{size:13})})]},c.id))})]})},Wc=({mode:e,organizationId:a,onSuccess:s,onCancel:n,onCreateOrganization:i})=>{var ce;const l=e==="org",m=l?"organization":"workspace",c=l?"Organization":"Workspace",{createOrganization:d,getOrganizationRoles:p,inviteOrganizationMember:u}=zt(),{createWorkspace:h,getWorkspaceRoles:f,createWorkspaceInvitation:g}=ga(),{organizationMemberships:x}=wa(),{refetch:w}=it(),[b,j]=o.useState(0),[v,k]=o.useState(""),[N,_]=o.useState(""),[C,y]=o.useState(),[E,M]=o.useState(null),[F,A]=o.useState(!1),[T,P]=o.useState(null),[S,$]=o.useState(a),[H,R]=o.useState(!1),O=o.useRef(null),Z=o.useRef(null),[L,U]=o.useState(null),[D,Y]=o.useState([]),[B,Q]=o.useState([]),[ue,we]=o.useState(""),[ne,ae]=o.useState(null),re=(ce=x==null?void 0:x.find(W=>W.organization.id===S))==null?void 0:ce.organization;o.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),o.useEffect(()=>{if(!H)return;const W=G=>{O.current&&!O.current.contains(G.target)&&R(!1)};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[H]);const Me=W=>{var K;const G=(K=W.target.files)==null?void 0:K[0];if(G){if(G.size>2*1024*1024){P("Image must be under 2 MB.");return}if(!G.type.startsWith("image/")){P("Please choose a valid image file.");return}E&&URL.revokeObjectURL(E),P(null),y(G),M(URL.createObjectURL(G))}},q=async()=>{var K;const W=Ei(v),G=Ei(N);if(!Zm(W)){P(`Enter a valid ${m} name (2–100 characters).`);return}if(!l&&!S){P("Select an organization first.");return}A(!0),P(null);try{if(l){const V=await d({name:W,description:G,image:C}),de=((K=V==null?void 0:V.data)==null?void 0:K.organization)??(V==null?void 0:V.organization)??V;U(de);const z=await p(de).catch(()=>[]);Y(z),ae(Ai(z,"Member"))}else{const V=await h(S,W,C,G),de=(V==null?void 0:V.workspace)??V,z={...de,organization:{id:S}};U(z);const le=await f(de).catch(()=>[]);Y(le),ae(Ai(le,"Editor"))}await w(),j(1)}catch(V){P((V==null?void 0:V.message)||`Failed to create ${m}.`)}finally{A(!1)}},tt=()=>{const W=ue.trim();!Hm(W)||B.some(G=>G.email===W)||ne&&(Q(G=>[...G,{email:W,roleId:ne.id,roleName:ne.name}]),we(""))},Ie=W=>{(W.key==="Enter"||W.key===",")&&(W.preventDefault(),tt())},De=async()=>{if(!B.length){j(2);return}A(!0),P(null);try{for(const W of B)l?await u(L,{email:W.email,organizationRole:{id:W.roleId}}):await g(L,W.email,W.roleId);j(2)}catch(W){P((W==null?void 0:W.message)||"Some invitations could not be sent.")}finally{A(!1)}},Ee=()=>{j(0),k(""),_(""),y(void 0),E&&URL.revokeObjectURL(E),M(null),U(null),Y([]),Q([]),we(""),P(null)};return t.jsxs("div",{className:"w-card w-create-card",children:[t.jsxs("div",{className:"w-create-body",children:[t.jsxs("div",{className:"w-flex-col w-items-center w-gap-3 w-create-head",children:[b===0?t.jsxs("span",{className:"w-ibadge-wrap",children:[t.jsxs("button",{type:"button",className:"w-ibadge w-avatar-edit","data-busy":F?"":void 0,onClick:()=>{var W;return(W=Z.current)==null?void 0:W.click()},title:`Upload ${m} logo`,"aria-label":`Upload ${m} logo`,children:[E?t.jsx("img",{src:E,alt:`${c} logo`}):l?t.jsx(ps,{}):t.jsx(di,{}),t.jsx("span",{className:"w-avatar-veil",children:t.jsx(sn,{})})]}),t.jsx("input",{ref:Z,type:"file",className:"w-none",hidden:!0,accept:"image/png, image/jpeg, image/gif, image/svg+xml",onChange:Me,disabled:F}),E&&t.jsx("button",{type:"button",className:"w-ibadge-x",title:"Remove logo","aria-label":"Remove logo",onClick:()=>{E&&URL.revokeObjectURL(E),M(null),y(void 0)},children:t.jsx(La,{})})]}):t.jsx("span",{className:`w-ibadge${b===2?" w-ibadge--done":""}`,children:b===2?t.jsx(qe,{}):l?t.jsx(ps,{}):t.jsx(di,{})}),t.jsxs("div",{className:"w-flex-col w-gap-1 w-text-center",children:[t.jsx("h1",{className:"w-title-lg",children:b===0?`Create ${l?"an":"a"} ${m}`:b===1?"Invite your team":`${c} created`}),t.jsx("p",{className:"w-sub",children:b===0?`Set up a new ${m}${l?" to collaborate with your team.":" inside your organization."}`:b===1?"Add people now, or skip and do it later.":`${v} is ready to go.`})]})]}),b<2&&t.jsxs("div",{className:"w-steps w-create-steps",children:[t.jsx("i",{"data-on":""}),t.jsx("i",{"data-on":b>=1?"":void 0})]}),T&&t.jsx("div",{className:"w-banner w-banner--error w-mb-4",children:T}),b===0&&t.jsxs("div",{className:"w-flex-col w-gap-4",children:[!l&&t.jsxs("label",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"Organization"}),t.jsxs("div",{className:"w-relative",ref:O,children:[t.jsxs("button",{type:"button",className:"w-combo w-full","data-open":H?"":void 0,onClick:()=>R(W=>!W),disabled:F,children:[t.jsxs("span",{className:"w-combo-val w-inline w-gap-2",children:[t.jsx("span",{className:"w-avatar w-avatar--sm",children:re!=null&&re.image_url?t.jsx("img",{src:re.image_url,alt:re.name}):Os((re==null?void 0:re.name)||"O").charAt(0)}),t.jsx("span",{children:(re==null?void 0:re.name)||"Select organization"})]}),t.jsx(Ut,{size:14})]}),H&&t.jsxs("div",{className:"w-combo-menu w-combo-menu--pop",children:[x==null?void 0:x.map(W=>{var K;const G=!!((K=W.eligibility_restriction)!=null&&K.type)&&W.eligibility_restriction.type!=="none";return t.jsxs("button",{type:"button",className:"w-combo-opt",disabled:G,"data-disabled":G?"":void 0,onClick:()=>{G||($(W.organization.id),R(!1))},children:[t.jsx("span",{className:"w-avatar w-avatar--sm",children:W.organization.image_url?t.jsx("img",{src:W.organization.image_url,alt:W.organization.name}):Os(W.organization.name).charAt(0)}),t.jsx("span",{children:W.organization.name})]},W.organization.id)}),i&&t.jsxs("button",{type:"button",className:"w-combo-opt w-text-primary",onClick:()=>{R(!1),i()},children:[t.jsx(St,{size:13}),"Create new organization"]})]})]})]}),t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:[c," name"]}),t.jsx(be,{autoFocus:!0,value:v,onChange:W=>k(W.target.value),placeholder:l?"Acme Inc":"Product",disabled:F})]}),t.jsxs("label",{className:"w-field",children:[t.jsxs("span",{className:"w-label",children:["Description"," ",t.jsx("span",{className:"w-secsub",children:"· optional"})]}),t.jsx(be,{as:"textarea",className:"w-input--area",value:N,onChange:W=>_(W.target.value),placeholder:l?"What does your team do?":"What's this workspace for?",disabled:F})]}),t.jsxs("div",{className:"w-flex-col w-gap-2",children:[t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:q,disabled:F||!v.trim(),children:F?t.jsx(je,{size:15}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(Qt,{size:15})]})}),n&&t.jsx("button",{type:"button",className:"w-btn w-btn--secondary w-btn--block",onClick:n,disabled:F,children:"Cancel"})]})]}),b===1&&t.jsxs("div",{className:"w-flex-col w-gap-4",children:[t.jsxs("div",{className:"w-field",children:[t.jsx("span",{className:"w-label",children:"Invite by email"}),t.jsxs("div",{className:"w-flex w-gap-2",children:[t.jsx(be,{autoFocus:!0,className:"w-grow",value:ue,onChange:W=>we(W.target.value),onKeyDown:Ie,placeholder:"teammate@acme.com"}),t.jsx(Fm,{roles:D,value:ne,onChange:ae})]}),t.jsx("span",{className:"w-secsub",children:"Press Enter to add each person."})]}),B.length>0&&t.jsx("div",{className:"w-list",children:B.map(W=>t.jsxs("div",{className:"w-row",style:{gridTemplateColumns:"1fr auto",padding:"10px 0"},children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[t.jsx("span",{className:"w-avatar w-avatar--sm",children:Os(W.email)}),t.jsx("span",{className:"w-truncate w-text-secondary",children:W.email})]}),t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[t.jsx("span",{className:"w-pill",children:W.roleName}),t.jsx("button",{type:"button",className:"w-btn w-btn--icon",title:"Remove",onClick:()=>Q(G=>G.filter(K=>K.email!==W.email)),children:t.jsx(La,{size:13})})]})]},W.email))}),t.jsxs("div",{className:"w-flex w-gap-2",children:[t.jsx("button",{type:"button",className:"w-btn w-btn--secondary w-none",onClick:()=>j(2),disabled:F,children:"Skip"}),t.jsx("button",{type:"button",className:"w-btn w-btn--primary w-grow",onClick:De,disabled:F,children:F?t.jsx(je,{size:15}):B.length?`Invite ${B.length} & finish`:"Finish"})]})]}),b===2&&t.jsxs("div",{className:"w-flex-col w-items-center w-gap-4",children:[t.jsxs("div",{className:"w-create-summary",children:[t.jsx("span",{className:"w-avatar w-avatar--md",children:E?t.jsx("img",{src:E,alt:v}):Os(v)}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("span",{className:"w-sec",children:v}),t.jsx("span",{className:"w-secsub",children:B.length?`${B.length} invite${B.length>1?"s":""} sent`:"No invites yet"})]})]}),t.jsxs("button",{type:"button",className:"w-btn w-btn--primary w-btn--block",onClick:()=>s==null?void 0:s(L),children:["Go to ",m,t.jsx(Qt,{size:15})]}),t.jsxs("button",{type:"button",className:"w-link w-link--muted w-linkbtn w-inline w-gap-1",onClick:Ee,children:[t.jsx(Vo,{size:12})," Create another"]})]})]}),b===0&&t.jsx("div",{className:"w-create-foot",children:t.jsx("span",{className:"w-secsub",children:l?"Organizations group your team, billing and settings.":"Workspaces live inside an organization."})})]})},mn=({onSuccess:e,onCancel:a})=>t.jsx(Re,{children:t.jsx("div",{className:"w-flex w-justify-center w-full",children:t.jsx(Wc,{mode:"org",onSuccess:e,onCancel:a})})}),Bc=({isOpen:e,onClose:a,onCreated:s})=>{const n=()=>{s==null||s(),a==null||a()};return t.jsx(Re,{children:t.jsx(ze,{isOpen:e,onClose:a,children:t.jsx(ze.Overlay,{children:t.jsx(ze.Content,{className:"w-dialog--create",children:t.jsx(mn,{onSuccess:n,onCancel:a})})})})})},Er=o.createContext({screen:null,setScreen:()=>{},toast:(e,a)=>{}}),Ct=()=>{const e=o.useContext(Er);if(!e)throw new Error("useScreenContext must be used within a ScreenContextProvider");return e},Qa=({title:e,description:a,onConfirm:s,onCancel:n,style:i})=>{const l=o.useRef(null);return o.useEffect(()=>{const m=c=>{l.current&&!l.current.contains(c.target)&&n()};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[n]),t.jsxs("div",{ref:l,className:"w-pop",style:{position:"fixed",zIndex:1e3,right:44,...i},children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsx("h3",{className:"w-pop-title",children:e}),a&&t.jsx("p",{className:"w-pop-sub",children:a})]}),t.jsxs("div",{className:"w-pop-foot",children:[t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:n,children:"Cancel"}),t.jsx("button",{className:"w-btn w-btn--danger-solid w-btn--sm",onClick:s,children:"Confirm"})]})]})},Mi=[{id:"okta",name:"Okta",logo:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",protocol:"saml",description:"SAML",docUrl:"https://help.okta.com/en-us/content/topics/apps/apps_app_integration_wizard_saml.htm",placeholders:{entityId:"http://www.okta.com/{yourOktaDomain}",ssoUrl:"https://{yourOktaDomain}.okta.com/app/{appId}/sso/saml"},attributeMapping:{first_name:"firstName",last_name:"lastName",email:"email"}},{id:"okta-oidc",name:"Okta",logo:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",protocol:"oidc",description:"OIDC",docUrl:"https://developer.okta.com/docs/guides/implement-oauth-for-okta/main/",placeholders:{issuerUrl:"https://{yourOktaDomain}.okta.com",scopes:"openid profile email"},attributeMapping:{first_name:"given_name",last_name:"family_name",email:"email"}},{id:"azure",name:"Azure AD",logo:"https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Microsoft_Azure.svg/150px-Microsoft_Azure.svg.png",protocol:"saml",description:"SAML",docUrl:"https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/add-application-portal-setup-sso",placeholders:{entityId:"https://sts.windows.net/{tenantId}/",ssoUrl:"https://login.microsoftonline.com/{tenantId}/saml2"},attributeMapping:{first_name:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",last_name:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",email:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"}},{id:"azure-oidc",name:"Azure AD",logo:"https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Microsoft_Azure.svg/150px-Microsoft_Azure.svg.png",protocol:"oidc",description:"OIDC",docUrl:"https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc",placeholders:{issuerUrl:"https://login.microsoftonline.com/{tenantId}/v2.0",scopes:"openid profile email"},attributeMapping:{first_name:"given_name",last_name:"family_name",email:"email"}},{id:"google",name:"Google",logo:"https://www.gstatic.com/images/branding/product/1x/googleg_48dp.png",protocol:"saml",description:"SAML",docUrl:"https://support.google.com/a/answer/6087519",placeholders:{entityId:"https://accounts.google.com/o/saml2?idpid={idpId}",ssoUrl:"https://accounts.google.com/o/saml2/idp?idpid={idpId}"},attributeMapping:{first_name:"FirstName",last_name:"LastName",email:"email"}},{id:"google-oidc",name:"Google",logo:"https://www.gstatic.com/images/branding/product/1x/googleg_48dp.png",protocol:"oidc",description:"OIDC",docUrl:"https://developers.google.com/identity/openid-connect/openid-connect",placeholders:{issuerUrl:"https://accounts.google.com",scopes:"openid profile email"},attributeMapping:{first_name:"given_name",last_name:"family_name",email:"email"}},{id:"auth0",name:"Auth0",logo:"https://cdn.auth0.com/styleguide/latest/lib/logos/img/badge.png",protocol:"oidc",description:"OIDC",docUrl:"https://auth0.com/docs/authenticate/protocols/openid-connect-protocol",placeholders:{issuerUrl:"https://{yourDomain}.auth0.com/",scopes:"openid profile email"},attributeMapping:{first_name:"given_name",last_name:"family_name",email:"email"}},{id:"onelogin",name:"OneLogin",logo:"",protocol:"saml",description:"SAML",docUrl:"https://onelogin.service-now.com/support?id=kb_article&sys_id=912bb23adbdc1cd0ca1c400e0b96197d",placeholders:{entityId:"https://app.onelogin.com/saml/metadata/{appId}",ssoUrl:"https://{subdomain}.onelogin.com/trust/saml2/http-post/sso/{appId}"}},{id:"ping",name:"PingOne",logo:"",protocol:"saml",description:"SAML",docUrl:"https://docs.pingidentity.com/pingone/latest/connector/configure-saml.html",placeholders:{entityId:"https://auth.pingone.com/{envId}",ssoUrl:"https://auth.pingone.com/{envId}/saml20/idp/sso"}},{id:"jumpcloud",name:"JumpCloud",logo:"",protocol:"saml",description:"SAML",docUrl:"https://support.jumpcloud.com/support/s/article/single-sign-on-sso-with-saml",placeholders:{entityId:"https://sso.jumpcloud.com/saml2/{appId}",ssoUrl:"https://sso.jumpcloud.com/saml2/{appId}"}},{id:"duo",name:"Duo",logo:"",protocol:"saml",description:"SAML",docUrl:"https://duo.com/docs/sso",placeholders:{entityId:"https://sso.duosecurity.com/saml2/sp/{appId}",ssoUrl:"https://sso.duosecurity.com/saml2/idp/{appId}/sso"}},{id:"keycloak",name:"Keycloak",logo:"https://www.keycloak.org/resources/images/icon.svg",protocol:"oidc",description:"OIDC",docUrl:"https://www.keycloak.org/docs/latest/securing_apps/",placeholders:{issuerUrl:"https://{host}/realms/{realm}",scopes:"openid profile email"}},{id:"adfs",name:"ADFS",logo:"https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Microsoft_logo.svg/100px-Microsoft_logo.svg.png",protocol:"saml",description:"SAML",docUrl:"https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/operations/create-a-relying-party-trust",placeholders:{entityId:"http://{adfsServer}/adfs/services/trust",ssoUrl:"https://{adfsServer}/adfs/ls/"}},{id:"custom-saml",name:"Custom",logo:"",protocol:"saml",description:"SAML",docUrl:"",placeholders:{}},{id:"custom-oidc",name:"Custom",logo:"",protocol:"oidc",description:"OIDC",docUrl:"",placeholders:{}}],Tm=({template:e})=>{const[a,s]=o.useState(!1);return!e.logo||a?t.jsx("span",{className:"w-avatar w-avatar--square w-avatar--md w-sso-logo--ph",children:t.jsx(Xt,{size:18,className:"w-text-muted"})}):t.jsx("img",{className:"w-avatar w-avatar--square w-avatar--md w-sso-logo",src:e.logo,alt:e.name,onError:()=>s(!0)})},Im=({organization:e})=>{const{getEnterpriseConnections:a,createEnterpriseConnection:s,deleteEnterpriseConnection:n,testEnterpriseConnection:i,generateSCIMToken:l,getSCIMToken:m,revokeSCIMToken:c}=zt(),{toast:d}=Ct(),[p,u]=o.useState(!1),[h,f]=o.useState(null),{data:g=[],isLoading:x,mutate:w}=Ce(e!=null&&e.id?`wacht-org-sso:${e.id}`:null,async()=>await(a==null?void 0:a(e))||[],{refreshInterval:3e4,revalidateOnFocus:!1}),b=async j=>{try{await(n==null?void 0:n(e,j)),w(),d("SSO connection deleted","info")}catch(v){d(v.message||"Failed to delete connection","error")}f(null)};return x?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):p?t.jsx(zm,{organization:e,onClose:()=>u(!1),onCreate:async j=>{try{await(s==null?void 0:s(e,j)),w(),u(!1),d("SSO connection created","info")}catch(v){d(v.message||"Failed to create connection","error")}}}):t.jsx(t.Fragment,{children:g.length===0?t.jsxs("div",{className:"w-empty w-empty--fill",children:[t.jsx("div",{className:"w-empty-ic",children:t.jsx(Xt,{size:20})}),t.jsxs("div",{className:"w-empty-text",children:[t.jsx("h4",{children:"Enterprise SSO"}),t.jsx("p",{children:"Let members sign in with your identity provider."})]}),t.jsx("div",{className:"w-empty-action",children:t.jsxs(se,{onClick:()=>u(!0),children:[t.jsx(St,{size:16})," Configure SSO"]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-flex w-items-center w-justify-between w-gap-4 w-sechead",children:t.jsxs("div",{className:"w-grow w-flex-col w-gap-1",children:[t.jsx("h3",{className:"w-title",children:"Enterprise SSO"}),t.jsx("p",{className:"w-sub",children:"Configure SAML or OIDC SSO for your organization"})]})}),g.map(j=>t.jsx(Vm,{connection:j,onDelete:v=>f(v),connectionToDelete:h,onConfirmDelete:b,onCancelDelete:()=>f(null),testConnection:v=>i(e,v),generateSCIMToken:v=>l(e,v),getSCIMToken:v=>m(e,v),revokeSCIMToken:v=>c(e,v),toast:d},j.id))]})})},Vm=({connection:e,onDelete:a,connectionToDelete:s,onConfirmDelete:n,onCancelDelete:i,testConnection:l,generateSCIMToken:m,getSCIMToken:c,revokeSCIMToken:d,toast:p})=>{var F,A,T,P,S;const[u,h]=o.useState(null),[f,g]=o.useState(!1),[x,w]=o.useState(null),[b,j]=o.useState(null),[v,k]=o.useState(!1),[N,_]=o.useState(null);o.useEffect(()=>{c&&e.id&&c(e.id).then(h).catch(()=>{})},[e.id,c]);const C=async()=>{if(l){k(!0),_(null);try{const $=await l(e.id);_($)}catch($){_({success:!1,checks:{},errors:{general:$.message||"Test failed"}})}finally{k(!1)}}},y=async()=>{if(m){g(!0);try{const $=await m(e.id);w($.token),h({exists:!0,token:$}),p("SCIM token generated. Copy it now - it won't be shown again!","info")}catch($){p($.message||"Failed to generate token","error")}finally{g(!1)}}},E=async()=>{if(d){g(!0);try{await d(e.id),h({exists:!1,scim_base_url:u==null?void 0:u.scim_base_url}),w(null),p("SCIM token revoked","info")}catch($){p($.message||"Failed to revoke token","error")}finally{g(!1)}}},M=($,H)=>{navigator.clipboard.writeText($),j(H),setTimeout(()=>j(null),2e3)};return t.jsxs("div",{className:"w-flex-col w-gap-4 w-sso-conn",children:[t.jsxs("div",{className:"w-flex w-justify-between w-items-start",children:[t.jsxs("h3",{className:"w-sec w-inline w-gap-2",children:[t.jsx(Xt,{size:16}),e.protocol==="oidc"?"OIDC SSO":"SAML SSO",t.jsx("span",{className:"w-pill w-pill--current",children:e.protocol.toUpperCase()})]}),t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[t.jsx(se,{$size:"sm",onClick:C,disabled:v,children:v?t.jsx(je,{size:14}):"Test"}),t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",$outline:!0,onClick:()=>a(e.id),className:"w-text-error",children:"Remove"}),s===e.id&&t.jsx(Qa,{title:"Delete this SSO connection?",onConfirm:()=>n(e.id),onCancel:i})]})]})]}),N&&t.jsx("div",{className:`w-banner ${N.success?"w-banner--success":"w-banner--error"}`,children:t.jsxs("span",{className:`w-banner-txt w-flex-col w-gap-1 ${N.success?"w-text-success":"w-text-error"}`,children:[t.jsx("span",{children:N.success?"✓ Connection is valid":"✗ Connection failed"}),N.errors&&Object.entries(N.errors).map(([$,H])=>t.jsxs("div",{children:[$.replace(/_/g," "),": ",H]},$))]})}),t.jsxs("div",{className:"w-sso-detail",children:[e.protocol==="saml"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"w-secsub",children:"Entity ID"}),t.jsx("span",{className:"w-sec w-break-all",children:e.idp_entity_id}),t.jsx("span",{className:"w-secsub",children:"SSO URL"}),t.jsx("span",{className:"w-sec w-break-all",children:e.idp_sso_url})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"w-secsub",children:"Issuer URL"}),t.jsx("span",{className:"w-sec w-break-all",children:e.oidc_issuer_url}),t.jsx("span",{className:"w-secsub",children:"Client ID"}),t.jsx("span",{className:"w-sec",children:e.oidc_client_id}),t.jsx("span",{className:"w-secsub",children:"Scopes"}),t.jsx("span",{className:"w-sec",children:e.oidc_scopes||"openid profile email"})]}),t.jsx("span",{className:"w-secsub",children:"Created"}),t.jsx("span",{className:"w-sec",children:new Date(e.created_at).toLocaleDateString()})]}),t.jsxs("div",{className:"w-flex-col w-gap-3 w-sso-scim",children:[t.jsxs("div",{className:"w-flex w-justify-between w-items-center",children:[t.jsxs("div",{className:"w-sec w-inline w-gap-2",children:[t.jsx(Xt,{size:14}),"SCIM Provisioning"]}),t.jsx("div",{className:"w-flex w-wrap w-gap-2",children:!(u!=null&&u.exists)||!((F=u==null?void 0:u.token)!=null&&F.enabled)?t.jsx(se,{$size:"sm",onClick:y,disabled:f,children:f?t.jsx(je,{size:14}):"Generate Token"}):t.jsxs(t.Fragment,{children:[t.jsx(se,{$size:"sm",onClick:y,disabled:f,children:f?t.jsx(je,{size:14}):"Rotate"}),t.jsx(se,{$size:"sm",$outline:!0,onClick:E,disabled:f,className:"w-text-error",children:"Revoke"})]})})]}),(((A=u==null?void 0:u.token)==null?void 0:A.scim_base_url)||x)&&t.jsxs("div",{className:"w-token",children:[t.jsx("span",{className:"w-secsub w-none",children:"Base URL:"}),t.jsx("code",{children:((T=u==null?void 0:u.token)==null?void 0:T.scim_base_url)||"Loading..."}),((P=u==null?void 0:u.token)==null?void 0:P.scim_base_url)&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:()=>M(u.token.scim_base_url,"scim-url"),children:b==="scim-url"?t.jsx(qe,{size:12}):t.jsx(Ga,{size:12})})]}),x&&t.jsxs("div",{className:"w-flex-col w-gap-2",children:[t.jsxs("div",{className:"w-token",children:[t.jsx("span",{className:"w-secsub w-none",children:"Token:"}),t.jsx("code",{children:x}),t.jsx("button",{className:"w-btn w-btn--icon",onClick:()=>M(x,"scim-token"),children:b==="scim-token"?t.jsx(qe,{size:12}):t.jsx(Ga,{size:12})})]}),t.jsx("div",{className:"w-mono-faint w-text-warning",children:"⚠️ Copy this token now. It won't be shown again."})]}),(u==null?void 0:u.exists)&&((S=u==null?void 0:u.token)==null?void 0:S.enabled)&&!x&&t.jsxs("div",{className:"w-secsub",children:["Token:"," ",t.jsxs("code",{className:"w-mono-sm w-token-chip",children:[u.token.token_prefix,"..."]}),u.token.last_used_at&&t.jsxs("span",{children:[" ","· Last used:"," ",new Date(u.token.last_used_at).toLocaleDateString()]})]})]})]})},zm=({onCreate:e,organization:a})=>{const{getOrganizationDomains:s,testEnterpriseConnectionConfig:n}=zt(),{deployment:i}=ke(),{toast:l}=Ct(),[m,c]=o.useState(!1),[d,p]=o.useState(null),[u,h]=o.useState("saml"),[f,g]=o.useState(null),[x,w]=o.useState(!1),[b,j]=o.useState({domain_id:"",idp_entity_id:"",idp_sso_url:"",idp_certificate:"",oidc_issuer_url:"",oidc_client_id:"",oidc_client_secret:"",oidc_scopes:"openid profile email",jit_enabled:!0,attr_first_name:"",attr_last_name:"",attr_email:""}),[v,k]=o.useState(!1),[N,_]=o.useState(null),{data:C=[],isLoading:y}=Ce("wacht-org-verified-domains-for-sso-screen",async()=>(await(s==null?void 0:s(a))||[]).filter(R=>R.verified),{revalidateOnFocus:!1}),E=H=>{p(H),h(H.protocol),H.protocol==="saml"?j(R=>{var O,Z,L;return{...R,idp_entity_id:H.placeholders.entityId||"",idp_sso_url:H.placeholders.ssoUrl||"",attr_first_name:((O=H.attributeMapping)==null?void 0:O.first_name)||"",attr_last_name:((Z=H.attributeMapping)==null?void 0:Z.last_name)||"",attr_email:((L=H.attributeMapping)==null?void 0:L.email)||""}}):j(R=>{var O,Z,L;return{...R,oidc_issuer_url:H.placeholders.issuerUrl||"",oidc_scopes:H.placeholders.scopes||"openid profile email",attr_first_name:((O=H.attributeMapping)==null?void 0:O.first_name)||"",attr_last_name:((Z=H.attributeMapping)==null?void 0:Z.last_name)||"",attr_email:((L=H.attributeMapping)==null?void 0:L.email)||""}})},M=i!=null&&i.backend_host?`${i.backend_host.startsWith("https://")?"":"https://"}${i.backend_host}/auth/sso/oidc/callback`:"",F=i!=null&&i.backend_host?`https://${i.backend_host}/auth/sso/metadata`:"",A=i!=null&&i.backend_host?`https://${i.backend_host}/auth/sso/callback`:"",T=(H,R)=>{navigator.clipboard.writeText(H),g(R),setTimeout(()=>g(null),2e3)},P=async H=>{H.preventDefault();const R=O=>O.includes("{")||O.includes("}");if(u==="saml"){if(!b.idp_entity_id||R(b.idp_entity_id)){l("Please enter a valid IdP Entity ID (no placeholders)","error");return}if(!b.idp_sso_url||R(b.idp_sso_url)){l("Please enter a valid IdP SSO URL (no placeholders)","error");return}if(!b.idp_certificate){l("Please provide the X.509 Certificate","error");return}}else{if(!b.oidc_issuer_url||R(b.oidc_issuer_url)){l("Please enter a valid Issuer URL (no placeholders)","error");return}if(!b.oidc_client_id||R(b.oidc_client_id)){l("Please enter a valid Client ID (no placeholders)","error");return}if(!b.oidc_client_secret){l("Please enter the Client Secret","error");return}}c(!0);try{const O={};b.attr_first_name&&(O.first_name=b.attr_first_name),b.attr_last_name&&(O.last_name=b.attr_last_name),b.attr_email&&(O.email=b.attr_email);const Z=Object.keys(O).length>0;u==="saml"?await e({protocol:"saml",domain_id:b.domain_id||void 0,idp_entity_id:b.idp_entity_id,idp_sso_url:b.idp_sso_url,idp_certificate:b.idp_certificate,jit_enabled:b.jit_enabled,...Z&&{attribute_mapping:O}}):await e({protocol:"oidc",domain_id:b.domain_id||void 0,oidc_issuer_url:b.oidc_issuer_url,oidc_client_id:b.oidc_client_id,oidc_client_secret:b.oidc_client_secret,oidc_scopes:b.oidc_scopes,jit_enabled:b.jit_enabled,...Z&&{attribute_mapping:O}})}finally{c(!1)}},S=async()=>{k(!0),_(null);const H=Z=>Z.includes("{")||Z.includes("}"),R={},O={};if(u==="saml"?(b.idp_entity_id?H(b.idp_entity_id)?(O.entity_id_valid=!1,R.entity_id_valid="IdP Entity ID contains placeholder values - please replace with actual values"):O.entity_id_valid=!0:(O.entity_id_valid=!1,R.entity_id_valid="IdP Entity ID is required"),b.idp_sso_url?H(b.idp_sso_url)?(O.sso_url_valid=!1,R.sso_url_valid="IdP SSO URL contains placeholder values - please replace with actual values"):O.sso_url_valid=!0:(O.sso_url_valid=!1,R.sso_url_valid="IdP SSO URL is required"),b.idp_certificate?O.certificate_provided=!0:(O.certificate_provided=!1,R.certificate_provided="X.509 Certificate is required")):(b.oidc_issuer_url?H(b.oidc_issuer_url)?(O.issuer_url_valid=!1,R.issuer_url_valid="Issuer URL contains placeholder values - please replace with actual values"):O.issuer_url_valid=!0:(O.issuer_url_valid=!1,R.issuer_url_valid="Issuer URL is required"),b.oidc_client_id?H(b.oidc_client_id)?(O.client_id_valid=!1,R.client_id_valid="Client ID contains placeholder values - please replace with actual values"):O.client_id_valid=!0:(O.client_id_valid=!1,R.client_id_valid="Client ID is required")),Object.keys(R).length>0){_({success:!1,checks:O,errors:R}),k(!1);return}try{const Z=u==="saml"?{protocol:"saml",idp_entity_id:b.idp_entity_id,idp_sso_url:b.idp_sso_url,idp_certificate:b.idp_certificate}:{protocol:"oidc",oidc_issuer_url:b.oidc_issuer_url,oidc_client_id:b.oidc_client_id,oidc_client_secret:b.oidc_client_secret},L=await(n==null?void 0:n(a,Z));L&&_(L)}catch(Z){_({success:!1,checks:{},errors:{general:"Test failed: "+Z.message}})}finally{k(!1)}},$=H=>t.jsx(Tm,{template:H});return t.jsxs("form",{onSubmit:P,autoComplete:"off",className:"w-flex-col w-gap-4",children:[d?t.jsxs("div",{className:"w-flex w-items-center w-gap-4 w-sso-template",children:[$(d),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec",children:d.name}),t.jsx("div",{className:"w-eyebrow",children:d.protocol})]}),t.jsx(se,{type:"button",$size:"sm",$outline:!0,onClick:()=>p(null),children:"Change"})]}):t.jsxs("div",{className:"w-flex-col w-gap-5",children:[t.jsxs("div",{className:"w-flex-col w-gap-3",children:[t.jsx("div",{className:"w-eyebrow",children:"SAML Providers"}),t.jsx("div",{className:"w-grid-4",children:Mi.filter(H=>H.protocol==="saml").map(H=>t.jsxs("button",{type:"button",className:"w-sso-tile",onClick:()=>E(H),children:[$(H),t.jsx("span",{className:"w-secsub",children:H.name})]},H.id))})]}),t.jsxs("div",{className:"w-flex-col w-gap-3",children:[t.jsx("div",{className:"w-eyebrow",children:"OIDC Providers"}),t.jsx("div",{className:"w-grid-4",children:Mi.filter(H=>H.protocol==="oidc").map(H=>t.jsxs("button",{type:"button",className:"w-sso-tile",onClick:()=>E(H),children:[$(H),t.jsx("span",{className:"w-secsub",children:H.name})]},H.id))})]})]}),d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-tile w-flex-col w-gap-3",children:[t.jsx("div",{className:"w-sec",children:"Service Provider Details"}),t.jsx("div",{className:"w-flex-col w-gap-2 w-full",children:u==="saml"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-token",children:[t.jsx("span",{className:"w-secsub w-none",children:"ACS URL:"}),t.jsx("code",{children:A}),t.jsx("button",{type:"button",className:"w-btn w-btn--icon",onClick:()=>T(A,"acs"),children:f==="acs"?t.jsx(qe,{size:12}):t.jsx(Ga,{size:12})})]}),t.jsxs("div",{className:"w-token",children:[t.jsx("span",{className:"w-secsub w-none",children:"Metadata:"}),t.jsx("code",{children:F}),t.jsx("button",{type:"button",className:"w-btn w-btn--icon",onClick:()=>T(F,"metadata"),children:f==="metadata"?t.jsx(qe,{size:12}):t.jsx(Ga,{size:12})})]})]}):t.jsxs("div",{className:"w-token",children:[t.jsx("span",{className:"w-secsub w-none",children:"Callback:"}),t.jsx("code",{children:M}),t.jsx("button",{type:"button",className:"w-btn w-btn--icon",onClick:()=>T(M,"callback"),children:f==="callback"?t.jsx(qe,{size:12}):t.jsx(Ga,{size:12})})]})})]}),t.jsxs("div",{className:"w-flex-col w-gap-3",children:[t.jsxs("div",{className:"w-flex w-justify-between w-items-center w-gap-3",children:[t.jsx("div",{className:"w-eyebrow",children:d?`${d.name} Configuration`:"Configuration"}),t.jsxs("div",{className:"w-flex w-items-center w-gap-3",children:[d&&d.docUrl&&t.jsxs("a",{href:d.docUrl,target:"_blank",rel:"noopener noreferrer",className:"w-link w-link--sm w-text-primary w-inline w-gap-1",children:[t.jsx(vu,{size:12})," Docs"]}),t.jsx(se,{type:"button",$size:"sm",$outline:!0,onClick:S,disabled:v||!d,children:v?t.jsx(je,{size:16}):"Test Connection"}),t.jsx(se,{$size:"sm",type:"submit",disabled:m||C.length===0||!d,children:m?t.jsx(je,{size:16}):"Create Connection"})]})]}),N&&(()=>{const H={entity_id_valid:"IdP Entity ID",sso_url_valid:"IdP SSO URL",certificate_provided:"X.509 Certificate",issuer_url_valid:"Issuer URL",client_id_valid:"Client ID",certificate_valid:"Certificate Valid",sso_url_reachable:"SSO URL Reachable",discovery_reachable:"Discovery Endpoint",discovery_valid:"Discovery Valid",authorization_endpoint:"Authorization Endpoint",token_endpoint:"Token Endpoint",issuer_valid:"Issuer URL Valid"};return t.jsxs("div",{className:`w-banner ${N.success?"w-banner--success":"w-banner--error"} w-flex-col w-gap-3`,children:[t.jsx("div",{className:`w-sec ${N.success?"w-text-success":"w-text-error"}`,children:N.success?"✓ All checks passed":"✗ Some checks failed"}),t.jsx("div",{className:"w-flex-col w-gap-2 w-full",children:Object.entries(N.checks).map(([R,O])=>{var Z;return t.jsxs("div",{className:"w-flex w-items-start w-gap-2 w-sso-check",children:[t.jsx("span",{className:`w-sso-check-mark ${O?"w-text-success":"w-text-error"}`,children:O?"✓":"✗"}),t.jsxs("div",{className:"w-grow w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-sec",children:H[R]||R.replace(/_/g," ").replace(/\b\w/g,L=>L.toUpperCase())}),((Z=N.errors)==null?void 0:Z[R])&&t.jsx("div",{className:"w-secsub w-text-error",children:N.errors[R]})]})]},R)})})]})})(),t.jsxs("div",{className:"w-grid-2",children:[!d&&t.jsxs(We,{children:[t.jsx(Te,{children:"Protocol *"}),t.jsxs("select",{className:"w-input",value:u,onChange:H=>h(H.target.value),children:[t.jsx("option",{value:"saml",children:"SAML"}),t.jsx("option",{value:"oidc",children:"OpenID Connect (OIDC)"})]})]}),t.jsxs(We,{className:"w-col-full",children:[t.jsx(Te,{children:"Domain *"}),y?t.jsx("div",{className:"w-secsub",children:"Loading domains..."}):C.length===0?t.jsx("div",{className:"w-banner w-banner--warn",children:t.jsx("span",{className:"w-banner-txt",children:"No verified domains found. Please add and verify a domain first."})}):t.jsxs("select",{className:"w-input",value:b.domain_id,onChange:H=>j({...b,domain_id:H.target.value}),required:!0,children:[t.jsx("option",{value:"",children:"Select a verified domain"}),C.map(H=>t.jsx("option",{value:H.id,children:H.fqdn},H.id))]})]}),u==="saml"?t.jsxs(t.Fragment,{children:[t.jsxs(We,{children:[t.jsx(Te,{children:"IdP Entity ID *"}),t.jsx(be,{type:"text",value:b.idp_entity_id,onChange:H=>j({...b,idp_entity_id:H.target.value}),placeholder:"https://idp.example.com/entity",required:!0})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"IdP SSO URL *"}),t.jsx(be,{type:"url",value:b.idp_sso_url,onChange:H=>j({...b,idp_sso_url:H.target.value}),placeholder:"https://idp.example.com/sso",required:!0})]}),t.jsxs(We,{className:"w-col-full",children:[t.jsx(Te,{children:"X.509 Certificate *"}),t.jsx(be,{as:"textarea",value:b.idp_certificate,onChange:H=>j({...b,idp_certificate:H.target.value}),placeholder:"-----BEGIN CERTIFICATE-----...",required:!0,className:"w-input--area w-input--mono"})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs(We,{children:[t.jsx(Te,{children:"Issuer URL *"}),t.jsx(be,{type:"url",value:b.oidc_issuer_url,onChange:H=>j({...b,oidc_issuer_url:H.target.value}),placeholder:"https://login.example.com",required:!0})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"Client ID *"}),t.jsx(be,{type:"text",value:b.oidc_client_id,onChange:H=>j({...b,oidc_client_id:H.target.value}),placeholder:"your-client-id",required:!0,autoComplete:"off","data-lpignore":"true","data-form-type":"other"})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"Client Secret *"}),t.jsx(be,{type:"password",value:b.oidc_client_secret,onChange:H=>j({...b,oidc_client_secret:H.target.value}),placeholder:"your-client-secret",required:!0,autoComplete:"new-password","data-lpignore":"true","data-form-type":"other"})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"Scopes"}),t.jsx(be,{type:"text",value:b.oidc_scopes,onChange:H=>j({...b,oidc_scopes:H.target.value}),placeholder:"openid profile email"})]})]}),t.jsx(We,{className:"w-col-full",children:t.jsxs("div",{className:"w-flex w-items-center w-justify-between w-gap-4",children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("span",{className:"w-sec",children:"Enable JIT Provisioning"}),t.jsx("div",{className:"w-secsub",children:"When enabled, new users are automatically created on their first SSO login. When disabled, only pre-existing users can sign in via SSO."})]}),t.jsx(Za,{checked:b.jit_enabled,onChange:()=>j({...b,jit_enabled:!b.jit_enabled})})]})}),t.jsxs("div",{className:"w-col-full w-flex-col w-gap-4",children:[t.jsxs("div",{className:"w-inline w-gap-2 w-text-primary w-disclosure",onClick:()=>w(!x),children:[t.jsx("span",{className:"w-disclosure-caret",children:x?"▼":"▶"}),"Advanced Options (Attribute Mapping)"]}),x&&t.jsxs("div",{className:"w-tile w-flex-col w-gap-3",children:[t.jsx("div",{className:"w-secsub",children:"Map IdP attribute names to Wacht user fields. Leave empty to use default attribute names."}),t.jsxs("div",{className:"w-grid-3",children:[t.jsxs(We,{children:[t.jsx(Te,{children:"First Name Attribute"}),t.jsx(be,{type:"text",value:b.attr_first_name,onChange:H=>j({...b,attr_first_name:H.target.value}),placeholder:u==="saml"?"givenName":"given_name"})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"Last Name Attribute"}),t.jsx(be,{type:"text",value:b.attr_last_name,onChange:H=>j({...b,attr_last_name:H.target.value}),placeholder:u==="saml"?"surname":"family_name"})]}),t.jsxs(We,{children:[t.jsx(Te,{children:"Email Attribute"}),t.jsx(be,{type:"text",value:b.attr_email,onChange:H=>j({...b,attr_email:H.target.value}),placeholder:"email"})]})]})]})]})]})]})]})]})},ht=(...e)=>e.filter(Boolean).join(" "),Ri=({className:e,...a})=>t.jsx("div",{className:ht("w-contents",e),...a}),Zn=({className:e,...a})=>t.jsx("div",{className:ht("w-card","w-flex-col","w-full","w-minh-full",e),...a}),Dm=({className:e,...a})=>t.jsx("div",{className:ht("w-tabsbar",e),...a}),Um=({className:e,...a})=>t.jsx("div",{className:ht("w-flex","w-items-center","w-gap-1","w-tabs",e),...a}),za=({className:e,$isActive:a,...s})=>t.jsx("button",{className:ht("w-tab",a&&"w-tab--active",e),...s}),Da=({className:e,...a})=>t.jsx("span",{className:ht("w-inline","w-gap-2",e),...a}),Wm=({className:e,children:a,...s})=>t.jsx("div",{className:ht("w-tabbody",e),...s,children:t.jsx("div",{className:"w-tabpane",children:a})}),Ar=({className:e,...a})=>t.jsx("div",{className:ht("w-sechead",e),...a}),Li=({className:e,...a})=>t.jsx("div",{className:ht("w-flex","w-items-center","w-justify-between","w-gap-4",e),...a}),Pi=({className:e,...a})=>t.jsx("div",{className:ht("w-grow",e),...a}),$i=({className:e,...a})=>t.jsx("div",{className:ht("w-flex","w-items-center","w-gap-3","w-none",e),...a}),pn=({className:e,...a})=>t.jsx("div",{className:ht("w-full",e),...a}),Bm=({className:e,...a})=>t.jsx("div",{className:ht("w-page-head",e),...a}),Gm=({className:e,...a})=>t.jsx("div",{className:ht("w-grow","w-flex-col","w-gap-1",e),...a}),qm=({className:e,...a})=>t.jsx("div",{className:ht("w-sec","w-truncate",e),...a}),Km=({className:e,...a})=>t.jsx("div",{className:ht("w-secsub","w-truncate",e),...a}),Ym={primary:"w-pill--current",success:"w-pill--success",warning:"w-pill--pending",danger:"w-pill--error",neutral:""},pa=({className:e,$variant:a="neutral",children:s,...n})=>t.jsxs("span",{className:ht("w-pill",Ym[a],e),...n,children:[t.jsx("span",{className:"w-dot"}),s]}),Oi=({className:e,$first:a,...s})=>t.jsx("div",{className:ht("w-sec",e),...s}),Qm=({organization:e})=>{var A,T,P,S,$,H;const{switchOrganization:a,refetch:s}=it(),{workspaces:n}=ga(),{deployment:i}=ke(),{deleteOrganization:l,updateOrganization:m}=zt(),{toast:c}=Ct(),[d,p]=o.useState((e==null?void 0:e.name)||""),[u,h]=o.useState((e==null?void 0:e.description)||""),[f,g]=o.useState(!1),[x,w]=o.useState({mfa_required:!1,ip_restrictions:!1,allowed_ips:"",default_workspace_id:""}),[b,j]=o.useState(""),[v,k]=o.useState(!1),[N,_]=o.useState(!1),C=o.useRef({name:d,description:u,security:x,isSaving:f});o.useEffect(()=>{C.current={name:d,description:u,security:x,isSaving:f}},[d,u,x,f]);const y=o.useCallback(async()=>{if(!e)return;const R=C.current;try{g(!0),await m(e,{name:R.name,description:R.description,whitelisted_ips:R.security.allowed_ips.split(`
@@ -115,5 +115,5 @@ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-sev
115
115
  * SPDX-License-Identifier: ISC
116
116
  */var x6={L:Wa.QrCode.Ecc.LOW,M:Wa.QrCode.Ecc.MEDIUM,Q:Wa.QrCode.Ecc.QUARTILE,H:Wa.QrCode.Ecc.HIGH},y0=128,j0="L",_0="#FFFFFF",k0="#000000",C0=!1,N0=1,v6=4,b6=0,y6=.1;function S0(e,a=0){const s=[];return e.forEach(function(n,i){let l=null;n.forEach(function(m,c){if(!m&&l!==null){s.push(`M${l+a} ${i+a}h${c-l}v1H${l+a}z`),l=null;return}if(c===n.length-1){if(!m)return;l===null?s.push(`M${c+a},${i+a} h1v1H${c+a}z`):s.push(`M${l+a},${i+a} h${c+1-l}v1H${l+a}z`);return}m&&l===null&&(l=c)})}),s.join("")}function E0(e,a){return e.slice().map((s,n)=>n<a.y||n>=a.y+a.h?s:s.map((i,l)=>l<a.x||l>=a.x+a.w?i:!1))}function j6(e,a,s,n){if(n==null)return null;const i=e.length+s*2,l=Math.floor(a*y6),m=i/a,c=(n.width||l)*m,d=(n.height||l)*m,p=n.x==null?e.length/2-c/2:n.x*m,u=n.y==null?e.length/2-d/2:n.y*m,h=n.opacity==null?1:n.opacity;let f=null;if(n.excavate){let x=Math.floor(p),w=Math.floor(u),b=Math.ceil(c+p-x),j=Math.ceil(d+u-w);f={x,y:w,w:b,h:j}}const g=n.crossOrigin;return{x:p,y:u,h:d,w:c,excavation:f,opacity:h,crossOrigin:g}}function _6(e,a){return a!=null?Math.max(Math.floor(a),0):e?v6:b6}function A0({value:e,level:a,minVersion:s,includeMargin:n,marginSize:i,imageSettings:l,size:m,boostLevel:c}){let d=o.useMemo(()=>{const x=(Array.isArray(e)?e:[e]).reduce((w,b)=>(w.push(...Wa.QrSegment.makeSegments(b)),w),[]);return Wa.QrCode.encodeSegments(x,x6[a],s,void 0,void 0,c)},[e,a,s,c]);const{cells:p,margin:u,numCells:h,calculatedImageSettings:f}=o.useMemo(()=>{let g=d.getModules();const x=_6(n,i),w=g.length+x*2,b=j6(g,m,x,l);return{cells:g,margin:x,numCells:w,calculatedImageSettings:b}},[d,m,l,n,i]);return{qrcode:d,margin:u,cells:p,numCells:h,calculatedImageSettings:f}}var k6=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),C6=o.forwardRef(function(a,s){const n=a,{value:i,size:l=y0,level:m=j0,bgColor:c=_0,fgColor:d=k0,includeMargin:p=C0,minVersion:u=N0,boostLevel:h,marginSize:f,imageSettings:g}=n,w=hr(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:b}=w,j=hr(w,["style"]),v=g==null?void 0:g.src,k=o.useRef(null),N=o.useRef(null),_=o.useCallback(S=>{k.current=S,typeof s=="function"?s(S):s&&(s.current=S)},[s]),[C,y]=o.useState(!1),{margin:E,cells:M,numCells:F,calculatedImageSettings:A}=A0({value:i,level:m,minVersion:u,boostLevel:h,includeMargin:p,marginSize:f,imageSettings:g,size:l});o.useEffect(()=>{if(k.current!=null){const S=k.current,$=S.getContext("2d");if(!$)return;let H=M;const R=N.current,O=A!=null&&R!==null&&R.complete&&R.naturalHeight!==0&&R.naturalWidth!==0;O&&A.excavation!=null&&(H=E0(M,A.excavation));const Z=window.devicePixelRatio||1;S.height=S.width=l*Z;const L=l/F*Z;$.scale(L,L),$.fillStyle=c,$.fillRect(0,0,F,F),$.fillStyle=d,k6?$.fill(new Path2D(S0(H,E))):M.forEach(function(U,D){U.forEach(function(Y,B){Y&&$.fillRect(B+E,D+E,1,1)})}),A&&($.globalAlpha=A.opacity),O&&$.drawImage(R,A.x+E,A.y+E,A.w,A.h)}}),o.useEffect(()=>{y(!1)},[v]);const T=pr({height:l,width:l},b);let P=null;return v!=null&&(P=o.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{y(!0)},ref:N,crossOrigin:A==null?void 0:A.crossOrigin})),o.createElement(o.Fragment,null,o.createElement("canvas",pr({style:T,height:l,width:l,ref:_,role:"img"},j)),P)});C6.displayName="QRCodeCanvas";var zr=o.forwardRef(function(a,s){const n=a,{value:i,size:l=y0,level:m=j0,bgColor:c=_0,fgColor:d=k0,includeMargin:p=C0,minVersion:u=N0,boostLevel:h,title:f,marginSize:g,imageSettings:x}=n,w=hr(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:j,numCells:v,calculatedImageSettings:k}=A0({value:i,level:m,minVersion:u,boostLevel:h,includeMargin:p,marginSize:g,imageSettings:x,size:l});let N=j,_=null;x!=null&&k!=null&&(k.excavation!=null&&(N=E0(j,k.excavation)),_=o.createElement("image",{href:x.src,height:k.h,width:k.w,x:k.x+b,y:k.y+b,preserveAspectRatio:"none",opacity:k.opacity,crossOrigin:k.crossOrigin}));const C=S0(N,b);return o.createElement("svg",pr({height:l,width:l,viewBox:`0 0 ${v} ${v}`,ref:s,role:"img"},w),!!f&&o.createElement("title",null,f),o.createElement("path",{fill:c,d:`M0,0 h${v}v${v}H0z`,shapeRendering:"crispEdges"}),o.createElement("path",{fill:d,d:C,shapeRendering:"crispEdges"}),_)});zr.displayName="QRCodeSVG";const Gi=({onClose:e,onChangePassword:a,triggerRef:s,isSetup:n=!1})=>{const i=o.useRef(null),[l,m]=o.useState(!1),[c,d]=o.useState(""),[p,u]=o.useState(""),[h,f]=o.useState(""),[g,x]=o.useState(!1),[w,b]=o.useState(!1),[j,v]=o.useState(!1),[k,N]=o.useState(!1),[_,C]=o.useState({}),y=bt({contentRef:i,triggerRef:s??{current:null},isOpen:l,minWidth:380,defaultMaxHeight:420});o.useEffect(()=>{m(!0);const M=A=>{i.current&&!i.current.contains(A.target)&&e()},F=A=>{A.key==="Escape"&&e()};return document.addEventListener("mousedown",M),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",F)}},[e]);const E=async()=>{if(k)return;const M={};if(!n&&!c&&(M.currentPassword="Current password is required"),p?p.length<8&&(M.newPassword="Password must be at least 8 characters"):M.newPassword="New password is required",p!==h&&(M.confirmPassword="Passwords do not match"),Object.keys(M).length>0){C(M);return}N(!0);try{await a(n?"":c,p),e()}catch(F){C({form:F.message||"Failed to update password"})}finally{N(!1)}};return l?t.jsxs("div",{ref:i,className:"w-pop",style:{position:"fixed",zIndex:1001,width:380,maxWidth:"calc(100vw - 24px)",top:(y==null?void 0:y.top)!==void 0?`${y.top}px`:void 0,bottom:(y==null?void 0:y.bottom)!==void 0?`${y.bottom}px`:void 0,left:(y==null?void 0:y.left)!==void 0?`${y.left}px`:void 0,right:(y==null?void 0:y.right)!==void 0?`${y.right}px`:void 0,maxHeight:y!=null&&y.maxHeight?`${y.maxHeight}px`:void 0,visibility:y?"visible":"hidden"},onClick:M=>M.stopPropagation(),children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-pop-title",children:n?"Set Password":"Change Password"}),t.jsx("p",{className:"w-pop-sub",children:n?"Set a password for your account to enable password authentication.":"Update your account password to keep it secure."})]}),!n&&t.jsxs("div",{className:"w-field",children:[t.jsx(Te,{children:"Current Password"}),t.jsxs("div",{className:"w-input-wrap",children:[t.jsx(be,{type:g?"text":"password",placeholder:"Enter your current password",value:c,onChange:M=>d(M.target.value),style:{paddingRight:40}}),t.jsx("button",{type:"button",className:"w-input-eye",onClick:()=>x(!g),"aria-label":g?"Hide current password":"Show current password",children:g?t.jsx(Sn,{size:16}):t.jsx(Nn,{size:16})})]}),_.currentPassword&&t.jsx("span",{className:"w-input-err",children:_.currentPassword})]}),t.jsxs("div",{className:"w-field",children:[t.jsx(Te,{children:n?"Password":"New Password"}),t.jsxs("div",{className:"w-input-wrap",children:[t.jsx(be,{type:w?"text":"password",placeholder:n?"Enter your password":"Enter your new password",value:p,onChange:M=>u(M.target.value),style:{paddingRight:40}}),t.jsx("button",{type:"button",className:"w-input-eye",onClick:()=>b(!w),"aria-label":w?"Hide new password":"Show new password",children:w?t.jsx(Sn,{size:16}):t.jsx(Nn,{size:16})})]}),_.newPassword&&t.jsx("span",{className:"w-input-err",children:_.newPassword})]}),t.jsxs("div",{className:"w-field",children:[t.jsx(Te,{children:"Confirm New Password"}),t.jsxs("div",{className:"w-input-wrap",children:[t.jsx(be,{type:j?"text":"password",placeholder:"Confirm your new password",value:h,onChange:M=>f(M.target.value),style:{paddingRight:40}}),t.jsx("button",{type:"button",className:"w-input-eye",onClick:()=>v(!j),"aria-label":j?"Hide confirm password":"Show confirm password",children:j?t.jsx(Sn,{size:16}):t.jsx(Nn,{size:16})})]}),_.confirmPassword&&t.jsx("span",{className:"w-input-err",children:_.confirmPassword})]}),_.form&&t.jsx("span",{className:"w-input-err",children:_.form})]}),t.jsxs("div",{className:"w-pop-foot",children:[t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:e,children:"Cancel"}),t.jsx("button",{className:"w-btn w-btn--primary w-btn--sm",style:{width:"auto"},onClick:E,disabled:k,children:k?n?"Setting...":"Updating...":n?"Set Password":"Update Password"})]})]}):null},N6=({onClose:e,onRemovePassword:a,triggerRef:s})=>{const n=o.useRef(null),[i,l]=o.useState(!1),[m,c]=o.useState(""),[d,p]=o.useState(!1),{toast:u}=ta(),h=bt({contentRef:n,triggerRef:s??{current:null},isOpen:i,minWidth:400,defaultMaxHeight:360});o.useEffect(()=>{l(!0);const g=w=>{n.current&&!n.current.contains(w.target)&&e()},x=w=>{w.key==="Escape"&&e()};return document.addEventListener("mousedown",g),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",x)}},[e]);const f=async()=>{if(!(!m||d)){p(!0);try{await a(m),e()}catch(g){const x=g.message||"Failed to remove password. Please try again.";u(x,"error")}finally{p(!1)}}};return i?t.jsxs("div",{ref:n,className:"w-pop",style:{position:"fixed",zIndex:1001,maxWidth:"calc(100vw - 24px)",top:(h==null?void 0:h.top)!==void 0?`${h.top}px`:void 0,bottom:(h==null?void 0:h.bottom)!==void 0?`${h.bottom}px`:void 0,left:(h==null?void 0:h.left)!==void 0?`${h.left}px`:void 0,right:(h==null?void 0:h.right)!==void 0?`${h.right}px`:void 0,maxHeight:h!=null&&h.maxHeight?`${h.maxHeight}px`:void 0,visibility:h?"visible":"hidden"},onClick:g=>g.stopPropagation(),children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsx("div",{className:"w-pop-title",children:"Remove Password"}),t.jsxs("div",{className:"w-banner w-banner--warn",children:[t.jsx(Fa,{size:16}),t.jsx("span",{className:"w-banner-txt",children:"You're about to remove password authentication from your account. Make sure you have another way to sign in (email, phone, social login, or passkey) before continuing."})]}),t.jsxs(We,{children:[t.jsx(Te,{htmlFor:"current-password",children:"Confirm your current password"}),t.jsx(be,{id:"current-password",type:"password",placeholder:"Enter current password",value:m,onChange:g=>c(g.target.value),autoFocus:!0})]})]}),t.jsxs("div",{className:"w-pop-foot",children:[t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:e,children:"Cancel"}),t.jsx("button",{className:"w-btn w-btn--danger-solid w-btn--sm",onClick:f,disabled:!m||d,children:d?"Removing...":"Remove Password"})]})]}):null},S6=({onClose:e,onSetupTOTP:a,onVerifyTOTP:s,triggerRef:n})=>{const i=o.useRef(null),[l,m]=o.useState("qr"),[c,d]=o.useState(""),[p,u]=o.useState(""),[h,f]=o.useState(["",""]),[g,x]=o.useState(!1),[w,b]=o.useState(!1),{toast:j}=ta(),v=bt({contentRef:i,triggerRef:n??{current:null},isOpen:w,minWidth:380,defaultMaxHeight:460});o.useEffect(()=>{b(!0);const N=C=>{i.current&&!i.current.contains(C.target)&&e()},_=C=>{C.key==="Escape"&&e()};return document.addEventListener("mousedown",N),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",_)}},[e]),o.useEffect(()=>{(async()=>{x(!0);try{const _=await a();d(_.otp_url||""),u(_.totp_secret||"")}catch(_){const C=_.message||"Failed to setup two-factor authentication. Please try again.";j(C,"error")}finally{x(!1)}})()},[]);const k=async()=>{if(!h.some(N=>N.length!==6)){x(!0);try{await s(h),e()}catch(N){const _=N.message||"Failed to verify codes. Please check your authenticator app and try again.";j(_,"error")}finally{x(!1)}}};return w?t.jsx("div",{ref:i,className:"w-pop",style:{position:"fixed",zIndex:1001,width:340,maxWidth:"calc(100vw - 24px)",top:(v==null?void 0:v.top)!==void 0?`${v.top}px`:void 0,bottom:(v==null?void 0:v.bottom)!==void 0?`${v.bottom}px`:void 0,left:(v==null?void 0:v.left)!==void 0?`${v.left}px`:void 0,right:(v==null?void 0:v.right)!==void 0?`${v.right}px`:void 0,maxHeight:v!=null&&v.maxHeight?`${v.maxHeight}px`:void 0,visibility:v?"visible":"hidden"},onClick:N=>N.stopPropagation(),children:l==="qr"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-pop-title",children:"Setup Two-Factor Authentication"}),t.jsx("p",{className:"w-pop-sub",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"})]}),t.jsx("div",{className:"w-flex w-justify-center",children:g?t.jsx("div",{className:"w-qr w-text-muted",children:"Loading..."}):c?t.jsx("div",{className:"w-qr",style:{background:"#fff",padding:8},children:t.jsx(zr,{value:c,size:130,title:"QR Code for Two-Factor Authentication Setup","aria-label":"Scan this QR code with your authenticator app to set up two-factor authentication"})}):t.jsx("div",{className:"w-qr w-text-error",children:"QR Code Not Available"})}),p&&t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("span",{className:"w-secsub",children:"Or enter manually:"}),t.jsx("div",{className:"w-token",children:t.jsx("code",{style:{wordBreak:"break-all"},children:p})})]})]}),t.jsx("div",{className:"w-pop-foot",children:t.jsx("button",{className:"w-btn w-btn--primary w-btn--sm",style:{width:"auto"},onClick:()=>m("verify"),disabled:g||!c,children:"I've Scanned the Code"})})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-pop-title",children:"Verify Your Authenticator"}),t.jsx("p",{className:"w-pop-sub",children:"Enter two consecutive codes from your authenticator app"})]}),t.jsxs("div",{className:"w-flex w-gap-2",children:[t.jsx(be,{id:"totp-code-1",type:"text",placeholder:"000000",value:h[0],onChange:N=>{const _=N.target.value.replace(/[^0-9]/g,"").substring(0,6);f([_,h[1]])},maxLength:6,style:{textAlign:"center",fontFamily:"var(--wa-font-mono)"},"aria-label":"First verification code from authenticator app"}),t.jsx(be,{id:"totp-code-2",type:"text",placeholder:"000000",value:h[1],onChange:N=>{const _=N.target.value.replace(/[^0-9]/g,"").substring(0,6);f([h[0],_])},maxLength:6,style:{textAlign:"center",fontFamily:"var(--wa-font-mono)"},"aria-label":"Second verification code from authenticator app"})]})]}),t.jsxs("div",{className:"w-pop-foot",children:[t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:()=>m("qr"),children:"Back"}),t.jsx("button",{className:"w-btn w-btn--primary w-btn--sm",style:{width:"auto"},onClick:k,disabled:g||h.some(N=>N.length!==6),children:g?"Verifying...":"Verify"})]})]})}):null},E6=({codes:e,onClose:a,onCopy:s,onDownload:n,triggerRef:i})=>{const l=o.useRef(null),[m,c]=o.useState(!1),d=bt({contentRef:l,triggerRef:i??{current:null},isOpen:m,minWidth:380,defaultMaxHeight:360});return o.useEffect(()=>{c(!0);const p=h=>{l.current&&!l.current.contains(h.target)&&a()},u=h=>{h.key==="Escape"&&a()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",u)}},[a]),m?t.jsx("div",{ref:l,className:"w-pop",style:{position:"fixed",zIndex:1001,width:380,maxWidth:"calc(100vw - 24px)",top:(d==null?void 0:d.top)!==void 0?`${d.top}px`:void 0,bottom:(d==null?void 0:d.bottom)!==void 0?`${d.bottom}px`:void 0,left:(d==null?void 0:d.left)!==void 0?`${d.left}px`:void 0,right:(d==null?void 0:d.right)!==void 0?`${d.right}px`:void 0,maxHeight:d!=null&&d.maxHeight?`${d.maxHeight}px`:void 0,visibility:d?"visible":"hidden"},onClick:p=>p.stopPropagation(),children:t.jsxs("div",{className:"w-pop-body",children:[t.jsxs("div",{className:"w-flex w-items-center w-justify-between w-gap-2",children:[t.jsx("div",{className:"w-pop-title",children:"Backup Codes"}),t.jsxs("div",{className:"w-flex w-gap-2 w-none",children:[t.jsxs(se,{$outline:!0,$size:"sm",onClick:s,children:[t.jsx(Ga,{size:14}),"Copy"]}),t.jsxs(se,{$outline:!0,$size:"sm",onClick:n,children:[t.jsx(ll,{size:14}),"DownloadSimple"]})]})]}),t.jsx("p",{className:"w-pop-sub",children:"Save these backup codes in a secure location. Each code can only be used once."}),t.jsx("div",{className:"w-codes",children:e.map((p,u)=>t.jsx("span",{role:"button",style:{cursor:"pointer"},onClick:()=>{navigator.clipboard.writeText(p)},title:"Click to copy",children:p},u))}),t.jsxs("div",{className:"w-banner w-banner--warn",children:[t.jsx("span",{style:{fontSize:13.5},children:"⚠️"}),t.jsx("span",{className:"w-banner-txt",children:"Keep these codes safe! They won't be shown again."})]})]})}):null},A6=({onClose:e,onAddPasskey:a,triggerRef:s})=>{const n=o.useRef(null),[i,l]=o.useState(!1),[m,c]=o.useState(""),[d,p]=o.useState(!1),[u,h]=o.useState(""),f=bt({contentRef:n,triggerRef:s??{current:null},isOpen:i,minWidth:320,defaultMaxHeight:260});o.useEffect(()=>{l(!0);const x=b=>{n.current&&!n.current.contains(b.target)&&e()},w=b=>{b.key==="Escape"&&e()};return document.addEventListener("mousedown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",w)}},[e]);const g=async()=>{if(!d){p(!0),h("");try{await a(m.trim()),e()}catch(x){h(x.message||"Failed to register passkey"),p(!1)}}};return i?t.jsxs("div",{ref:n,className:"w-pop",style:{position:"fixed",zIndex:1001,maxWidth:"calc(100vw - 24px)",top:(f==null?void 0:f.top)!==void 0?`${f.top}px`:void 0,bottom:(f==null?void 0:f.bottom)!==void 0?`${f.bottom}px`:void 0,left:(f==null?void 0:f.left)!==void 0?`${f.left}px`:void 0,right:(f==null?void 0:f.right)!==void 0?`${f.right}px`:void 0,maxHeight:f!=null&&f.maxHeight?`${f.maxHeight}px`:void 0,visibility:f?"visible":"hidden"},onClick:x=>x.stopPropagation(),children:[t.jsxs("div",{className:"w-pop-body",children:[t.jsx("div",{className:"w-pop-title",children:"Add Passkey"}),t.jsx(be,{type:"text",placeholder:"e.g., MacBook Pro, iPhone",value:m,onChange:x=>c(x.target.value),autoFocus:!0}),u&&t.jsx("span",{className:"w-input-err",children:u})]}),t.jsxs("div",{className:"w-pop-foot",children:[t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:e,children:"Cancel"}),t.jsx("button",{className:"w-btn w-btn--primary w-btn--sm",style:{width:"auto"},onClick:g,disabled:d,children:d?"Registering...":"Continue"})]})]}):null},M6=({children:e})=>t.jsx("div",{className:"w-eyebrow",children:e}),R6=()=>{var aa,sa,na,ra,oe,xe,Ne;const{deployment:e}=ke(),{user:a,updatePassword:s,removePassword:n,setupAuthenticator:i,verifyAuthenticator:l,deleteAuthenticator:m,generateBackupCodes:c,regenerateBackupCodes:d,updateProfile:p,getPasskeys:u,registerPasskey:h,deletePasskey:f}=xa(),{toast:g}=ta(),[x,w]=o.useState((a==null?void 0:a.second_factor_policy)||"none"),[b,j]=o.useState(!1),v=async J=>{try{await p({second_factor_policy:J}),w(J),g("2FA requirement updated successfully","info")}catch(ve){g(ve.message||"Failed to update 2FA requirement","error")}},[k,N]=o.useState(!1),[_,C]=o.useState(!1),[y,E]=o.useState(!1),[M,F]=o.useState(!1),A=o.useRef(null),T=o.useRef(null),P=o.useRef(null),S=o.useRef(null),[$,H]=o.useState([]),[R,O]=o.useState(!1),[Z,L]=o.useState(!1),[U,D]=o.useState(!1),[Y,B]=o.useState(!1),[Q,ue]=o.useState(null),we=o.useRef(null),[ne,ae]=o.useState("table"),[re,Me]=o.useState(""),[q,tt]=o.useState(""),[Ie,De]=o.useState(""),[Ee,ce]=o.useState(["",""]),[W,G]=o.useState([]),[K,V]=o.useState(!1),[de,z]=o.useState(!1),[le]=o.useState(!1),[Je,ot]=o.useState(!1),ge=(aa=e==null?void 0:e.auth_settings)==null?void 0:aa.auth_factors_enabled,lt=(na=(sa=e==null?void 0:e.auth_settings)==null?void 0:sa.password)==null?void 0:na.enabled;if(!(ge!=null&&ge.authenticator)&&!(ge!=null&&ge.backup_code)&&!lt)return null;const Ke=async(J,ve)=>{await s(J,ve),await a.refetch(),g("Password updated successfully","info")},ee=async J=>{await n(J),await a.refetch(),g("Password removed successfully","info")},ie=()=>{var _t,Be,wt,Bt,ia,oa;if(!a)return!1;const J=(_t=a.user_email_addresses)==null?void 0:_t.some(la=>la.verified),ve=(Be=a.user_phone_numbers)==null?void 0:Be.some(la=>la.verified),Ye=a.social_connections&&a.social_connections.length>0,Ve=e==null?void 0:e.auth_settings;return(Ve==null?void 0:Ve.first_factor)==="email_otp"&&J||((wt=Ve==null?void 0:Ve.magic_link)==null?void 0:wt.enabled)&&J||((Bt=Ve==null?void 0:Ve.passkey)==null?void 0:Bt.enabled)||((ia=Ve==null?void 0:Ve.auth_factors_enabled)==null?void 0:ia.phone_otp)&&ve||Ye&&((oa=e==null?void 0:e.social_connections)==null?void 0:oa.some(la=>la.enabled))},me=async()=>{if(Ee.some(J=>J.length!==6)){g("Please enter both 6-digit verification codes","error");return}try{if(z(!0),await l(Ie,Ee),await a.refetch(),ge!=null&&ge.backup_code){const J=await c();G(J),await a.refetch(),ae("backup")}else ae("success")}catch(J){g(J.message||"Invalid verification codes","error")}finally{z(!1)}},Ze=()=>{ae("table"),Me(""),tt(""),De(""),ce(["",""]),G([]),g("Two-factor authentication setup completed successfully!","info")},He=async()=>{var J;if((J=a==null?void 0:a.user_authenticator)!=null&&J.id)try{ot(!0),await m(a.user_authenticator.id),await a.refetch(),j(!1),g("Two-factor authentication removed successfully","info")}catch(ve){g(ve.message||"Failed to remove authenticator","error")}finally{ot(!1)}},Ge=async()=>{if(!K)try{V(!0);const J=await d();G(J),await a.refetch(),F(!0),g("New backup codes generated","info")}catch(J){g(J.message||"Failed to generate backup codes","error")}finally{V(!1)}},ct=()=>{const J=W.join(`
117
117
  `);navigator.clipboard.writeText(J).then(()=>{g("Backup codes copied to clipboard","info")}).catch(()=>{g("Failed to copy backup codes","error")})},Rt=()=>{const J=W.join(`
118
- `),ve=new Blob([J],{type:"text/plain"}),Ye=URL.createObjectURL(ve),Ve=document.createElement("a");Ve.href=Ye,Ve.download="wacht-backup-codes.txt",Ve.click(),URL.revokeObjectURL(Ye),g("Backup codes downloaded","info")},Wt=async()=>{var J,ve;if((ve=(J=e==null?void 0:e.auth_settings)==null?void 0:J.passkey)!=null&&ve.enabled)try{O(!0);const Ye=await u();H(Ye.data||[])}catch{g("Failed to load passkeys","error")}finally{O(!1)}},ba=async J=>{try{L(!0),await h(J||void 0),await Wt(),g("Passkey registered successfully!","info")}catch(ve){throw g(ve.message||"Failed to register passkey","error"),ve}finally{L(!1)}},ya=async J=>{try{await f(J),await Wt(),g("Passkey removed","info")}catch(ve){g(ve.message||"Failed to remove passkey","error")}};o.useEffect(()=>{Wt()},[(oe=(ra=e==null?void 0:e.auth_settings)==null?void 0:ra.passkey)==null?void 0:oe.enabled]);const yt=[];return lt&&yt.push({id:"password",name:"Password",description:"Secure your account with a strong password",status:a!=null&&a.has_password?"Enabled":"Disabled",actions:a!=null&&a.has_password?["change"]:["setup"],group:"sign-in"}),(Ne=(xe=e==null?void 0:e.auth_settings)==null?void 0:xe.passkey)!=null&&Ne.enabled&&yt.push({id:"passkey",name:"Passkeys",description:"Sign in faster with fingerprint, face, or screen lock",status:$.length>0?`${$.length} registered`:"",actions:$.length>0?["manage","add"]:["add"],group:"sign-in"}),ge!=null&&ge.authenticator&&yt.push({id:"authenticator",name:"Authenticator App",description:"Use an authenticator app for extra security",status:a!=null&&a.user_authenticator?"Enabled":"Disabled",actions:a!=null&&a.user_authenticator?["remove"]:["setup"],group:"sign-in"}),a!=null&&a.user_authenticator&&yt.push({id:"backup_codes",name:"Backup Codes",description:"Recovery codes if you lose your authenticator",status:a!=null&&a.backup_codes_generated?"Generated":"Not Generated",actions:["generate"],group:"recovery"}),a!=null&&a.user_authenticator&&yt.push({id:"second_factor_policy",name:"Require 2FA",description:"Require a second factor for all sign-ins",status:x==="enforced"?"Enforced":"Optional",actions:["toggle"],group:"recovery"}),ne!=="table"?t.jsxs(t.Fragment,{children:[t.jsxs(d0,{children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-3",children:[t.jsx(Xt,{size:16}),t.jsxs("span",{className:"w-sec",children:[ne==="qr"&&"Setup Two-Factor Authentication",ne==="verify"&&"Verify Your Authenticator",ne==="backup"&&"Save Your Backup Codes",ne==="success"&&"Setup Complete!"]})]}),t.jsx(se,{$outline:!0,$size:"sm",onClick:()=>ae("table"),children:"← Back"})]}),t.jsxs("div",{className:"w-narrow w-flex-col w-items-center w-gap-5",style:{textAlign:"center"},children:[ne==="qr"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"w-secsub",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),t.jsx("div",{className:"w-flex w-justify-center",children:le?t.jsxs("div",{className:"w-qr w-flex-col w-items-center w-gap-3",children:[t.jsx("span",{className:"w-spin"}),t.jsx("div",{className:"w-secsub",children:"Loading QR Code..."})]}):re?t.jsx("div",{className:"w-tile w-flex w-items-center w-justify-center",children:t.jsx(zr,{value:re,size:200,level:"M",marginSize:0})}):t.jsx("div",{className:"w-qr w-text-error",children:"QR Code Not Available"})}),t.jsxs("div",{className:"w-flex-col w-gap-2 w-full",children:[t.jsx("p",{className:"w-secsub",children:"Or enter this code manually:"}),t.jsx("div",{className:"w-token",children:t.jsx("code",{children:q||"Loading..."})})]}),t.jsx(se,{$fullWidth:!0,onClick:()=>ae("verify"),disabled:!re||!q,children:"I've Scanned the Code"})]}),ne==="verify"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"w-secsub",children:"Enter two consecutive codes from your authenticator app to verify setup"}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(be,{type:"text",placeholder:"000000",value:Ee[0],onChange:J=>{const ve=J.target.value.replace(/[^0-9]/g,"").substring(0,6);ce([ve,Ee[1]])},maxLength:6,style:{textAlign:"center",fontFamily:"monospace"}}),t.jsx(be,{type:"text",placeholder:"000000",value:Ee[1],onChange:J=>{const ve=J.target.value.replace(/[^0-9]/g,"").substring(0,6);ce([Ee[0],ve])},maxLength:6,style:{textAlign:"center",fontFamily:"monospace"}})]}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(se,{$outline:!0,$size:"sm",onClick:()=>ae("qr"),children:"Back"}),t.jsx(se,{$size:"sm",onClick:me,disabled:de||Ee.some(J=>J.length!==6),children:de?"Verifying...":"Verify & Continue"})]})]}),ne==="backup"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-banner w-banner--warn",style:{textAlign:"left"},children:[t.jsx(Fa,{size:16}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-sec",children:"Important!"}),t.jsx("div",{className:"w-banner-txt",children:"Store these codes safely. Each code can only be used once if you lose access to your authenticator device."})]})]}),t.jsx("div",{className:"w-codes w-full",children:W.map((J,ve)=>t.jsx("span",{onClick:()=>navigator.clipboard.writeText(J),style:{cursor:"pointer"},children:J},ve))}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(se,{$outline:!0,$size:"sm",onClick:ct,children:"Copy All"}),t.jsxs(se,{$outline:!0,$size:"sm",onClick:Rt,children:[t.jsx(ll,{size:16}),"DownloadSimple"]})]}),t.jsx(se,{$fullWidth:!0,onClick:Ze,children:"Complete Setup"})]}),ne==="success"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-success",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(qe,{size:26})})]}),t.jsxs("div",{className:"w-flex-col w-gap-1 w-items-center",children:[t.jsx("h3",{className:"w-title",children:"All Set!"}),t.jsx("p",{className:"w-secsub",children:"Your account is now protected with two-factor authentication."})]}),t.jsx(se,{$fullWidth:!0,onClick:Ze,children:"Continue to Security"})]})]})]}):t.jsx(t.Fragment,{children:yt.length?t.jsx("div",{children:yt.map((J,ve)=>{const Ye=ve>0?yt[ve-1].group:null,Ve=J.group!==Ye,jt=yt[ve+1],_t=jt&&jt.group===J.group;return t.jsxs("div",{children:[Ve&&t.jsx(M6,{$first:ve===0,children:J.group==="sign-in"?"Sign-in methods":"Recovery"}),t.jsxs(u0,{children:[t.jsxs(m0,{children:[t.jsx("div",{className:"w-flex w-items-center w-wrap w-gap-2 w-sec",children:t.jsx("span",{children:J.name})}),t.jsx("div",{className:"w-secsub",children:J.description})]}),t.jsx(p0,{children:t.jsxs("div",{className:"w-relative",children:[J.id==="password"&&t.jsx(t.Fragment,{children:a!=null&&a.has_password?t.jsxs("div",{className:"w-flex w-gap-2",children:[t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:T,onClick:()=>C(!0),children:"Change"}),_&&t.jsx(Gi,{triggerRef:T,onClose:()=>C(!1),onChangePassword:Ke})]}),ie()&&t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",ref:P,onClick:()=>E(!0),children:"Remove"}),y&&t.jsx(N6,{triggerRef:P,onClose:()=>E(!1),onRemovePassword:ee})]})]}):t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:T,onClick:()=>C(!0),children:"Setup"}),_&&t.jsx(Gi,{triggerRef:T,onClose:()=>C(!1),onChangePassword:Ke,isSetup:!0})]})}),J.id==="authenticator"&&!(a!=null&&a.user_authenticator)&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:A,onClick:()=>N(!0),disabled:le,children:le?"Setting up...":"Setup"}),k&&t.jsx(S6,{triggerRef:A,onClose:()=>N(!1),onSetupTOTP:async()=>{const Be=await i();return De(Be.id),Be},onVerifyTOTP:async Be=>{await l(Ie,Be),await a.refetch(),g("Two-factor authentication enabled successfully!","info")}})]})}),J.id==="authenticator"&&(a==null?void 0:a.user_authenticator)&&t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",onClick:()=>j(!0),disabled:Je,children:Je?"Removing...":"Remove"}),b&&t.jsx(Qa,{title:"Remove MFA and reset policy to default?",onConfirm:He,onCancel:()=>j(!1)})]}),J.id==="backup_codes"&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:S,onClick:Ge,disabled:K,children:K?"Generating...":a!=null&&a.backup_codes_generated?"Regenerate":"Generate"}),M&&t.jsx(E6,{triggerRef:S,codes:W,onClose:()=>F(!1),onCopy:ct,onDownload:Rt})]})}),J.id==="second_factor_policy"&&t.jsx(Za,{checked:x==="enforced",onChange:Be=>{v(Be?"enforced":"none")}}),J.id==="passkey"&&t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[t.jsxs(se,{$outline:!0,$size:"sm",onClick:()=>D(!U),children:[U?"Hide":"Manage"," ","(",$.length,")",t.jsx(Ut,{size:14,style:{transform:U?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]}),t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:we,onClick:()=>B(!0),disabled:Z,children:Z?"Adding...":"Add"}),Y&&t.jsx(A6,{triggerRef:we,onClose:()=>B(!1),onAddPasskey:ba})]})]})]})})]}),J.id==="passkey"&&U&&t.jsx("div",{className:"w-flex-col w-gap-2",children:R?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):$.length===0?t.jsx("div",{className:"w-empty",children:t.jsx("p",{children:"No passkeys registered yet"})}):t.jsx("div",{className:"w-flex-col w-gap-2",children:$.map(Be=>t.jsxs("div",{className:"w-locked w-flex w-items-center w-justify-between",style:{height:"auto",padding:"10px 12px"},children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("span",{className:"w-sec",children:Be.name||"Unnamed Passkey"}),t.jsxs("span",{className:"w-secsub",children:[Be.device_type==="platform"?"This device":"Security key",Be.last_used_at&&` • Last used ${new Date(Be.last_used_at).toLocaleDateString()}`]})]}),t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",onClick:()=>ue(Be.id),children:"Remove"}),Q===Be.id&&t.jsx(Qa,{title:`Remove "${Be.name||"Unnamed Passkey"}"?`,onConfirm:()=>{ya(Be.id),ue(null)},onCancel:()=>ue(null)})]})]},Be.id))})}),_t&&t.jsx("div",{className:"w-hr"})]},J.id)})}):t.jsx(Nt,{title:"No security features available",description:"Contact your administrator to enable security features."})})},L6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",...e,children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"a",x1:3.217,x2:44.781,y1:15,y2:15,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#d93025"}),t.jsx("stop",{offset:1,stopColor:"#ea4335"})]}),t.jsxs("linearGradient",{id:"b",x1:20.722,x2:41.504,y1:47.679,y2:11.684,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#fcc934"}),t.jsx("stop",{offset:1,stopColor:"#fbbc04"})]}),t.jsxs("linearGradient",{id:"c",x1:26.598,x2:5.816,y1:46.502,y2:10.506,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#1e8e3e"}),t.jsx("stop",{offset:1,stopColor:"#34a853"})]})]}),t.jsx("circle",{cx:24,cy:23.995,r:12,style:{fill:"#fff"}}),t.jsx("path",{d:"M3.215 36A24 24 0 1 0 12 3.215 24 24 0 0 0 3.215 36Zm31.177-18A12 12 0 1 1 18 13.608 12 12 0 0 1 34.392 18Z",style:{fill:"none"}}),t.jsx("path",{d:"M24 12h20.781a23.994 23.994 0 0 0-41.564.003L13.607 30l.01-.002A11.985 11.985 0 0 1 24 12Z",style:{fill:"url(#a)"}}),t.jsx("circle",{cx:24,cy:24,r:9.5,style:{fill:"#1a73e8"}}),t.jsx("path",{d:"M34.391 30.003 24.001 48A23.994 23.994 0 0 0 44.78 12.003H23.999l-.003.01a11.985 11.985 0 0 1 10.395 17.99Z",style:{fill:"url(#b)"}}),t.jsx("path",{d:"M13.609 30.003 3.218 12.006A23.994 23.994 0 0 0 24.003 48l10.39-17.997-.007-.007a11.985 11.985 0 0 1-20.777.007Z",style:{fill:"url(#c)"}})]}),P6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:512,height:512,viewBox:"0 0 512 512",...e,children:[t.jsxs("defs",{children:[t.jsxs("radialGradient",{id:"g",cx:"210%",cy:"-100%",r:"290%",children:[t.jsx("stop",{offset:.1,stopColor:"#ffe226"}),t.jsx("stop",{offset:.79,stopColor:"#ff7139"})]}),t.jsxs("radialGradient",{id:"c",cx:"49%",cy:"40%",r:"128%",gradientTransform:"matrix(.82 0 0 1 .088 0)",children:[t.jsx("stop",{offset:.3,stopColor:"#960e18"}),t.jsx("stop",{offset:.35,stopColor:"#b11927",stopOpacity:.74}),t.jsx("stop",{offset:.43,stopColor:"#db293d",stopOpacity:.34}),t.jsx("stop",{offset:.5,stopColor:"#f5334b",stopOpacity:.09}),t.jsx("stop",{offset:.53,stopColor:"#ff3750",stopOpacity:0})]}),t.jsxs("radialGradient",{id:"d",cx:"48%",cy:"-12%",r:"140%",children:[t.jsx("stop",{offset:.13,stopColor:"#fff44f"}),t.jsx("stop",{offset:.53,stopColor:"#ff980e"})]}),t.jsxs("radialGradient",{id:"e",cx:"22.76%",cy:"110.11%",r:"100%",children:[t.jsx("stop",{offset:.35,stopColor:"#3a8ee6"}),t.jsx("stop",{offset:.67,stopColor:"#9059ff"}),t.jsx("stop",{offset:1,stopColor:"#c139e6"})]}),t.jsxs("radialGradient",{id:"f",cx:"52%",cy:"33%",r:"59%",gradientTransform:"scale(.9 1)",children:[t.jsx("stop",{offset:.21,stopColor:"#9059ff",stopOpacity:0}),t.jsx("stop",{offset:.97,stopColor:"#6e008b",stopOpacity:.6})]}),t.jsxs("radialGradient",{id:"b",cx:"87.4%",cy:"-12.9%",r:"128%",gradientTransform:"matrix(.8 0 0 1 .178 .129)",children:[t.jsx("stop",{offset:.13,stopColor:"#ffbd4f"}),t.jsx("stop",{offset:.28,stopColor:"#ff980e"}),t.jsx("stop",{offset:.47,stopColor:"#ff3750"}),t.jsx("stop",{offset:.78,stopColor:"#eb0878"}),t.jsx("stop",{offset:.86,stopColor:"#e50080"})]}),t.jsxs("radialGradient",{id:"h",cx:"84%",cy:"-41%",r:"180%",children:[t.jsx("stop",{offset:.11,stopColor:"#fff44f"}),t.jsx("stop",{offset:.46,stopColor:"#ff980e"}),t.jsx("stop",{offset:.72,stopColor:"#ff3647"}),t.jsx("stop",{offset:.9,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"i",cx:"16.1%",cy:"-18.6%",r:"348.8%",gradientTransform:"scale(1 .47) rotate(84 .279 -.297)",children:[t.jsx("stop",{offset:0,stopColor:"#fff44f"}),t.jsx("stop",{offset:.3,stopColor:"#ff980e"}),t.jsx("stop",{offset:.57,stopColor:"#ff3647"}),t.jsx("stop",{offset:.74,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"j",cx:"18.9%",cy:"-42.5%",r:"238.4%",children:[t.jsx("stop",{offset:.14,stopColor:"#fff44f"}),t.jsx("stop",{offset:.48,stopColor:"#ff980e"}),t.jsx("stop",{offset:.66,stopColor:"#ff3647"}),t.jsx("stop",{offset:.9,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"k",cx:"159.3%",cy:"-44.72%",r:"313.1%",children:[t.jsx("stop",{offset:.09,stopColor:"#fff44f"}),t.jsx("stop",{offset:.63,stopColor:"#ff980e"})]}),t.jsxs("linearGradient",{id:"a",x1:"87.25%",x2:"9.4%",y1:"15.5%",y2:"93.1%",children:[t.jsx("stop",{offset:.05,stopColor:"#fff44f"}),t.jsx("stop",{offset:.37,stopColor:"#ff980e"}),t.jsx("stop",{offset:.53,stopColor:"#ff3647"}),t.jsx("stop",{offset:.7,stopColor:"#e31587"})]}),t.jsxs("linearGradient",{id:"l",x1:"80%",x2:"18%",y1:"14%",y2:"84%",children:[t.jsx("stop",{offset:.17,stopColor:"#fff44f",stopOpacity:.8}),t.jsx("stop",{offset:.6,stopColor:"#fff44f",stopOpacity:0})]})]}),t.jsx("path",{fill:"url(#a)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0 .039.015.136.047.4C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484a120.249 120.249 0 0 0-66.142 25.488 71.355 71.355 0 0 0-6.225-4.7 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.442 26.913c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-.212 1.061-.324 1.586-.452 2.116-2.08 12.7-2.365 15-.022.177-.032.347-.053.524a229.066 229.066 0 0 0-3.9 33.157c0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746zM201.716 354.447c1.124.537 2.18 1.124 3.334 1.639.048.033.114.07.163.1a126.191 126.191 0 0 1-3.497-1.739zm55.053-144.93zm198.131-30.59-.032-.233c.012.085.027.174.04.259z"}),t.jsx("path",{fill:"url(#b)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0-.058.011.048.036.226.012.085.027.174.04.259 22.675 61.47 10.322 123.978-7.479 162.175-27.539 59.1-94.215 119.67-198.576 116.716C136.1 454.651 36.766 370.988 18.223 261.41c-3.379-17.28 0-26.054 1.7-40.084-2.071 10.816-2.86 13.94-3.9 33.157 0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746z"}),t.jsx("path",{fill:"url(#c)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0-.058.011.048.036.226.012.085.027.174.04.259 22.675 61.47 10.322 123.978-7.479 162.175-27.539 59.1-94.215 119.67-198.576 116.716C136.1 454.651 36.766 370.988 18.223 261.41c-3.379-17.28 0-26.054 1.7-40.084-2.071 10.816-2.86 13.94-3.9 33.157 0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746z"}),t.jsx("path",{fill:"url(#d)",d:"M361.922 194.6c.524.368 1 .734 1.493 1.1a130.706 130.706 0 0 0-22.31-29.112C266.4 91.892 321.516 4.626 330.811.194c.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484 2.8-.194 5.592-.429 8.442-.429 45.051 0 84.289 24.77 105.301 61.487z"}),t.jsx("path",{fill:"url(#e)",d:"M256.772 209.514c-.393 5.978-21.514 26.593-28.9 26.593-68.339 0-79.432 41.335-79.432 41.335 3.027 34.81 27.261 63.475 56.611 78.643 1.339.692 2.694 1.317 4.05 1.935a132.768 132.768 0 0 0 7.059 2.886 106.743 106.743 0 0 0 31.271 6.031c119.78 5.618 142.986-143.194 56.545-186.408 22.137-3.85 45.115 5.053 57.947 14.067-21.012-36.714-60.25-61.484-105.3-61.484-2.85 0-5.641.235-8.442.429a120.249 120.249 0 0 0-66.142 25.488c3.664 3.1 7.8 7.244 16.514 15.828 16.302 16.067 58.13 32.705 58.219 34.657z"}),t.jsx("path",{fill:"url(#f)",d:"M256.772 209.514c-.393 5.978-21.514 26.593-28.9 26.593-68.339 0-79.432 41.335-79.432 41.335 3.027 34.81 27.261 63.475 56.611 78.643 1.339.692 2.694 1.317 4.05 1.935a132.768 132.768 0 0 0 7.059 2.886 106.743 106.743 0 0 0 31.271 6.031c119.78 5.618 142.986-143.194 56.545-186.408 22.137-3.85 45.115 5.053 57.947 14.067-21.012-36.714-60.25-61.484-105.3-61.484-2.85 0-5.641.235-8.442.429a120.249 120.249 0 0 0-66.142 25.488c3.664 3.1 7.8 7.244 16.514 15.828 16.302 16.067 58.13 32.705 58.219 34.657z"}),t.jsx("path",{fill:"url(#g)",d:"M170.829 151.036a244.042 244.042 0 0 1 4.981 3.3 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7 1.155-.033 36.014-.66 53.543 10.732z"}),t.jsx("path",{fill:"url(#h)",d:"M18.223 261.41C36.766 370.988 136.1 454.651 248.855 457.844c104.361 2.954 171.037-57.62 198.576-116.716 17.8-38.2 30.154-100.7 7.479-162.175l-.008-.026-.032-.233c-.025-.178-.04-.284-.036-.226 0 .039.015.136.047.4 8.524 55.661-19.79 109.584-64.051 146.044l-.133.313c-86.245 70.223-168.774 42.368-185.484 30.966a144.108 144.108 0 0 1-3.5-1.743c-50.282-24.029-71.054-69.838-66.6-109.124-42.457 0-56.934-35.809-56.934-35.809s38.119-27.179 88.358-3.541c46.53 21.893 90.228 3.543 90.233 3.541-.089-1.952-41.917-18.59-58.223-34.656-8.713-8.584-12.85-12.723-16.514-15.828a71.355 71.355 0 0 0-6.225-4.7 282.929 282.929 0 0 0-4.981-3.3c-17.528-11.392-52.388-10.765-53.543-10.735h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.442 26.919c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-8.65 37.842-4.44 57.199z"}),t.jsx("path",{fill:"url(#i)",d:"M341.105 166.587a130.706 130.706 0 0 1 22.31 29.112c1.323.994 2.559 1.985 3.608 2.952 54.482 50.2 25.936 121.2 23.807 126.26 44.261-36.46 72.575-90.383 64.051-146.044C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1-9.291 4.428-64.407 91.694 10.298 166.389z"}),t.jsx("path",{fill:"url(#j)",d:"M367.023 198.651c-1.049-.967-2.285-1.958-3.608-2.952-.489-.368-.969-.734-1.493-1.1-12.832-9.014-35.81-17.917-57.947-14.067 86.441 43.214 63.235 192.026-56.545 186.408a106.743 106.743 0 0 1-31.271-6.031 134.51 134.51 0 0 1-7.059-2.886c-1.356-.618-2.711-1.243-4.05-1.935.048.033.114.07.163.1 16.71 11.4 99.239 39.257 185.484-30.966l.133-.313c2.129-5.054 30.675-76.057-23.807-126.258z"}),t.jsx("path",{fill:"url(#k)",d:"M148.439 277.443s11.093-41.335 79.432-41.335c7.388 0 28.509-20.615 28.9-26.593s-43.7 18.352-90.233-3.541c-50.239-23.638-88.358 3.541-88.358 3.541s14.477 35.809 56.934 35.809c-4.453 39.286 16.319 85.1 66.6 109.124 1.124.537 2.18 1.124 3.334 1.639-29.348-15.169-53.582-43.834-56.609-78.644z"}),t.jsx("path",{fill:"url(#l)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0 .039.015.136.047.4C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484 2.8-.194 5.592-.429 8.442-.429 45.053 0 84.291 24.77 105.3 61.484-12.832-9.014-35.81-17.917-57.947-14.067 86.441 43.214 63.235 192.026-56.545 186.408a106.743 106.743 0 0 1-31.271-6.031 134.51 134.51 0 0 1-7.059-2.886c-1.356-.618-2.711-1.243-4.05-1.935.048.033.114.07.163.1a144.108 144.108 0 0 1-3.5-1.743c1.124.537 2.18 1.124 3.334 1.639-29.35-15.168-53.584-43.833-56.611-78.643 0 0 11.093-41.335 79.432-41.335 7.388 0 28.509-20.615 28.9-26.593-.089-1.952-41.917-18.59-58.223-34.656-8.713-8.584-12.85-12.723-16.514-15.828a71.355 71.355 0 0 0-6.225-4.7 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.435 26.916c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-.212 1.061-.324 1.586-.452 2.116-2.486 12.853-2.77 15.156-.022.177.021-.176 0 0a279.565 279.565 0 0 0-3.544 33.53c0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746zm-23.841 12.341c.012.085.027.174.04.259l-.008-.026-.032-.233z"})]}),$6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:250.076,height:248.707,viewBox:"0 0 66.166 65.804",...e,children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"b",children:[t.jsx("stop",{offset:0,stopColor:"#06c2e7"}),t.jsx("stop",{offset:.25,stopColor:"#0db8ec"}),t.jsx("stop",{offset:.5,stopColor:"#12aef1"}),t.jsx("stop",{offset:.75,stopColor:"#1f86f9"}),t.jsx("stop",{offset:1,stopColor:"#107ddd"})]}),t.jsxs("linearGradient",{id:"a",children:[t.jsx("stop",{offset:0,stopColor:"#bdbdbd"}),t.jsx("stop",{offset:1,stopColor:"#fff"})]}),t.jsx("linearGradient",{xlinkHref:"#a",id:"d",x1:412.975,x2:412.975,y1:237.608,y2:59.392,gradientTransform:"translate(206.79 159.773) scale(.35154)",gradientUnits:"userSpaceOnUse"}),t.jsx("filter",{id:"f",width:1.042,height:1.045,x:-.021,y:-.022,colorInterpolationFilters:"sRGB",children:t.jsx("feGaussianBlur",{stdDeviation:.958})}),t.jsx("filter",{id:"c",width:1.096,height:1.096,x:-.048,y:-.048,colorInterpolationFilters:"sRGB",children:t.jsx("feGaussianBlur",{stdDeviation:3.564})}),t.jsx("radialGradient",{xlinkHref:"#b",id:"e",cx:413.061,cy:136.818,r:82.125,fx:413.061,fy:136.818,gradientTransform:"translate(194.545 155.58) scale(.38143)",gradientUnits:"userSpaceOnUse"})]}),t.jsx("path",{d:"M502.083 148.5a89.108 89.108 0 0 1-89.108 89.108 89.108 89.108 0 0 1-89.108-89.108 89.108 89.108 0 0 1 89.108-89.108 89.108 89.108 0 0 1 89.108 89.108Z",filter:"url(#c)",opacity:.53,paintOrder:"markers stroke fill",transform:"matrix(.33865 0 0 .3261 -106.77 -14.478)"}),t.jsx("path",{fill:"url(#d)",stroke:"#cdcdcd",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.093,d:"M383.294 211.977a31.325 31.325 0 0 1-31.325 31.325 31.325 31.325 0 0 1-31.326-31.325 31.325 31.325 0 0 1 31.326-31.325 31.325 31.325 0 0 1 31.325 31.325z",paintOrder:"markers stroke fill",transform:"translate(-318.886 -180.595)"}),t.jsx("path",{fill:"url(#e)",d:"M380.84 211.977a28.87 28.87 0 0 1-28.871 28.87 28.87 28.87 0 0 1-28.871-28.87 28.87 28.87 0 0 1 28.87-28.87 28.87 28.87 0 0 1 28.871 28.87z",paintOrder:"markers stroke fill",transform:"translate(-318.886 -180.595)"}),t.jsx("path",{fill:"#f4f2f3",d:"M33.083 4.017a.42.42 0 0 0-.421.42v4.856a.42.42 0 1 0 .842 0V4.438a.42.42 0 0 0-.421-.421zm-2.754.174a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.087l-.212-2.03a.42.42 0 0 0-.377-.376zm5.527.002a.42.42 0 0 0-.377.375l-.214 2.03a.42.42 0 1 0 .837.089l.214-2.031a.42.42 0 0 0-.46-.463zM27.5 4.6a.42.42 0 0 0-.41.508l1.005 4.75a.42.42 0 1 0 .824-.174l-1.005-4.75A.42.42 0 0 0 27.5 4.6zm11.183.004a.42.42 0 0 0-.414.333l-1.009 4.75a.42.42 0 1 0 .824.175l1.009-4.75a.42.42 0 0 0-.41-.508zm-13.883.757a.42.42 0 0 0-.437.55l.632 1.942a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.365-.29zm16.568.001a.42.42 0 0 0-.364.29l-.632 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.436-.55zM22.13 6.34a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.972-4.437a.42.42 0 0 0-.393-.25zm21.937.015a.42.42 0 0 0-.392.25l-1.978 4.434a.42.42 0 1 0 .769.343l1.978-4.434a.42.42 0 0 0-.377-.593zM19.654 7.65a.42.42 0 0 0-.394.63l1.02 1.77a.42.42 0 1 0 .73-.421L19.989 7.86a.42.42 0 0 0-.335-.21zm26.858 0a.419.419 0 0 0-.335.21l-1.021 1.769a.42.42 0 1 0 .73.42l1.02-1.768a.42.42 0 0 0-.394-.63zm-29.265 1.5a.422.422 0 0 0-.326.669l2.85 3.93a.42.42 0 1 0 .682-.494l-2.85-3.93a.42.42 0 0 0-.356-.174zm31.702.022a.42.42 0 0 0-.356.174l-2.856 3.926a.42.42 0 1 0 .681.495l2.856-3.926a.42.42 0 0 0-.325-.669zm-33.852 1.783a.42.42 0 0 0-.335.702l1.366 1.518a.42.42 0 1 0 .626-.563l-1.366-1.518a.42.42 0 0 0-.291-.14zm35.975.003a.421.421 0 0 0-.29.139l-1.367 1.517a.42.42 0 1 0 .625.564l1.367-1.518a.42.42 0 0 0-.335-.702zm-38.037 1.977a.42.42 0 0 0-.26.733l3.61 3.249a.42.42 0 1 0 .563-.626l-3.609-3.248a.42.42 0 0 0-.304-.108zm40.109.014a.419.419 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .562.626l3.61-3.245a.42.42 0 0 0-.258-.734zm-41.823 2.19a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm43.535.015a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .495.681l1.653-1.2a.42.42 0 0 0-.262-.76zM9.72 17.49a.42.42 0 0 0-.18.785l4.204 2.427a.42.42 0 1 0 .42-.729L9.96 17.546a.42.42 0 0 0-.24-.056zm46.728 0a.417.417 0 0 0-.24.056l-4.205 2.427a.42.42 0 1 0 .42.73l4.206-2.428a.42.42 0 0 0-.181-.785zM8.508 19.996a.42.42 0 0 0-.18.806l1.866.832a.42.42 0 1 0 .343-.77l-1.866-.831a.42.42 0 0 0-.163-.037zm49.158.017a.42.42 0 0 0-.164.037l-1.865.83a.42.42 0 1 0 .342.77l1.866-.831a.42.42 0 0 0-.179-.806zM7.429 22.615a.42.42 0 0 0-.094.82l4.615 1.504a.42.42 0 1 0 .261-.8l-4.616-1.504a.421.421 0 0 0-.166-.02zm51.314.018a.408.408 0 0 0-.166.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.617-1.5a.42.42 0 0 0-.094-.82zM6.756 25.365a.42.42 0 0 0-.09.833l1.998.424a.42.42 0 1 0 .175-.823l-1.998-.425a.413.413 0 0 0-.085-.009zm52.655.004a.518.518 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zM6.247 28.13a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.829-.51a.432.432 0 0 0-.085 0zm53.676.037a.386.386 0 0 0-.085 0l-4.83.504a.42.42 0 1 0 .088.837l4.83-.504a.42.42 0 0 0-.003-.837zM6.165 30.96a.42.42 0 1 0 0 .842h2.043a.42.42 0 1 0 0-.842zm51.793 0a.42.42 0 1 0 0 .842h2.043a.42.42 0 1 0 0-.842zm-46.803 2.295a.384.384 0 0 0-.085 0l-4.83.504a.42.42 0 1 0 .088.838l4.83-.504a.42.42 0 0 0-.003-.838zm43.853.03a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.828-.51a.434.434 0 0 0-.086-.001zM8.748 36.13a.43.43 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zm48.67.004a.42.42 0 0 0-.09.833l1.997.424a.42.42 0 1 0 .175-.824l-1.998-.424a.413.413 0 0 0-.085-.01zM12.111 37.79a.408.408 0 0 0-.166.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.617-1.5a.42.42 0 0 0-.094-.82zm41.937.015a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.615-1.504a.421.421 0 0 0-.167-.02zM10.35 41.08a.42.42 0 0 0-.163.036l-1.866.831a.42.42 0 1 0 .342.769l1.866-.83a.42.42 0 0 0-.179-.806zm45.459.016a.42.42 0 0 0-.18.805l1.865.832a.42.42 0 1 0 .343-.769l-1.865-.832a.42.42 0 0 0-.163-.036zm-41.826.912a.417.417 0 0 0-.24.056L9.538 44.49a.42.42 0 1 0 .421.73l4.205-2.428a.42.42 0 0 0-.181-.785zm38.2 0a.42.42 0 0 0-.181.785l4.205 2.427a.42.42 0 1 0 .42-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm-39.249 3.562a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .495.682l1.653-1.2a.42.42 0 0 0-.262-.762zm40.288.015a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm-36.544.145a.418.418 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .562.626l3.61-3.245a.42.42 0 0 0-.258-.734zm32.8.011a.421.421 0 0 0-.26.734l3.609 3.248a.42.42 0 1 0 .563-.625l-3.608-3.249a.42.42 0 0 0-.304-.107zm-29.375 3.084a.42.42 0 0 0-.355.173l-2.856 3.927a.42.42 0 1 0 .68.495l2.857-3.926a.42.42 0 0 0-.326-.669zm25.936.018a.421.421 0 0 0-.326.668l2.85 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm-29.623.606a.421.421 0 0 0-.29.14l-1.367 1.517a.42.42 0 1 0 .625.563l1.367-1.517a.42.42 0 0 0-.335-.703zm33.331.002a.42.42 0 0 0-.335.702l1.366 1.518a.42.42 0 1 0 .626-.563l-1.366-1.518a.42.42 0 0 0-.291-.139zm-25.655 1.684a.419.419 0 0 0-.393.25l-1.978 4.433a.42.42 0 1 0 .77.343l1.977-4.434a.42.42 0 0 0-.376-.592zm17.955.012a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.972-4.437a.42.42 0 0 0-.393-.25zm-21.431 1.359a.419.419 0 0 0-.335.21l-1.021 1.768a.42.42 0 1 0 .729.421l1.02-1.769a.42.42 0 0 0-.393-.63zm24.934 0a.42.42 0 0 0-.394.63l1.021 1.77a.42.42 0 1 0 .73-.422l-1.022-1.769a.42.42 0 0 0-.335-.21zm-17.054.063a.42.42 0 0 0-.415.334l-1.009 4.749a.42.42 0 1 0 .824.175l1.009-4.75a.42.42 0 0 0-.41-.508zm9.16.003a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .823-.175l-1.006-4.75a.42.42 0 0 0-.414-.333zm-4.573.48a.42.42 0 0 0-.421.42v4.855a.42.42 0 1 0 .842 0v-4.855a.42.42 0 0 0-.421-.42zm-7.727 1.568a.42.42 0 0 0-.364.29l-.631 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.437-.55zm15.45 0a.42.42 0 0 0-.437.55l.632 1.943a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.365-.29zm-10.365 1.083a.42.42 0 0 0-.378.375l-.213 2.03a.42.42 0 1 0 .837.088l.214-2.03a.42.42 0 0 0-.46-.463zm5.267.002a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.088l-.212-2.03a.42.42 0 0 0-.377-.375z",paintOrder:"markers stroke fill"}),t.jsx("path",{d:"m469.096 100.607-65.51 38.061-41.42 65.207 60.595-44.882z",filter:"url(#f)",opacity:.409,paintOrder:"markers stroke fill",transform:"translate(-112.095 -20.822) scale(.35154)"}),t.jsx("path",{fill:"#ff5150",d:"m36.383 34.838-6.6-6.913 23.416-15.752z",paintOrder:"markers stroke fill"}),t.jsx("path",{fill:"#f1f1f1",d:"m36.383 34.838-6.6-6.913L12.966 50.59z",paintOrder:"markers stroke fill"}),t.jsx("path",{d:"m12.967 50.59 23.416-15.752L53.2 12.173z",opacity:.243})]}),O6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",...e,children:[t.jsxs("defs",{children:[t.jsxs("radialGradient",{id:"b",cx:161.8,cy:68.9,r:95.4,gradientTransform:"matrix(1 0 0 -.95 0 248.8)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:.7,stopOpacity:0}),t.jsx("stop",{offset:.9,stopOpacity:.5}),t.jsx("stop",{offset:1})]}),t.jsxs("radialGradient",{id:"d",cx:-340.3,cy:63,r:143.2,gradientTransform:"matrix(.15 -.99 -.8 -.12 176.6 -125.4)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:.8,stopOpacity:0}),t.jsx("stop",{offset:.9,stopOpacity:.5}),t.jsx("stop",{offset:1})]}),t.jsxs("radialGradient",{id:"e",cx:113.4,cy:570.2,r:202.4,gradientTransform:"matrix(-.04 1 2.13 .08 -1179.5 -106.7)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#35c1f1"}),t.jsx("stop",{offset:.1,stopColor:"#34c1ed"}),t.jsx("stop",{offset:.2,stopColor:"#2fc2df"}),t.jsx("stop",{offset:.3,stopColor:"#2bc3d2"}),t.jsx("stop",{offset:.7,stopColor:"#36c752"})]}),t.jsxs("radialGradient",{id:"f",cx:376.5,cy:568,r:97.3,gradientTransform:"matrix(.28 .96 .78 -.23 -303.8 -148.5)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#66eb6e"}),t.jsx("stop",{offset:1,stopColor:"#66eb6e",stopOpacity:0})]}),t.jsxs("linearGradient",{id:"a",x1:63.3,x2:241.7,y1:84,y2:84,gradientTransform:"matrix(1 0 0 -1 0 266)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#0c59a4"}),t.jsx("stop",{offset:1,stopColor:"#114a8b"})]}),t.jsxs("linearGradient",{id:"c",x1:157.3,x2:46,y1:161.4,y2:40.1,gradientTransform:"matrix(1 0 0 -1 0 266)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#1b9de2"}),t.jsx("stop",{offset:.2,stopColor:"#1595df"}),t.jsx("stop",{offset:.7,stopColor:"#0680d7"}),t.jsx("stop",{offset:1,stopColor:"#0078d4"})]})]}),t.jsx("path",{d:"M235.7 195.5a93.7 93.7 0 0 1-10.6 4.7 101.9 101.9 0 0 1-35.9 6.4c-47.3 0-88.5-32.5-88.5-74.3a31.5 31.5 0 0 1 16.4-27.3c-42.8 1.8-53.8 46.4-53.8 72.5 0 74 68.1 81.4 82.8 81.4 7.9 0 19.8-2.3 27-4.6l1.3-.4a128.3 128.3 0 0 0 66.6-52.8 4 4 0 0 0-5.3-5.6Z",style:{fill:"url(#a)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M235.7 195.5a93.7 93.7 0 0 1-10.6 4.7 101.9 101.9 0 0 1-35.9 6.4c-47.3 0-88.5-32.5-88.5-74.3a31.5 31.5 0 0 1 16.4-27.3c-42.8 1.8-53.8 46.4-53.8 72.5 0 74 68.1 81.4 82.8 81.4 7.9 0 19.8-2.3 27-4.6l1.3-.4a128.3 128.3 0 0 0 66.6-52.8 4 4 0 0 0-5.3-5.6Z",style:{isolation:"isolate",opacity:.35,fill:"url(#b)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M110.3 246.3A79.2 79.2 0 0 1 87.6 225a80.7 80.7 0 0 1 29.5-120c3.2-1.5 8.5-4.1 15.6-4a32.4 32.4 0 0 1 25.7 13 31.9 31.9 0 0 1 6.3 18.7c0-.2 24.5-79.6-80-79.6-43.9 0-80 41.6-80 78.2a130.2 130.2 0 0 0 12.1 56 128 128 0 0 0 156.4 67 75.5 75.5 0 0 1-62.8-8Z",style:{fill:"url(#c)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M110.3 246.3A79.2 79.2 0 0 1 87.6 225a80.7 80.7 0 0 1 29.5-120c3.2-1.5 8.5-4.1 15.6-4a32.4 32.4 0 0 1 25.7 13 31.9 31.9 0 0 1 6.3 18.7c0-.2 24.5-79.6-80-79.6-43.9 0-80 41.6-80 78.2a130.2 130.2 0 0 0 12.1 56 128 128 0 0 0 156.4 67 75.5 75.5 0 0 1-62.8-8Z",style:{opacity:.41,fill:"url(#d)",isolation:"isolate"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M157 153.8c-.9 1-3.4 2.5-3.4 5.6 0 2.6 1.7 5.2 4.8 7.3 14.3 10 41.4 8.6 41.5 8.6a59.6 59.6 0 0 0 30.3-8.3 61.4 61.4 0 0 0 30.4-52.9c.3-22.4-8-37.3-11.3-43.9C228 28.8 182.3 5 132.6 5a128 128 0 0 0-128 126.2c.5-36.5 36.8-66 80-66 3.5 0 23.5.3 42 10a72.6 72.6 0 0 1 30.9 29.3c6.1 10.6 7.2 24.1 7.2 29.5s-2.7 13.3-7.8 19.9Z",style:{fill:"url(#e)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M157 153.8c-.9 1-3.4 2.5-3.4 5.6 0 2.6 1.7 5.2 4.8 7.3 14.3 10 41.4 8.6 41.5 8.6a59.6 59.6 0 0 0 30.3-8.3 61.4 61.4 0 0 0 30.4-52.9c.3-22.4-8-37.3-11.3-43.9C228 28.8 182.3 5 132.6 5a128 128 0 0 0-128 126.2c.5-36.5 36.8-66 80-66 3.5 0 23.5.3 42 10a72.6 72.6 0 0 1 30.9 29.3c6.1 10.6 7.2 24.1 7.2 29.5s-2.7 13.3-7.8 19.9Z",style:{fill:"url(#f)"},transform:"translate(-4.6 -5)"})]}),Z6=e=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,role:"img","aria-label":"Opera",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"opera-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FF1B2D"}),t.jsx("stop",{offset:"50%",stopColor:"#CC0000"}),t.jsx("stop",{offset:"100%",stopColor:"#A02128"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"url(#opera-gradient)"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"6.5",ry:"8.5",fill:"none",stroke:"#fff",strokeWidth:"1.2",opacity:"0.9"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"3.5",ry:"5.5",fill:"#fff"}),t.jsx("path",{d:"M12 8.5c-1.4 0-2.5 1.6-2.5 3.5s1.1 3.5 2.5 3.5 2.5-1.6 2.5-3.5-1.1-3.5-2.5-3.5z",fill:"url(#opera-gradient)"})]}),H6=e=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,role:"img","aria-label":"Brave",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"brave-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FB542B"}),t.jsx("stop",{offset:"50%",stopColor:"#FF6B35"}),t.jsx("stop",{offset:"100%",stopColor:"#FF4500"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"url(#brave-gradient)"}),t.jsx("path",{d:"M12 3.5l1.5 2h2.5l-.8 3 1.3 2.5-2.5.8v2.7l-2-.7-2 .7v-2.7l-2.5-.8L8.8 8.5 8 5.5h2.5L12 3.5z",fill:"#fff"}),t.jsx("path",{d:"M12 6.5c-.8 0-1.5.7-1.5 1.5v3c0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5V8c0-.8-.7-1.5-1.5-1.5z",fill:"url(#brave-gradient)"}),t.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"url(#brave-gradient)"})]}),F6=()=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"w-text-secondary",children:[t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.6"}),t.jsx("circle",{cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.3"}),t.jsx("path",{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",fill:"currentColor",opacity:"0.5"}),t.jsx("circle",{cx:"12",cy:"12",r:"1",fill:"currentColor"}),t.jsx("text",{x:"12",y:"16.5",textAnchor:"middle",fill:"currentColor",fontSize:"6",opacity:"0.7",children:"?"})]}),T6=({browser:e})=>{const a=(e==null?void 0:e.toLowerCase())||"",s={width:20,height:20};return a.includes("chrome")?t.jsx(L6,{...s}):a.includes("firefox")?t.jsx(P6,{...s}):a.includes("safari")?t.jsx($6,{...s}):a.includes("edge")?t.jsx(O6,{...s}):a.includes("opera")?t.jsx(Z6,{...s}):a.includes("brave")?t.jsx(H6,{...s}):t.jsx(F6,{})},I6=()=>{const{signins:e,removeSignin:a,refetch:s,loading:n}=ko(),{refetch:i}=it(),{toast:l}=ta(),m=e,c=async p=>{try{await a(p),await Promise.all([s(),i()]),l("Session ended successfully","info")}catch(u){l(u.message||"Failed to end session. Please try again.","error")}},d=p=>{if(!p||p.trim()==="")return"Unknown";const u=new Date(p);if(isNaN(u.getTime()))return"Unknown";const f=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return f<1?"Just now":f<60?`${f}m ago`:f<1440?`${Math.floor(f/60)}h ago`:u.toLocaleDateString()};return n?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):t.jsx("div",{children:m&&m.length>0?t.jsx(t.Fragment,{children:t.jsx(hn,{children:t.jsxs(Zt,{children:[t.jsx(Ht,{children:t.jsxs(rt,{children:[t.jsx(Oe,{children:"Browser & Device"}),t.jsx(Oe,{children:"Location"}),t.jsx(Oe,{children:"Last Active"}),t.jsx(Oe,{})]})}),t.jsx(Ft,{children:m.map(p=>t.jsxs(rt,{children:[t.jsx(Qe,{children:t.jsxs("div",{className:"w-flex w-items-center w-gap-3",children:[t.jsx(Vr,{children:t.jsx(T6,{browser:p.browser||"Unknown"})}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{children:p.browser||"Unknown Browser"}),p.device&&t.jsx("div",{className:"w-text-muted",children:p.device})]})]})}),t.jsx(Qe,{children:t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{children:p.city&&p.country?`${p.city}, ${p.country}`:"Unknown location"}),p.ip_address&&t.jsx("div",{className:"w-text-muted",children:p.ip_address})]})}),t.jsx(Qe,{children:d(p.last_active_at)}),t.jsx(Tt,{children:t.jsxs(se,{$size:"sm",$outline:!0,$destructive:!0,onClick:()=>c(p.id),children:[t.jsx(Aa,{size:12}),"Sign out"]})})]},p.id))})]})})}):t.jsx(Nt,{title:"No active sessions",description:"You don't have any active sessions at the moment."})})},V6=(e,a)=>`${(e==null?void 0:e[0])||""}${(a==null?void 0:a[0])||""}`.toUpperCase()||"U",M0=()=>{var N,_,C,y,E,M,F,A;const{loading:e,user:a,updateProfilePicture:s}=xa(),{deployment:n}=ke(),[i,l]=o.useState("profile"),[m,c]=o.useState(null),[d,p]=o.useState("info"),[u,h]=o.useState(!1),f=o.useRef(null),g=o.useCallback((T,P="info")=>{c(T),p(P),setTimeout(()=>c(null),3e3)},[c]),x=async T=>{var S;const P=(S=T.target.files)==null?void 0:S[0];if(P){if(P.size>2*1024*1024){g("File size cannot exceed 2MB","error");return}if(!P.type.startsWith("image/")){g("Please select a valid image file","error");return}try{h(!0),await s(P),await(a==null?void 0:a.refetch()),g("Profile picture updated","info")}catch($){g(($==null?void 0:$.message)||"Failed to update profile picture","error")}finally{h(!1),f.current&&(f.current.value="")}}};if(e)return t.jsx(Re,{children:t.jsx(mr,{className:"w-flex w-items-center w-justify-center",children:t.jsx(je,{})})});const w=n==null?void 0:n.auth_settings,b=(N=w==null?void 0:w.email_address)==null?void 0:N.enabled,j=(_=w==null?void 0:w.phone_number)==null?void 0:_.enabled,v=((C=n==null?void 0:n.social_connections)==null?void 0:C.some(T=>T.enabled))||!1,k=((y=w==null?void 0:w.password)==null?void 0:y.enabled)||((E=w==null?void 0:w.auth_factors_enabled)==null?void 0:E.authenticator)||((M=w==null?void 0:w.auth_factors_enabled)==null?void 0:M.phone_otp)||((F=w==null?void 0:w.auth_factors_enabled)==null?void 0:F.backup_code);return t.jsx(Re,{children:t.jsx(i0,{children:t.jsx(r0.Provider,{value:{screen:null,setScreen:()=>{},toast:g},children:t.jsxs(mr,{className:"w-relative",children:[a&&t.jsxs(f0,{className:"mac-page-header",children:[t.jsxs("button",{type:"button",className:"w-avatar-edit","data-busy":u?"":void 0,onClick:()=>{var T;return(T=f.current)==null?void 0:T.click()},disabled:u,title:"Change profile picture","aria-label":"Change profile picture",children:[t.jsx("span",{className:"w-avatar w-avatar--lg",children:a.profile_picture_url?t.jsx("img",{src:a.profile_picture_url,alt:""}):V6(a.first_name,a.last_name)}),t.jsx("span",{className:"w-avatar-veil",children:u?t.jsx(je,{size:14}):t.jsx(sn,{size:16})})]}),t.jsx("input",{ref:f,type:"file",accept:"image/*",style:{display:"none"},onChange:x}),t.jsxs(w0,{children:[t.jsx(g0,{children:`${a.first_name||""} ${a.last_name||""}`.trim()||a.username||"Account"}),((A=a.primary_email_address)==null?void 0:A.email)&&t.jsx(x0,{children:a.primary_email_address.email})]})]}),t.jsx(o0,{children:t.jsxs(l0,{children:[t.jsx(ka,{$isActive:i==="profile",onClick:()=>l("profile"),children:t.jsxs(Ca,{children:[t.jsx(hs,{size:16}),"Profile"]})}),b&&t.jsx(ka,{$isActive:i==="email",onClick:()=>l("email"),children:t.jsxs(Ca,{children:[t.jsx(dl,{size:16}),"Email"]})}),j&&t.jsx(ka,{$isActive:i==="phone",onClick:()=>l("phone"),children:t.jsxs(Ca,{children:[t.jsx(Pu,{size:16}),"Phone"]})}),v&&t.jsx(ka,{$isActive:i==="social",onClick:()=>l("social"),children:t.jsxs(Ca,{children:[t.jsx(Lu,{size:16}),"Connections"]})}),k&&t.jsx(ka,{$isActive:i==="security",onClick:()=>l("security"),children:t.jsxs(Ca,{children:[t.jsx(Xt,{size:16}),"Security"]})}),t.jsx(ka,{$isActive:i==="sessions",onClick:()=>l("sessions"),children:t.jsxs(Ca,{children:[t.jsx($u,{size:16}),"Sessions"]})})]})}),t.jsxs(c0,{children:[i==="profile"&&t.jsx(u6,{}),i==="email"&&b&&t.jsx(m6,{}),i==="phone"&&j&&t.jsx(p6,{}),i==="social"&&v&&t.jsx(w6,{}),i==="security"&&k&&t.jsx(R6,{}),i==="sessions"&&t.jsx(I6,{})]}),m&&t.jsxs("div",{className:`w-toast w-toast--contained ${d==="error"?"w-toast--error":"w-toast--success"}`,style:{minWidth:0},children:[t.jsx("span",{className:"w-toast-ic",children:d==="error"?t.jsx(Fa,{size:12}):t.jsx(qe,{size:12})}),t.jsx("span",{className:"w-toast-msg",children:m})]})]})})})})},R0=({isOpen:e,onClose:a,title:s,showHeader:n,headerContent:i,footerContent:l,customContent:m,children:c,showCloseButton:d})=>t.jsx(ze,{isOpen:e,onClose:a,children:t.jsx(ze.Overlay,{children:t.jsxs(ze.Content,{className:"w-dialog--panel",children:[n&&t.jsx(ze.Header,{showCloseButton:d,children:i||s}),m||c||t.jsx(M0,{}),l&&t.jsx(ze.Footer,{children:l})]})})}),Le=(...e)=>e.filter(Boolean).join(" "),z6=e=>t.jsx("div",{...e,className:Le("w-relative",e.className)}),L0=o.forwardRef((e,a)=>t.jsx("button",{...e,ref:a,className:Le("w-acct",e.className),style:{width:"auto",margin:0,padding:4,gap:8,...e.style}}));L0.displayName="AccountButton";const D6=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","w-avatar--md",a.className),children:e}),U6=e=>t.jsx("div",{...e,className:Le("w-sec","w-text-secondary",e.className)}),P0=o.forwardRef(({$position:e,$isOpen:a,$maxHeight:s,children:n,...i},l)=>t.jsx("div",{...i,ref:l,className:"w-menu",style:{position:"fixed",width:300,maxWidth:"calc(100vw - 24px)",maxHeight:s?`${s}px`:"calc(100vh - 48px)",overflowY:"auto",zIndex:99999,top:(e==null?void 0:e.top)!==void 0?`${e.top}px`:void 0,bottom:(e==null?void 0:e.bottom)!==void 0?`${e.bottom}px`:void 0,left:(e==null?void 0:e.left)!==void 0?`${e.left}px`:void 0,right:(e==null?void 0:e.right)!==void 0?`${e.right}px`:void 0,visibility:e&&a?"visible":"hidden",opacity:a&&e?1:0,transition:`opacity 0.15s ease, visibility 0s linear ${a?"0s":"0.15s"}`,padding:0},children:n}));P0.displayName="DropdownContainer";const $0=o.forwardRef(({$top:e,$left:a,$isOpen:s,$maxHeight:n,children:i,...l},m)=>t.jsx("div",{...l,ref:m,className:"w-menu",style:{position:"fixed",width:300,maxWidth:"calc(100vw - 24px)",maxHeight:`${n}px`,overflowY:"auto",zIndex:99999,display:"flex",flexDirection:"column",top:`${e}px`,left:`${a}px`,visibility:s?"visible":"hidden",opacity:s?1:0,transition:`opacity 0.15s ease, visibility 0s linear ${s?"0s":"0.15s"}`,padding:0},children:i}));$0.displayName="SidePanel";const qi=e=>t.jsx("hr",{...e,className:Le("w-hr",e.className)}),W6=e=>t.jsx("div",{...e,style:{padding:"16px 14px 8px",...e.style}}),B6=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-gap-3",e.className)}),G6=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","w-avatar--lg",a.className),children:e}),q6=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-grow",e.className),style:{gap:2,...e.style}}),K6=e=>t.jsx("div",{...e,className:Le("w-sec","w-truncate",e.className)}),Y6=e=>t.jsx("div",{...e,className:Le("w-secsub","w-truncate",e.className)}),Q6=({$active:e,...a})=>t.jsx("button",{...a,className:"w-menu-item",style:{border:"0.5px solid var(--wa-border)",background:e?"var(--wa-surface-subtle)":void 0,...a.style}}),J6=({children:e,...a})=>t.jsx("div",{...a,className:"w-avatar w-avatar--sm",children:e}),X6=e=>t.jsx("div",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),ep=e=>t.jsx("div",{...e,className:Le("w-secsub","w-none",e.className)}),tp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),ap=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className)}),sp=e=>t.jsx("span",{...e,className:Le("w-grow",e.className)}),np=e=>t.jsx("span",{...e,className:Le("w-menu-trail",e.className)}),rp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),ip=e=>t.jsx("div",{...e,className:Le("w-menu-label",e.className)}),Hn=({$active:e,...a})=>t.jsx("button",{...a,className:"w-menu-item",style:{cursor:e?"default":"pointer",...a.style}}),Fn=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-flex","w-items-center","w-justify-center","w-none",a.className),style:{width:14,height:14,color:"var(--wa-primary)",...a.style},children:e}),op=e=>t.jsx("div",{...e,className:"w-none",style:{width:14,...e.style}}),Tn=e=>t.jsx("div",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),Ki=e=>t.jsx("div",{...e,className:Le("w-secsub","w-none",e.className)}),lp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),cp=e=>t.jsx("button",{...e,className:Le("w-menu-item","w-menu-item--danger",e.className)}),dp=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className),style:{borderBottom:"0.5px solid var(--wa-border)",borderRadius:0,flex:"none",...e.style}}),up=e=>t.jsx("div",{...e,style:{flex:"1 1 auto",overflowY:"auto",padding:5,...e.style}}),Yi=({$active:e,...a})=>t.jsx("button",{...a,className:Le("w-menu-item","sp-row",e&&"sp-row--active",a.className),style:{height:30,...a.style}}),Qi=({$active:e,...a})=>t.jsx("button",{...a,className:Le("w-menu-item","sp-row","sp-ws-row",e&&"sp-row--active",a.className),style:{height:30,paddingLeft:30,position:"relative",...a.style},children:a.children}),Ji=({$personal:e,children:a,...s})=>t.jsx("div",{...s,className:Le("w-avatar","w-avatar--sm",!e&&"",s.className),children:a}),Xi=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","","w-avatar--sm",a.className),children:e}),eo=e=>t.jsx("span",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),to=e=>t.jsx("span",{...e,className:Le("w-secsub","w-grow","w-truncate",e.className)}),In=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-none",e.className),style:{gap:4,...e.style}}),mp=({$open:e,...a})=>t.jsx(Ut,{...a,className:"w-text-muted",style:{flexShrink:0,transition:"transform 0.2s ease",transform:e?"rotate(0deg)":"rotate(-90deg)"}}),Vn=e=>t.jsx(qe,{...e,className:"w-text-primary",style:{flexShrink:0}}),pp=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-gap-3","w-none",e.className),style:{padding:"12px 12px 16px",borderBottom:"0.5px solid var(--wa-border)",...e.style}}),hp=e=>t.jsx("button",{...e,className:Le("w-btn","w-btn--icon",e.className),style:{width:24,height:24,...e.style}}),ao=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-gap-3",e.className),style:{padding:"4px 4px 0",minWidth:0,...e.style}}),so=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","","w-avatar--md",a.className),children:e}),no=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-grow",e.className),style:{gap:1,minWidth:0,...e.style}}),ro=e=>t.jsx("div",{...e,className:Le("w-sec","w-truncate",e.className)}),io=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-none",e.className),style:{gap:2,...e.style}}),Fs=({$destructive:e,...a})=>t.jsx("button",{...a,className:Le("w-btn","w-btn--icon",e&&"w-btn--danger",a.className),style:{width:24,height:24,...a.style}}),oo=e=>t.jsx("div",{...e,className:"w-none",style:{borderTop:"0.5px solid var(--wa-border)",padding:5,...e.style}}),lo=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className),style:{height:30,color:"var(--wa-text-muted)",...e.style}}),co=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-justify-center","w-none",e.className),style:{width:20,height:20,...e.style}}),Dr=({showName:e=!0,onCreateOrg:a,showOrgSwitcher:s=!0,narrowBreakpoint:n=640})=>{var He,Ge,ct,Rt,Wt,ba,ya,yt,aa,sa,na,ra;const i=ts(),[l,m]=o.useState(!1),[c,d]=o.useState(!1),[p,u]=o.useState(typeof window<"u"&&window.innerWidth<n),[h,f]=o.useState(!1),[g,x]=o.useState("org"),[w,b]=o.useState(null),[j,v]=o.useState({top:0,left:0,maxHeight:400}),[k,N]=o.useState(new Set),[_,C]=o.useState(null),y=o.useRef(null),E=o.useRef(null),M=o.useRef(null),F=bt({triggerRef:y,isOpen:l,minWidth:300}),A=Kt(!1),T=Kt(!1),P=Kt(!1),S=Kt(!1),$=Kt(!1),{session:H,signOut:R,switchSignIn:O,switchOrganization:Z,switchWorkspace:L,refetch:U}=it(),{navigateToSignIn:D}=kt(),{deployment:Y}=ke(),{activeOrganization:B,activeMembership:Q,leave:ue}=fa(),{organizationMemberships:we}=wa(),{workspaces:ne}=ga(),{activeWorkspace:ae,activeMembership:re,leave:Me}=Dt(),q=(He=H==null?void 0:H.active_signin)==null?void 0:He.user,tt=((ct=(Ge=Y==null?void 0:Y.auth_settings)==null?void 0:Ge.multi_session_support)==null?void 0:ct.enabled)??!1,Ie=((Rt=Y==null?void 0:Y.b2b_settings)==null?void 0:Rt.allow_users_to_create_orgs)??!1,De=((Wt=Y==null?void 0:Y.b2b_settings)==null?void 0:Wt.organizations_enabled)??!1,Ee=De&&(((ba=Y==null?void 0:Y.b2b_settings)==null?void 0:ba.workspaces_enabled)??!1),ce=s&&De,W=!B,G=o.useMemo(()=>{var xe;const oe={};for(const Ne of ne||[]){const J=(xe=Ne.organization)==null?void 0:xe.id;J&&(oe[J]||(oe[J]=[]),oe[J].push(Ne))}return oe},[ne]),K=we||[],V=o.useCallback(()=>{if(!E.current)return;const oe=E.current.getBoundingClientRect(),xe=300,Ne=8,J=window.innerWidth<n;if(u(J),J){v({top:oe.top,left:oe.left,maxHeight:oe.height});return}const ve=Math.min(Math.max(oe.height,520),window.innerHeight-oe.top-16),Ye=oe.right+Ne+xe<=window.innerWidth-8;v({top:oe.top,left:Ye?oe.right+Ne:oe.left-Ne-xe,maxHeight:ve})},[n]),de=o.useCallback(()=>{V(),d(!0)},[V]),z=o.useCallback(oe=>{N(xe=>{const Ne=new Set(xe);return Ne.has(oe)?Ne.delete(oe):Ne.add(oe),Ne})},[]);o.useEffect(()=>{B&&Ee&&N(oe=>{if(oe.has(B.id))return oe;const xe=new Set(oe);return xe.add(B.id),xe})},[B,Ee]),o.useEffect(()=>{x(Ee&&ae?"ws":"org")},[Ee,ae==null?void 0:ae.id]),o.useEffect(()=>{const oe=()=>{u(window.innerWidth<n),c&&V()};return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[n,c,V]),o.useEffect(()=>{l||(d(!1),f(!1))},[l]),o.useEffect(()=>{if(!l)return;const oe=setTimeout(()=>{const xe=Ne=>{var ve,Ye,Ve;const J=Ne.target;(ve=y.current)!=null&&ve.contains(J)||(Ye=E.current)!=null&&Ye.contains(J)||(Ve=M.current)!=null&&Ve.contains(J)||m(!1)};return document.addEventListener("mousedown",xe),()=>document.removeEventListener("mousedown",xe)},50);return()=>clearTimeout(oe)},[l]);const le=oe=>oe.split(" ").filter(Boolean).map(xe=>xe[0]).join("").toUpperCase().slice(0,2),Je=(oe,xe,Ne,J,ve)=>t.jsx(ve,{children:oe?t.jsx("img",{src:xe,alt:Ne}):le(`${Ne||""} ${J||""}`)}),ot=async oe=>{try{await R(oe),await U(),m(!1)}catch{}},ge=async oe=>{try{await O(oe),await U(),m(!1)}catch{}},lt=async oe=>{if(!h){f(!0);try{await Z(oe),await U(),d(!1)}catch{}finally{f(!1)}}},Ke=async oe=>{if(!h){f(!0);try{await L(oe),await U(),d(!1)}catch{}finally{f(!1)}}},ee=()=>{A.open(),m(!1)},ie=[...(H==null?void 0:H.signins)||[]].sort((oe,xe)=>{const Ne=oe.user.id===(q==null?void 0:q.id),J=xe.user.id===(q==null?void 0:q.id);return Ne===J?0:Ne?-1:1}),me=((ya=ie.find(oe=>oe.user.id===(q==null?void 0:q.id)))==null?void 0:ya.id)||"",Ze=((aa=(yt=Q==null?void 0:Q.roles)==null?void 0:yt[0])==null?void 0:aa.name)??null;return t.jsx(Re,{children:t.jsxs(z6,{children:[t.jsxs(L0,{ref:y,onClick:()=>m(!l),children:[Je(q==null?void 0:q.has_profile_picture,q==null?void 0:q.profile_picture_url,q==null?void 0:q.first_name,q==null?void 0:q.last_name,D6),e&&t.jsx(U6,{children:`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`.trim()})]}),typeof window<"u"&&en.createPortal(t.jsxs("div",{className:"wacht-root",style:i,children:[t.jsxs(P0,{ref:E,$position:F,$isOpen:l&&!(p&&c),$maxHeight:F==null?void 0:F.maxHeight,children:[t.jsx(W6,{children:t.jsxs(B6,{children:[Je(q==null?void 0:q.has_profile_picture,q==null?void 0:q.profile_picture_url,q==null?void 0:q.first_name,q==null?void 0:q.last_name,G6),t.jsxs(q6,{children:[t.jsx(K6,{children:`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`.trim()}),t.jsx(Y6,{children:(sa=q==null?void 0:q.primary_email_address)==null?void 0:sa.email})]})]})}),t.jsxs(tp,{children:[ce&&t.jsxs(Q6,{$active:c,onClick:de,style:{marginBottom:8},children:[t.jsx(J6,{children:B?B.image_url?t.jsx("img",{src:B.image_url,alt:B.name}):(na=B.name)==null?void 0:na.charAt(0).toUpperCase():q!=null&&q.has_profile_picture?t.jsx("img",{src:q.profile_picture_url,alt:q.first_name}):le(`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`)}),t.jsx(X6,{children:(B==null?void 0:B.name)??"Personal account"}),Ze&&t.jsx(ep,{children:Ze})]}),t.jsxs(ap,{onClick:ee,children:[t.jsx(Ea,{}),t.jsx(sp,{children:"Manage account"}),t.jsx(np,{children:"⌘,"})]})]}),t.jsx(qi,{}),t.jsxs(rp,{children:[t.jsx(ip,{children:"Accounts"}),tt?ie.map(({user:oe,id:xe})=>{var J;const Ne=oe.id===(q==null?void 0:q.id);return t.jsxs(Hn,{$active:Ne,onClick:Ne?void 0:()=>ge(xe),children:[Ne?t.jsx(Fn,{children:t.jsx(qe,{})}):t.jsx(op,{}),t.jsx(Tn,{children:(J=oe.primary_email_address)==null?void 0:J.email}),Ne&&t.jsx(Ki,{children:"Current"})]},oe.id)}):q&&t.jsxs(Hn,{$active:!0,children:[t.jsx(Fn,{children:t.jsx(qe,{})}),t.jsx(Tn,{children:(ra=q.primary_email_address)==null?void 0:ra.email}),t.jsx(Ki,{children:"Current"})]}),tt&&t.jsxs(Hn,{onClick:()=>{D(),m(!1)},children:[t.jsx(Fn,{style:{color:"var(--wa-text-muted)"},children:t.jsx(St,{})}),t.jsx(Tn,{style:{color:"var(--wa-text-muted)"},children:"Add account"})]})]}),t.jsx(qi,{}),t.jsx(lp,{children:t.jsxs(cp,{onClick:()=>ot(me),children:[t.jsx(Aa,{}),"Sign out"]})})]}),t.jsxs($0,{ref:M,$top:j.top,$left:j.left,$isOpen:l&&c,$maxHeight:j.maxHeight,children:[p&&t.jsxs(dp,{onClick:()=>d(!1),children:[t.jsx(nn,{size:13}),"Back"]}),(()=>{var _t;if(W)return null;const oe=Ee&&!!ae,xe=!!((_t=Q==null?void 0:Q.eligibility_restriction)!=null&&_t.type)&&Q.eligibility_restriction.type!=="none",Ne=!!B&&!xe&&Hr(Q),J=oe&&!xe&&Tr(re),ve=oe?g:"org",Ye=async()=>{if(ue){b("org");try{await ue(),await U(),d(!1)}catch{}finally{b(null)}}},Ve=async()=>{if(Me){b("ws");try{await Me(),d(!1)}catch{}finally{b(null)}}},jt=()=>{if(!oe)return null;const Be=ve==="org"?"ws":"org",wt=Be==="ws"?"Switch to workspace context":"Switch to organization context";return t.jsx(hp,{type:"button",onClick:()=>x(Be),title:wt,"aria-label":wt,children:t.jsx(bu,{size:12})})};return t.jsxs(pp,{children:[ve==="org"&&B&&t.jsxs(ao,{children:[jt(),t.jsx(so,{children:B.image_url?t.jsx("img",{src:B.image_url,alt:B.name}):le(B.name)}),t.jsx(no,{children:t.jsx(ro,{children:B.name})}),t.jsxs(io,{children:[Ne&&t.jsx(Fs,{onClick:()=>{P.open(),m(!1)},title:"Organization settings","aria-label":"Organization settings",children:t.jsx(Ea,{size:14})}),t.jsx(Fs,{$destructive:!0,onClick:Ye,disabled:w==="org",title:"Leave organization","aria-label":"Leave organization",children:t.jsx(Aa,{size:14})})]})]}),ve==="ws"&&oe&&t.jsxs(ao,{children:[jt(),t.jsx(so,{children:ae.image_url?t.jsx("img",{src:ae.image_url,alt:ae.name}):le(ae.name)}),t.jsx(no,{children:t.jsx(ro,{children:ae.name})}),t.jsxs(io,{children:[J&&t.jsx(Fs,{onClick:()=>{$.open(),m(!1)},title:"Workspace settings","aria-label":"Workspace settings",children:t.jsx(Ea,{size:14})}),t.jsx(Fs,{$destructive:!0,onClick:Ve,disabled:w==="ws",title:"Leave workspace","aria-label":"Leave workspace",children:t.jsx(Aa,{size:14})})]})]})]})})(),t.jsxs(up,{children:[t.jsxs(Yi,{$active:W,onClick:()=>{W||lt(void 0)},disabled:h,style:W?{cursor:"default"}:void 0,children:[t.jsx(Ji,{$personal:!0,children:q!=null&&q.has_profile_picture?t.jsx("img",{src:q.profile_picture_url,alt:q.first_name}):t.jsx(hs,{size:12})}),t.jsx(eo,{children:"Personal account"}),W&&t.jsx(In,{children:t.jsx("span",{className:"sp-check",style:{display:"inline-flex"},children:t.jsx(Vn,{size:13})})})]}),K.map(oe=>{var Ve,jt;const xe=oe.organization,Ne=xe.id===(B==null?void 0:B.id),J=k.has(xe.id),ve=Ee?G[xe.id]||[]:[],Ye=!!((Ve=oe.eligibility_restriction)!=null&&Ve.type)&&oe.eligibility_restriction.type!=="none";return t.jsxs(o.Fragment,{children:[t.jsxs(Yi,{$active:Ne,onClick:()=>{Ye||(Ee?z(xe.id):Ne||lt(xe.id))},disabled:h,style:Ye?{opacity:.55,cursor:"not-allowed"}:Ne&&!Ee?{cursor:"default"}:void 0,title:(jt=oe.eligibility_restriction)==null?void 0:jt.message,children:[t.jsx(Ji,{children:xe.image_url?t.jsx("img",{src:xe.image_url,alt:xe.name}):le(xe.name)}),t.jsx(eo,{children:xe.name}),t.jsxs(In,{children:[Ye&&t.jsx(Ma,{size:12,color:"var(--wa-error)"}),Ne&&!Ee&&t.jsx(Vn,{size:13}),Ee&&t.jsx(mp,{size:11,$open:J})]})]}),Ee&&J&&t.jsxs(t.Fragment,{children:[ve.map(_t=>{var ia,oa;const Be=Ne&&(ae==null?void 0:ae.id)===_t.id,wt=_t,Bt=((ia=wt.eligibility_restriction)==null?void 0:ia.type)&&wt.eligibility_restriction.type!=="none";return t.jsxs(Qi,{$active:Be,onClick:()=>{!Be&&!Bt&&Ke(_t.id)},disabled:h,style:Bt||Ye?{opacity:.55,cursor:"not-allowed"}:Be?{cursor:"default"}:void 0,title:(oa=wt.eligibility_restriction)==null?void 0:oa.message,children:[t.jsx(Xi,{children:wt.image_url?t.jsx("img",{src:wt.image_url,alt:wt.name}):le(wt.name).charAt(0)}),t.jsx(to,{children:wt.name}),t.jsxs(In,{children:[Bt&&t.jsx(Ma,{size:12,color:"var(--wa-error)"}),Be&&t.jsx(Vn,{size:12})]})]},_t.id)}),!Ye&&t.jsxs(Qi,{onClick:()=>{C(xe.id),S.open()},disabled:h,children:[t.jsx(Xi,{style:{background:"transparent",border:"1px dashed var(--wa-border-strong)"},children:t.jsx(St,{size:10})}),t.jsx(to,{children:"New workspace"})]})]})]},xe.id)})]}),(()=>{var Ye,Ve,jt;const oe=((we==null?void 0:we.length)??0)>0,xe=()=>Ie&&t.jsx(oo,{children:t.jsxs(lo,{onClick:()=>{a?(a(),m(!1)):T.open()},disabled:h,children:[t.jsx(co,{children:t.jsx(St,{size:12})}),"New organization"]})});if(!Ee||!oe)return xe();const Ne=!!((Ye=Q==null?void 0:Q.eligibility_restriction)!=null&&Ye.type)&&Q.eligibility_restriction.type!=="none",J=((jt=(Ve=we==null?void 0:we[0])==null?void 0:Ve.organization)==null?void 0:jt.id)??null,ve=B&&!Ne?B.id:J;return t.jsx(oo,{children:t.jsxs(lo,{onClick:()=>{C(ve),S.open()},disabled:h,children:[t.jsx(co,{children:t.jsx(St,{size:12})}),"New workspace"]})})})()]})]}),document.body),t.jsx(R0,{isOpen:A.isOpen,onClose:A.close}),ce&&t.jsxs(t.Fragment,{children:[t.jsx(Bc,{isOpen:T.isOpen,onClose:T.close}),t.jsx(Qc,{isOpen:P.isOpen,onClose:P.close}),Ee&&t.jsxs(t.Fragment,{children:[t.jsx(Pr,{isOpen:S.isOpen,onClose:()=>{S.close(),C(null)},organizationId:_||void 0}),t.jsx(Or,{isOpen:$.isOpen,onClose:$.close})]})]})]})})};function O0({notification:e,onAction:a}){const[s,n]=o.useState(!1),i=c=>{c.target.closest("button")||(n(!s),e.is_read||a({type:"read",id:e.id}))},l=c=>{a({type:"custom",payload:c.payload})},m=c=>{const d=new Date(c),u=new Date().getTime()-d.getTime();if(u<6e4)return"Just now";const h=Math.floor(u/6e4);if(h<60)return`${h}m`;const f=Math.floor(h/60);if(f<24)return`${f}h`;const g=Math.floor(f/24);return g<7?`${g}d`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})};return t.jsxs("div",{className:"w-flex w-gap-3 w-row--hover w-notif-row",onClick:i,"data-unread":e.is_read?void 0:"",children:[t.jsxs("div",{className:"w-grow w-flex-col w-justify-center",children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-2",style:{marginBottom:2},children:[!e.is_read&&t.jsx("span",{className:"w-notif-dot"}),t.jsx("h4",{className:"w-sec w-truncate",style:{margin:0},children:e.title})]}),t.jsx("p",{className:`w-secsub${s?"":" w-truncate"}`,style:{margin:0,wordWrap:s?"break-word":void 0},children:e.body}),e.ctas&&e.ctas.length>0&&t.jsx("div",{className:"w-flex w-wrap w-gap-2",style:{marginTop:10},children:e.ctas.map((c,d)=>t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:()=>l(c),children:c.label},d))})]}),t.jsxs("div",{className:"w-flex-col w-items-end w-gap-2 w-none",children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-1",children:[e.is_read&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"unread",id:e.id})},title:"Mark as unread",children:t.jsx(ku,{size:14})}),t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"star",id:e.id})},title:e.is_starred?"Unstar":"Star","data-on":e.is_starred?"":void 0,children:t.jsx(Ou,{size:14,fill:e.is_starred?"currentColor":"none"})}),t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"archive",id:e.id})},title:e.is_archived?"Unarchive":"Archive",children:e.is_archived?t.jsx(Vo,{size:14}):t.jsx(To,{size:14})})]}),t.jsx("span",{className:"w-secsub",style:{whiteSpace:"nowrap"},children:m(e.created_at)})]})]})}const Z0=o.forwardRef(({scope:e="all",onAction:a,fullWidth:s,maxHeight:n,className:i},l)=>{const[m,c]=o.useState("inbox"),[d,p]=o.useState(!1),[u,h]=o.useState(!1),f=o.useRef(null),g={scope:e,limit:20,is_archived:m==="archive",is_starred:m==="starred",is_read:d?!1:void 0},{notifications:x,loading:w,error:b,hasMore:j,loadMore:v,markAsRead:k,markAsUnread:N,markAllAsRead:_,archiveAllRead:C,archiveNotification:y,starNotification:E}=Ro(g);o.useEffect(()=>{if(!u)return;const T=P=>{f.current&&!f.current.contains(P.target)&&h(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[u]);const M=async T=>{switch(T.type){case"read":await k(T.id);break;case"unread":await N(T.id);break;case"archive":await y(T.id);break;case"star":await E(T.id);break;case"custom":a==null||a(T.payload);break}},F=()=>{_(),h(!1)},A=()=>{C(),h(!1)};return t.jsxs("div",{ref:l,className:`w-flex-col w-relative w-notif-panel${s?" w-notif-panel--fill":""}${i?` ${i}`:""}`,style:{maxHeight:n||"100%"},children:[t.jsxs("div",{className:"w-flex w-items-center w-justify-between w-gap-3 w-none w-notif-head",children:[t.jsxs("div",{className:"w-tabs w-grow",children:[t.jsx("button",{className:`w-tab${m==="inbox"?" w-tab--active":""}`,onClick:()=>c("inbox"),children:"Inbox"}),t.jsx("button",{className:`w-tab${m==="archive"?" w-tab--active":""}`,onClick:()=>c("archive"),children:"Archive"}),t.jsx("button",{className:`w-tab${m==="starred"?" w-tab--active":""}`,onClick:()=>c("starred"),children:"Starred"})]}),t.jsxs("label",{className:"w-switch w-none","data-on":d?"":void 0,onClick:()=>p(!d),children:[t.jsx("span",{className:"w-switch-track",children:t.jsx("span",{className:"w-switch-knob"})}),t.jsx("span",{className:"w-switch-label",children:"Unread Only"})]}),t.jsx("button",{className:"w-btn w-btn--icon w-none",onClick:()=>h(!u),children:t.jsx(Su,{size:16})}),u&&t.jsxs("div",{ref:f,className:"w-menu w-notif-menu",children:[m==="inbox"&&t.jsxs("button",{className:"w-menu-item",onClick:F,children:[t.jsx(_u,{})," Mark all as read"]}),t.jsxs("button",{className:"w-menu-item",onClick:A,children:[t.jsx(To,{})," Archive all read"]})]})]}),t.jsx("div",{className:"w-grow w-notif-body",children:w?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):b?t.jsx(Nt,{icon:t.jsx(ci,{size:20,className:"w-text-error"}),title:"Failed to load notifications",description:b.message||"An unexpected error occurred."}):x.length===0?t.jsx(Nt,{icon:t.jsx(ci,{size:20}),title:"No notifications",description:"You're all caught up!"}):t.jsxs(t.Fragment,{children:[x.map(T=>t.jsx(O0,{notification:T,onAction:M},T.id)),j&&t.jsx("div",{className:"w-flex w-justify-center",style:{padding:12},children:t.jsx("button",{className:"w-btn w-btn--ghost w-btn--sm",onClick:v,children:"Load more"})})]})})]})}),H0=o.forwardRef(({position:e,scope:a,onAction:s,className:n},i)=>t.jsx("div",{ref:i,className:`w-card w-flex-col w-notif-pop${n?` ${n}`:""}`,style:{top:(e==null?void 0:e.top)!==void 0?e.top:void 0,bottom:(e==null?void 0:e.bottom)!==void 0?e.bottom:void 0,left:(e==null?void 0:e.left)!==void 0?e.left:void 0,right:(e==null?void 0:e.right)!==void 0?e.right:void 0,maxHeight:e!=null&&e.maxHeight?e.maxHeight:"90vh"},children:t.jsx(Z0,{scope:a,onAction:s,fullWidth:!0,maxHeight:e!=null&&e.maxHeight?`${e.maxHeight}px`:"100%"})}));function F0({className:e,showBadge:a=!0,scope:s="all",onAction:n}){const[i,l]=o.useState(!1),m=ts(),c=o.useRef(null),d=o.useRef(null),p=o.useRef(null),{count:u,refetch:h}=Lo({scope:s}),f=async x=>{await h(),n==null||n(x.payload)},g=bt({triggerRef:p,isOpen:i,minWidth:Math.min(450,typeof window<"u"?window.innerWidth-32:300),defaultMaxHeight:550});return o.useEffect(()=>{if(!i)return;const x=setTimeout(()=>{const w=b=>{var v,k;const j=b.target;(v=c.current)!=null&&v.contains(j)||(k=d.current)!=null&&k.contains(j)||l(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},50);return()=>{clearTimeout(x)}},[i]),t.jsx(Re,{children:t.jsxs("div",{ref:c,className:`w-inline w-relative${e?` ${e}`:""}`,children:[t.jsxs("button",{ref:p,className:"w-btn w-btn--icon w-notif-bell",onClick:()=>l(!i),"aria-label":u>0?`${u} unread notifications`:"Notifications",children:[t.jsx(yu,{strokeWidth:1}),a&&u>0&&t.jsx("span",{className:"w-notif-badge","data-dot":u<=9?"":void 0,children:u>9?"9+":""})]}),typeof window<"u"&&i&&en.createPortal(t.jsx("div",{className:"wacht-root",style:m,children:t.jsx(H0,{ref:d,position:g,scope:s,onAction:f,onClose:()=>l(!1)})}),document.body)]})})}const fp=({showName:e=!0,showNotifications:a=!0})=>t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[a&&t.jsx(F0,{}),t.jsx(Dr,{showName:e})]}),wp=({children:e})=>{var n;const{session:a,loading:s}=it();return s||!((n=a.signins)!=null&&n.length)||!a.active_signin?null:t.jsx(t.Fragment,{children:e})},gp=({children:e})=>{var n;const{loading:a,session:s}=it();return a||(n=s.signins)!=null&&n.length&&s.active_signin?null:t.jsx(t.Fragment,{children:e})},xp=({onAccountSelect:e,showAddAccount:a=!0})=>{var _,C,y,E;const{session:s,loading:n,switchSignIn:i,signOut:l}=it(),{deployment:m}=ke(),{navigateToSignIn:c,navigate:d}=kt(),[p,u]=o.useState(null),[h,f]=o.useState(null),g=s==null?void 0:s.active_signin,x=(s==null?void 0:s.signins)||[],w=((C=(_=m==null?void 0:m.auth_settings)==null?void 0:_.multi_session_support)==null?void 0:C.enabled)??!1,b=(y=m==null?void 0:m.ui_settings)==null?void 0:y.app_name;o.useEffect(()=>{n||x.length||c()},[n,x,c]);const j=M=>M.split(" ").map(F=>F[0]).join("").toUpperCase().slice(0,2),v=async M=>{var F;f(M);try{if(await i(M),e)e(M),f(null);else{let A=gt(m,new URLSearchParams(window.location.search).get("redirect_uri"));if(A||(A=(F=m.ui_settings)==null?void 0:F.after_signin_redirect_url),A){let T;try{T=new URL(A)}catch{T=new URL(A,window.location.origin)}(m==null?void 0:m.mode)==="staging"&&T.searchParams.set("__dev_session__",xt(m.backend_host)??""),d(T.toString())}else f(null)}}catch{f(null)}},k=async(M,F)=>{M.stopPropagation(),u(F);try{await l(F)}catch{}finally{u(null)}},N=()=>{var F;let M=gt(m,new URLSearchParams(window.location.search).get("redirect_uri"));M||(M=(F=m.ui_settings)==null?void 0:F.after_signin_redirect_url),c(M)};return n?t.jsx(js,{}):x.length?t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-sub",style:{fontSize:12.5},children:["Don't have an account?"," ",t.jsx(Et,{to:`${(E=m.ui_settings)==null?void 0:E.sign_up_page_url}${window.location.search}`,className:"w-link",children:"Sign up"})]}),children:[t.jsx(nt,{title:"Choose an account",sub:`Select an account to continue${b?` to ${b}`:""}`}),t.jsx("div",{className:"w-flex-col",children:x.map(({user:M,id:F})=>{var R,O;if(!M)return null;const A=F===(g==null?void 0:g.id),T=h===F,P=p===F,S=`${M.first_name||""} ${M.last_name||""}`.trim(),$=S||((R=M.primary_email_address)==null?void 0:R.email)||M.username||"User",H=((O=M.primary_email_address)==null?void 0:O.email)||M.username;return t.jsxs("button",{className:"w-acct","data-active":A?"":void 0,"data-busy":T?"":void 0,onClick:()=>v(F),children:[t.jsx("div",{className:"w-avatar",children:T?t.jsx(vt,{onAccent:!0}):M.has_profile_picture?t.jsx("img",{src:M.profile_picture_url,alt:S}):j($)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:$}),H&&H!==$&&t.jsx("div",{className:"w-secsub w-truncate",children:H})]}),A&&t.jsxs("span",{className:"w-pill w-pill--current",children:[t.jsx(qe,{size:11,weight:"bold"}),"current"]}),t.jsx("span",{className:"w-kebab w-acct-out",role:"button","aria-disabled":P,title:"Sign out",onClick:Z=>k(Z,F),children:P?t.jsx(vt,{}):t.jsx(Aa,{size:15})})]},F)})}),a&&w&&t.jsx("div",{className:"w-acct-foot",children:t.jsxs("button",{className:"w-acct-add",onClick:N,children:[t.jsx(St,{size:15}),"Add another account"]})})]})}):null},vp=()=>{const{navigateToSignIn:e}=kt();return o.useEffect(()=>{e()},[e]),null},bp=()=>{const{navigateToSignUp:e}=kt();return o.useEffect(()=>{e()},[e]),null},yp=()=>{var A,T;const{organizationMemberships:e,refetch:a,loading:s}=wa(),{workspaces:n}=ga(),{switchOrganization:i,switchWorkspace:l}=it(),{deployment:m}=ke(),[c,d]=o.useState(null),[p,u]=o.useState("orgList"),[h,f]=o.useState(null),g=((m==null?void 0:m.b2b_settings.organizations_enabled)??!1)&&((m==null?void 0:m.b2b_settings.workspaces_enabled)??!1),x=(m==null?void 0:m.b2b_settings.allow_users_to_create_orgs)??!1,w=o.useRef(!1);o.useEffect(()=>{if(!(w.current||!e)){if(w.current=!0,e.length===0){u("createOrg");return}if(!g){u("orgList");return}if(!n||n.length===0){const P=e.find(S=>{var $,H;return!(($=S.eligibility_restriction)!=null&&$.type)||((H=S.eligibility_restriction)==null?void 0:H.type)==="none"});if(P){f(P.organization.id),u("createWorkspace");return}}u("orgList")}},[e,n,g]);const b=P=>P.split(" ").map(S=>S[0]).join("").toUpperCase().slice(0,2),j=async P=>{if(g){f(P.id),u("workspaceList");return}d(P.id);try{await i(P.id)}finally{d(null)}},v=async P=>{d(P.id);try{await l(P.id)}finally{d(null)}},k=async P=>{var $;await a();const S=(($=P==null?void 0:P.data)==null?void 0:$.organization)||(P==null?void 0:P.organization)||P;if(!g){u("orgList");return}S!=null&&S.id?(f(S.id),u("createWorkspace")):u("orgList")},N=async P=>{var $;const S=(P==null?void 0:P.id)??(($=P==null?void 0:P.workspace)==null?void 0:$.id);if(S){d(S);try{await l(S)}finally{d(null)}}},_=async()=>{f(null),u("orgList")},C=(A=e==null?void 0:e.find(P=>P.organization.id===h))==null?void 0:A.organization,y=h?n==null?void 0:n.filter(P=>P.organization.id===h):[];if(s)return null;if(p==="createOrg")return t.jsx(ze.Body,{style:{padding:0},children:t.jsx(mn,{onSuccess:k,onCancel:()=>u("orgList")})});if(p==="createWorkspace"&&h)return t.jsx(ze.Body,{style:{padding:0},children:t.jsx(Lr,{organizationId:h,onSuccess:N,onCancel:()=>u("workspaceList"),onCreateOrganization:()=>u("createOrg")})});const E=p==="workspaceList",M=E?"Select a workspace":"Select an organization",F=E?`Choose a workspace in ${(C==null?void 0:C.name)||""}`:`to continue to ${((T=m==null?void 0:m.ui_settings)==null?void 0:T.app_name)||"App"}`;return t.jsxs("div",{className:"w-split",children:[t.jsxs("div",{className:"w-split-aside w-flex-col w-justify-between w-gap-6",children:[t.jsxs("div",{className:"w-flex-col w-gap-4",children:[t.jsx(Sr,{placement:"left"}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-title",children:M}),t.jsx("p",{className:"w-sub",children:F})]})]}),t.jsx(Dr,{showName:!0})]}),t.jsxs("div",{className:"w-split-main",children:[t.jsxs("div",{className:"w-grow w-flex-col",style:{overflow:"hidden",marginBottom:24},children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-2",style:{marginBottom:8},children:[E&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:_,"aria-label":"Go back",title:"Go back",children:t.jsx(nn,{})}),t.jsx("h2",{className:"w-sec",children:E?"Workspaces":"Your organizations"})]}),t.jsx("div",{className:"w-grow w-flex-col",style:{overflowY:"auto"},children:E?t.jsx(t.Fragment,{children:y&&y.length>0?y.map(P=>{var $,H,R;const S=(($=P.eligibility_restriction)==null?void 0:$.type)!=="none"&&((H=P.eligibility_restriction)==null?void 0:H.type)!==void 0;return t.jsxs("button",{className:"w-listrow",onClick:()=>!S&&v(P),disabled:c===P.id||S,title:S?(R=P.eligibility_restriction)==null?void 0:R.message:void 0,children:[t.jsx("div",{className:"w-avatar w-avatar--lg",children:P.image_url?t.jsx("img",{src:P.image_url,alt:P.name}):b(P.name).charAt(0)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:P.name}),t.jsxs("div",{className:"w-secsub w-inline w-gap-1",children:[t.jsx(cs,{}),"Workspace"]})]}),t.jsxs("div",{className:"w-inline w-gap-1 w-text-secondary",children:[S&&t.jsx(Ma,{size:16,className:"w-text-error"}),t.jsx(Qt,{})]})]},P.id)}):t.jsxs("div",{className:"w-empty",children:[t.jsx("div",{className:"w-empty-ic",children:t.jsx(cs,{size:20})}),t.jsxs("div",{className:"w-empty-text",children:[t.jsx("h4",{children:"No workspaces yet"}),t.jsxs("p",{children:["Create your first workspace for"," ",(C==null?void 0:C.name)||"this organization"]})]}),t.jsx("div",{className:"w-empty-action",children:t.jsxs(se,{$size:"sm",onClick:()=>u("createWorkspace"),children:[t.jsx(St,{}),"Create workspace"]})})]})}):e&&e.length>0?e.map(P=>{var D,Y,B,Q,ue;const S=P.organization,$=n==null?void 0:n.filter(we=>we.organization.id===S.id),H=($==null?void 0:$.length)||0,R=S.member_count,O=((Y=(D=P.roles)==null?void 0:D[0])==null?void 0:Y.name)||"No role",Z=P.roles.length-1,L=Z>0?`${O.charAt(0).toUpperCase()+O.slice(1)} +${Z}`:O.charAt(0).toUpperCase()+O.slice(1),U=((B=P.eligibility_restriction)==null?void 0:B.type)!=="none"&&((Q=P.eligibility_restriction)==null?void 0:Q.type)!==void 0;return t.jsxs("button",{className:"w-listrow",onClick:()=>!U&&j(S),disabled:c===S.id||U,title:U?(ue=P.eligibility_restriction)==null?void 0:ue.message:void 0,children:[t.jsx("div",{className:"w-avatar w-avatar--lg",children:S.image_url?t.jsx("img",{src:S.image_url,alt:S.name}):b(S.name)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:S.name}),t.jsx("div",{className:"w-secsub w-inline w-gap-1",children:g?t.jsxs(t.Fragment,{children:[t.jsx(cs,{}),H," ","workspace",H!==1?"s":""]}):t.jsxs(t.Fragment,{children:[t.jsx(ps,{}),L," •"," ",R," member",R!==1?"s":""]})})]}),t.jsxs("div",{className:"w-inline w-gap-1 w-text-secondary",children:[U&&t.jsx(Ma,{size:16,className:"w-text-error"}),t.jsx(Qt,{})]})]},S.id)}):t.jsxs("div",{className:"w-empty",children:[t.jsx("div",{className:"w-empty-ic",children:t.jsx(ps,{size:20})}),t.jsxs("div",{className:"w-empty-text",children:[t.jsx("h4",{children:"No organizations yet"}),t.jsx("p",{children:x?"Create your first organization to get started":"You don't have access to any organizations yet"})]}),x&&t.jsx("div",{className:"w-empty-action",children:t.jsxs(se,{$size:"sm",onClick:()=>u("createOrg"),children:[t.jsx(St,{}),"Create organization"]})})]})})]}),E&&h&&t.jsxs(se,{$outline:!0,onClick:()=>u("createWorkspace"),disabled:c!==null,children:[t.jsx(St,{size:12}),"Create workspace"]}),!E&&e&&e.length>0&&x&&t.jsxs(se,{$outline:!0,onClick:()=>u("createOrg"),disabled:c!==null,children:[t.jsx(St,{size:12}),"Create new organization"]})]})]})},jp=({children:e})=>{var h,f,g,x;const{activeOrganization:a}=fa(),{activeWorkspace:s}=Dt(),{deployment:n}=ke(),{loading:i,orgMembership:l,workspaceMembership:m}=Co(),c=((n==null?void 0:n.b2b_settings.organizations_enabled)??!1)&&((n==null?void 0:n.b2b_settings.workspaces_enabled)??!1),d=((h=l==null?void 0:l.eligibility_restriction)==null?void 0:h.type)!=="none"&&((f=l==null?void 0:l.eligibility_restriction)==null?void 0:f.type)!==void 0,p=((g=m==null?void 0:m.eligibility_restriction)==null?void 0:g.type)!=="none"&&((x=m==null?void 0:m.eligibility_restriction)==null?void 0:x.type)!==void 0;return i?null:(d||p||!a?!1:c?s?(m==null?void 0:m.workspace.id)===s.id&&m.organization_id===a.id:!1:!0)?t.jsx(t.Fragment,{children:e}):t.jsx(Re,{children:t.jsx(ze,{isOpen:!0,children:t.jsx(ze.Overlay,{children:t.jsx(ze.Content,{className:"w-flex w-justify-center",style:{padding:0,width:900,maxWidth:"90vw"},children:t.jsx(yp,{})})})})})},_p=e=>{const a=e.toLowerCase().trim();return["javascript:","data:","vbscript:"].some(i=>a.startsWith(i))?!0:["http://","https://","//","ftp://","ftps://","mailto:","tel:","sms:","file:","blob:"].some(i=>a.startsWith(i))},kp=e=>{const a=e.toLowerCase().trim();return!["javascript:","data:","vbscript:"].some(n=>a.startsWith(n))};exports.AcceptInvite=Sm;exports.AuthFormImage=Sr;exports.CreateOrganizationForm=mn;exports.CreateWorkspaceDialog=Pr;exports.CreateWorkspaceForm=Lr;exports.DefaultStylesProvider=Re;exports.DeploymentInitialized=v2;exports.DeploymentInitializing=b2;exports.DeploymentProvider=W0;exports.Dialog=ze;exports.DialogTrigger=Om;exports.Dropdown=_s;exports.DropdownDivider=Tc;exports.DropdownItem=ea;exports.DropdownItems=ks;exports.DropdownTrigger=Cs;exports.Form=Ic;exports.FormGroup=We;exports.Input=be;exports.Label=Te;exports.MagicLinkVerification=km;exports.ManageAccount=M0;exports.ManageAccountDialog=R0;exports.ManageOrganization=Yc;exports.ManageWorkspace=Xc;exports.ManageWorkspaceDialog=Or;exports.NavigateToSignIn=vp;exports.NavigateToSignUp=bp;exports.NavigationLink=Et;exports.NotificationBell=F0;exports.NotificationItem=O0;exports.NotificationPanel=Z0;exports.NotificationPopover=H0;exports.OAuthProvider=mo;exports.ORG_ADMIN_PERMISSIONS=e0;exports.ORG_MANAGEMENT_PERMISSIONS=t0;exports.OTPInput=va;exports.OrganizationSwitcher=n0;exports.PhoneNumberInput=ys;exports.PhoneVerification=Rc;exports.ProfileCompletion=Pc;exports.RequireActiveTenancy=jp;exports.SSOCallback=_m;exports.SignInForm=bm;exports.SignUpForm=mm;exports.SignedIn=wp;exports.SignedInAccounts=xp;exports.SignedOut=gp;exports.SimpleDialog=$m;exports.Spinner=je;exports.Switch=Za;exports.TwoFactorMethodSelector=Mc;exports.TwoFactorVerification=Lc;exports.UserButton=Dr;exports.UserControls=fp;exports.WORKSPACE_ADMIN_PERMISSIONS=a0;exports.WORKSPACE_MANAGEMENT_PERMISSIONS=s0;exports.WaitlistForm=jm;exports.canManageOrganization=Hr;exports.canManageWorkspace=Tr;exports.clearTokenCache=$t;exports.hasIncompleteProfile=Cm;exports.hasOrgPermission=Zr;exports.hasWorkspacePermission=Fr;exports.isExternalUrl=_p;exports.isOrgAdmin=E4;exports.isSafeUrl=kp;exports.isWorkspaceAdmin=A4;exports.redirectToProfileCompletion=Nm;exports.useActiveOrganization=fa;exports.useActiveTenancy=Co;exports.useActiveWorkspace=Dt;exports.useActorMcpServers=zd;exports.useActorProjectSearch=Md;exports.useActorProjects=Ad;exports.useActorThreadSearch=Pd;exports.useAgentSession=_d;exports.useAgentThread=$d;exports.useAgentThreadAssignments=Zd;exports.useAgentThreadConversation=jd;exports.useAgentThreadFilesystem=Od;exports.useAgentThreadTaskGraphs=Id;exports.useApiAuthAppSession=h2;exports.useApiAuthAuditAnalytics=g2;exports.useApiAuthAuditLogs=w2;exports.useApiAuthAuditTimeseries=x2;exports.useApiAuthKeys=f2;exports.useClient=ye;exports.useCreateWebhookEndpoint=c2;exports.useDeployment=ke;exports.useExternalAgentConnections=Dd;exports.useForgotPassword=Ao;exports.useInvitation=Ho;exports.useMagicLinkVerification=Eo;exports.useNavigation=kt;exports.useNotificationStream=Mo;exports.useNotificationUnreadCount=Lo;exports.useNotifications=Ro;exports.useOrganizationList=zt;exports.useOrganizationMemberships=wa;exports.useProjectTaskBoardItem=Td;exports.useProjectTaskBoardItemComments=Vd;exports.useProjectTasks=Fd;exports.useProjectThreadFeed=Ld;exports.useProjectThreads=Rd;exports.useSSOCallback=So;exports.useSession=it;exports.useSignIn=po;exports.useSignUp=ho;exports.useThemeOverrideVars=ts;exports.useUser=xa;exports.useUserSignins=ko;exports.useWaitlist=No;exports.useWebhookAnalytics=m2;exports.useWebhookAppSession=i2;exports.useWebhookDeliveries=u2;exports.useWebhookEndpoints=l2;exports.useWebhookEvents=d2;exports.useWebhookStats=o2;exports.useWebhookTimeseries=p2;exports.useWorkspaceList=ga;exports.useWorkspaceMemberships=tn;Object.keys(Ur).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>Ur[e]})});
118
+ `),ve=new Blob([J],{type:"text/plain"}),Ye=URL.createObjectURL(ve),Ve=document.createElement("a");Ve.href=Ye,Ve.download="wacht-backup-codes.txt",Ve.click(),URL.revokeObjectURL(Ye),g("Backup codes downloaded","info")},Wt=async()=>{var J,ve;if((ve=(J=e==null?void 0:e.auth_settings)==null?void 0:J.passkey)!=null&&ve.enabled)try{O(!0);const Ye=await u();H(Ye.data||[])}catch{g("Failed to load passkeys","error")}finally{O(!1)}},ba=async J=>{try{L(!0),await h(J||void 0),await Wt(),g("Passkey registered successfully!","info")}catch(ve){throw g(ve.message||"Failed to register passkey","error"),ve}finally{L(!1)}},ya=async J=>{try{await f(J),await Wt(),g("Passkey removed","info")}catch(ve){g(ve.message||"Failed to remove passkey","error")}};o.useEffect(()=>{Wt()},[(oe=(ra=e==null?void 0:e.auth_settings)==null?void 0:ra.passkey)==null?void 0:oe.enabled]);const yt=[];return lt&&yt.push({id:"password",name:"Password",description:"Secure your account with a strong password",status:a!=null&&a.has_password?"Enabled":"Disabled",actions:a!=null&&a.has_password?["change"]:["setup"],group:"sign-in"}),(Ne=(xe=e==null?void 0:e.auth_settings)==null?void 0:xe.passkey)!=null&&Ne.enabled&&yt.push({id:"passkey",name:"Passkeys",description:"Sign in faster with fingerprint, face, or screen lock",status:$.length>0?`${$.length} registered`:"",actions:$.length>0?["manage","add"]:["add"],group:"sign-in"}),ge!=null&&ge.authenticator&&yt.push({id:"authenticator",name:"Authenticator App",description:"Use an authenticator app for extra security",status:a!=null&&a.user_authenticator?"Enabled":"Disabled",actions:a!=null&&a.user_authenticator?["remove"]:["setup"],group:"sign-in"}),a!=null&&a.user_authenticator&&yt.push({id:"backup_codes",name:"Backup Codes",description:"Recovery codes if you lose your authenticator",status:a!=null&&a.backup_codes_generated?"Generated":"Not Generated",actions:["generate"],group:"recovery"}),a!=null&&a.user_authenticator&&yt.push({id:"second_factor_policy",name:"Require 2FA",description:"Require a second factor for all sign-ins",status:x==="enforced"?"Enforced":"Optional",actions:["toggle"],group:"recovery"}),ne!=="table"?t.jsxs(t.Fragment,{children:[t.jsxs(d0,{children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-3",children:[t.jsx(Xt,{size:16}),t.jsxs("span",{className:"w-sec",children:[ne==="qr"&&"Setup Two-Factor Authentication",ne==="verify"&&"Verify Your Authenticator",ne==="backup"&&"Save Your Backup Codes",ne==="success"&&"Setup Complete!"]})]}),t.jsx(se,{$outline:!0,$size:"sm",onClick:()=>ae("table"),children:"← Back"})]}),t.jsxs("div",{className:"w-narrow w-flex-col w-items-center w-gap-5",style:{textAlign:"center"},children:[ne==="qr"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"w-secsub",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),t.jsx("div",{className:"w-flex w-justify-center",children:le?t.jsxs("div",{className:"w-qr w-flex-col w-items-center w-gap-3",children:[t.jsx("span",{className:"w-spin"}),t.jsx("div",{className:"w-secsub",children:"Loading QR Code..."})]}):re?t.jsx("div",{className:"w-tile w-flex w-items-center w-justify-center",children:t.jsx(zr,{value:re,size:200,level:"M",marginSize:0})}):t.jsx("div",{className:"w-qr w-text-error",children:"QR Code Not Available"})}),t.jsxs("div",{className:"w-flex-col w-gap-2 w-full",children:[t.jsx("p",{className:"w-secsub",children:"Or enter this code manually:"}),t.jsx("div",{className:"w-token",children:t.jsx("code",{children:q||"Loading..."})})]}),t.jsx(se,{$fullWidth:!0,onClick:()=>ae("verify"),disabled:!re||!q,children:"I've Scanned the Code"})]}),ne==="verify"&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"w-secsub",children:"Enter two consecutive codes from your authenticator app to verify setup"}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(be,{type:"text",placeholder:"000000",value:Ee[0],onChange:J=>{const ve=J.target.value.replace(/[^0-9]/g,"").substring(0,6);ce([ve,Ee[1]])},maxLength:6,style:{textAlign:"center",fontFamily:"monospace"}}),t.jsx(be,{type:"text",placeholder:"000000",value:Ee[1],onChange:J=>{const ve=J.target.value.replace(/[^0-9]/g,"").substring(0,6);ce([Ee[0],ve])},maxLength:6,style:{textAlign:"center",fontFamily:"monospace"}})]}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(se,{$outline:!0,$size:"sm",onClick:()=>ae("qr"),children:"Back"}),t.jsx(se,{$size:"sm",onClick:me,disabled:de||Ee.some(J=>J.length!==6),children:de?"Verifying...":"Verify & Continue"})]})]}),ne==="backup"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-banner w-banner--warn",style:{textAlign:"left"},children:[t.jsx(Fa,{size:16}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-sec",children:"Important!"}),t.jsx("div",{className:"w-banner-txt",children:"Store these codes safely. Each code can only be used once if you lose access to your authenticator device."})]})]}),t.jsx("div",{className:"w-codes w-full",children:W.map((J,ve)=>t.jsx("span",{onClick:()=>navigator.clipboard.writeText(J),style:{cursor:"pointer"},children:J},ve))}),t.jsxs("div",{className:"w-flex w-justify-center w-gap-3",children:[t.jsx(se,{$outline:!0,$size:"sm",onClick:ct,children:"Copy All"}),t.jsxs(se,{$outline:!0,$size:"sm",onClick:Rt,children:[t.jsx(ll,{size:16}),"DownloadSimple"]})]}),t.jsx(se,{$fullWidth:!0,onClick:Ze,children:"Complete Setup"})]}),ne==="success"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"w-success",children:[t.jsx("span",{className:"ring"}),t.jsx("span",{className:"disc",children:t.jsx(qe,{size:26})})]}),t.jsxs("div",{className:"w-flex-col w-gap-1 w-items-center",children:[t.jsx("h3",{className:"w-title",children:"All Set!"}),t.jsx("p",{className:"w-secsub",children:"Your account is now protected with two-factor authentication."})]}),t.jsx(se,{$fullWidth:!0,onClick:Ze,children:"Continue to Security"})]})]})]}):t.jsx(t.Fragment,{children:yt.length?t.jsx("div",{children:yt.map((J,ve)=>{const Ye=ve>0?yt[ve-1].group:null,Ve=J.group!==Ye,jt=yt[ve+1],_t=jt&&jt.group===J.group;return t.jsxs("div",{children:[Ve&&t.jsx(M6,{$first:ve===0,children:J.group==="sign-in"?"Sign-in methods":"Recovery"}),t.jsxs(u0,{children:[t.jsxs(m0,{children:[t.jsx("div",{className:"w-flex w-items-center w-wrap w-gap-2 w-sec",children:t.jsx("span",{children:J.name})}),t.jsx("div",{className:"w-secsub",children:J.description})]}),t.jsx(p0,{children:t.jsxs("div",{className:"w-relative",children:[J.id==="password"&&t.jsx(t.Fragment,{children:a!=null&&a.has_password?t.jsxs("div",{className:"w-flex w-gap-2",children:[t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:T,onClick:()=>C(!0),children:"Change"}),_&&t.jsx(Gi,{triggerRef:T,onClose:()=>C(!1),onChangePassword:Ke})]}),ie()&&t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",ref:P,onClick:()=>E(!0),children:"Remove"}),y&&t.jsx(N6,{triggerRef:P,onClose:()=>E(!1),onRemovePassword:ee})]})]}):t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:T,onClick:()=>C(!0),children:"Setup"}),_&&t.jsx(Gi,{triggerRef:T,onClose:()=>C(!1),onChangePassword:Ke,isSetup:!0})]})}),J.id==="authenticator"&&!(a!=null&&a.user_authenticator)&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:A,onClick:()=>N(!0),disabled:le,children:le?"Setting up...":"Setup"}),k&&t.jsx(S6,{triggerRef:A,onClose:()=>N(!1),onSetupTOTP:async()=>{const Be=await i();return De(Be.id),Be},onVerifyTOTP:async Be=>{await l(Ie,Be),await a.refetch(),g("Two-factor authentication enabled successfully!","info")}})]})}),J.id==="authenticator"&&(a==null?void 0:a.user_authenticator)&&t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",onClick:()=>j(!0),disabled:Je,children:Je?"Removing...":"Remove"}),b&&t.jsx(Qa,{title:"Remove MFA and reset policy to default?",onConfirm:He,onCancel:()=>j(!1)})]}),J.id==="backup_codes"&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:S,onClick:Ge,disabled:K,children:K?"Generating...":a!=null&&a.backup_codes_generated?"Regenerate":"Generate"}),M&&t.jsx(E6,{triggerRef:S,codes:W,onClose:()=>F(!1),onCopy:ct,onDownload:Rt})]})}),J.id==="second_factor_policy"&&t.jsx(Za,{checked:x==="enforced",onChange:Be=>{v(Be?"enforced":"none")}}),J.id==="passkey"&&t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[t.jsxs(se,{$outline:!0,$size:"sm",onClick:()=>D(!U),children:[U?"Hide":"Manage"," ","(",$.length,")",t.jsx(Ut,{size:14,style:{transform:U?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]}),t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$size:"sm",ref:we,onClick:()=>B(!0),disabled:Z,children:Z?"Adding...":"Add"}),Y&&t.jsx(A6,{triggerRef:we,onClose:()=>B(!1),onAddPasskey:ba})]})]})]})})]}),J.id==="passkey"&&U&&t.jsx("div",{className:"w-flex-col w-gap-2",children:R?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):$.length===0?t.jsx("div",{className:"w-empty",children:t.jsx("p",{children:"No passkeys registered yet"})}):t.jsx("div",{className:"w-flex-col w-gap-2",children:$.map(Be=>t.jsxs("div",{className:"w-locked w-flex w-items-center w-justify-between",style:{height:"auto",padding:"10px 12px"},children:[t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("span",{className:"w-sec",children:Be.name||"Unnamed Passkey"}),t.jsxs("span",{className:"w-secsub",children:[Be.device_type==="platform"?"This device":"Security key",Be.last_used_at&&` • Last used ${new Date(Be.last_used_at).toLocaleDateString()}`]})]}),t.jsxs("div",{className:"w-relative",children:[t.jsx(se,{$destructive:!0,$size:"sm",onClick:()=>ue(Be.id),children:"Remove"}),Q===Be.id&&t.jsx(Qa,{title:`Remove "${Be.name||"Unnamed Passkey"}"?`,onConfirm:()=>{ya(Be.id),ue(null)},onCancel:()=>ue(null)})]})]},Be.id))})}),_t&&t.jsx("div",{className:"w-hr"})]},J.id)})}):t.jsx(Nt,{title:"No security features available",description:"Contact your administrator to enable security features."})})},L6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",...e,children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"a",x1:3.217,x2:44.781,y1:15,y2:15,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#d93025"}),t.jsx("stop",{offset:1,stopColor:"#ea4335"})]}),t.jsxs("linearGradient",{id:"b",x1:20.722,x2:41.504,y1:47.679,y2:11.684,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#fcc934"}),t.jsx("stop",{offset:1,stopColor:"#fbbc04"})]}),t.jsxs("linearGradient",{id:"c",x1:26.598,x2:5.816,y1:46.502,y2:10.506,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#1e8e3e"}),t.jsx("stop",{offset:1,stopColor:"#34a853"})]})]}),t.jsx("circle",{cx:24,cy:23.995,r:12,style:{fill:"#fff"}}),t.jsx("path",{d:"M3.215 36A24 24 0 1 0 12 3.215 24 24 0 0 0 3.215 36Zm31.177-18A12 12 0 1 1 18 13.608 12 12 0 0 1 34.392 18Z",style:{fill:"none"}}),t.jsx("path",{d:"M24 12h20.781a23.994 23.994 0 0 0-41.564.003L13.607 30l.01-.002A11.985 11.985 0 0 1 24 12Z",style:{fill:"url(#a)"}}),t.jsx("circle",{cx:24,cy:24,r:9.5,style:{fill:"#1a73e8"}}),t.jsx("path",{d:"M34.391 30.003 24.001 48A23.994 23.994 0 0 0 44.78 12.003H23.999l-.003.01a11.985 11.985 0 0 1 10.395 17.99Z",style:{fill:"url(#b)"}}),t.jsx("path",{d:"M13.609 30.003 3.218 12.006A23.994 23.994 0 0 0 24.003 48l10.39-17.997-.007-.007a11.985 11.985 0 0 1-20.777.007Z",style:{fill:"url(#c)"}})]}),P6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:512,height:512,viewBox:"0 0 512 512",...e,children:[t.jsxs("defs",{children:[t.jsxs("radialGradient",{id:"g",cx:"210%",cy:"-100%",r:"290%",children:[t.jsx("stop",{offset:.1,stopColor:"#ffe226"}),t.jsx("stop",{offset:.79,stopColor:"#ff7139"})]}),t.jsxs("radialGradient",{id:"c",cx:"49%",cy:"40%",r:"128%",gradientTransform:"matrix(.82 0 0 1 .088 0)",children:[t.jsx("stop",{offset:.3,stopColor:"#960e18"}),t.jsx("stop",{offset:.35,stopColor:"#b11927",stopOpacity:.74}),t.jsx("stop",{offset:.43,stopColor:"#db293d",stopOpacity:.34}),t.jsx("stop",{offset:.5,stopColor:"#f5334b",stopOpacity:.09}),t.jsx("stop",{offset:.53,stopColor:"#ff3750",stopOpacity:0})]}),t.jsxs("radialGradient",{id:"d",cx:"48%",cy:"-12%",r:"140%",children:[t.jsx("stop",{offset:.13,stopColor:"#fff44f"}),t.jsx("stop",{offset:.53,stopColor:"#ff980e"})]}),t.jsxs("radialGradient",{id:"e",cx:"22.76%",cy:"110.11%",r:"100%",children:[t.jsx("stop",{offset:.35,stopColor:"#3a8ee6"}),t.jsx("stop",{offset:.67,stopColor:"#9059ff"}),t.jsx("stop",{offset:1,stopColor:"#c139e6"})]}),t.jsxs("radialGradient",{id:"f",cx:"52%",cy:"33%",r:"59%",gradientTransform:"scale(.9 1)",children:[t.jsx("stop",{offset:.21,stopColor:"#9059ff",stopOpacity:0}),t.jsx("stop",{offset:.97,stopColor:"#6e008b",stopOpacity:.6})]}),t.jsxs("radialGradient",{id:"b",cx:"87.4%",cy:"-12.9%",r:"128%",gradientTransform:"matrix(.8 0 0 1 .178 .129)",children:[t.jsx("stop",{offset:.13,stopColor:"#ffbd4f"}),t.jsx("stop",{offset:.28,stopColor:"#ff980e"}),t.jsx("stop",{offset:.47,stopColor:"#ff3750"}),t.jsx("stop",{offset:.78,stopColor:"#eb0878"}),t.jsx("stop",{offset:.86,stopColor:"#e50080"})]}),t.jsxs("radialGradient",{id:"h",cx:"84%",cy:"-41%",r:"180%",children:[t.jsx("stop",{offset:.11,stopColor:"#fff44f"}),t.jsx("stop",{offset:.46,stopColor:"#ff980e"}),t.jsx("stop",{offset:.72,stopColor:"#ff3647"}),t.jsx("stop",{offset:.9,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"i",cx:"16.1%",cy:"-18.6%",r:"348.8%",gradientTransform:"scale(1 .47) rotate(84 .279 -.297)",children:[t.jsx("stop",{offset:0,stopColor:"#fff44f"}),t.jsx("stop",{offset:.3,stopColor:"#ff980e"}),t.jsx("stop",{offset:.57,stopColor:"#ff3647"}),t.jsx("stop",{offset:.74,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"j",cx:"18.9%",cy:"-42.5%",r:"238.4%",children:[t.jsx("stop",{offset:.14,stopColor:"#fff44f"}),t.jsx("stop",{offset:.48,stopColor:"#ff980e"}),t.jsx("stop",{offset:.66,stopColor:"#ff3647"}),t.jsx("stop",{offset:.9,stopColor:"#e31587"})]}),t.jsxs("radialGradient",{id:"k",cx:"159.3%",cy:"-44.72%",r:"313.1%",children:[t.jsx("stop",{offset:.09,stopColor:"#fff44f"}),t.jsx("stop",{offset:.63,stopColor:"#ff980e"})]}),t.jsxs("linearGradient",{id:"a",x1:"87.25%",x2:"9.4%",y1:"15.5%",y2:"93.1%",children:[t.jsx("stop",{offset:.05,stopColor:"#fff44f"}),t.jsx("stop",{offset:.37,stopColor:"#ff980e"}),t.jsx("stop",{offset:.53,stopColor:"#ff3647"}),t.jsx("stop",{offset:.7,stopColor:"#e31587"})]}),t.jsxs("linearGradient",{id:"l",x1:"80%",x2:"18%",y1:"14%",y2:"84%",children:[t.jsx("stop",{offset:.17,stopColor:"#fff44f",stopOpacity:.8}),t.jsx("stop",{offset:.6,stopColor:"#fff44f",stopOpacity:0})]})]}),t.jsx("path",{fill:"url(#a)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0 .039.015.136.047.4C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484a120.249 120.249 0 0 0-66.142 25.488 71.355 71.355 0 0 0-6.225-4.7 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.442 26.913c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-.212 1.061-.324 1.586-.452 2.116-2.08 12.7-2.365 15-.022.177-.032.347-.053.524a229.066 229.066 0 0 0-3.9 33.157c0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746zM201.716 354.447c1.124.537 2.18 1.124 3.334 1.639.048.033.114.07.163.1a126.191 126.191 0 0 1-3.497-1.739zm55.053-144.93zm198.131-30.59-.032-.233c.012.085.027.174.04.259z"}),t.jsx("path",{fill:"url(#b)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0-.058.011.048.036.226.012.085.027.174.04.259 22.675 61.47 10.322 123.978-7.479 162.175-27.539 59.1-94.215 119.67-198.576 116.716C136.1 454.651 36.766 370.988 18.223 261.41c-3.379-17.28 0-26.054 1.7-40.084-2.071 10.816-2.86 13.94-3.9 33.157 0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746z"}),t.jsx("path",{fill:"url(#c)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0-.058.011.048.036.226.012.085.027.174.04.259 22.675 61.47 10.322 123.978-7.479 162.175-27.539 59.1-94.215 119.67-198.576 116.716C136.1 454.651 36.766 370.988 18.223 261.41c-3.379-17.28 0-26.054 1.7-40.084-2.071 10.816-2.86 13.94-3.9 33.157 0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746z"}),t.jsx("path",{fill:"url(#d)",d:"M361.922 194.6c.524.368 1 .734 1.493 1.1a130.706 130.706 0 0 0-22.31-29.112C266.4 91.892 321.516 4.626 330.811.194c.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484 2.8-.194 5.592-.429 8.442-.429 45.051 0 84.289 24.77 105.301 61.487z"}),t.jsx("path",{fill:"url(#e)",d:"M256.772 209.514c-.393 5.978-21.514 26.593-28.9 26.593-68.339 0-79.432 41.335-79.432 41.335 3.027 34.81 27.261 63.475 56.611 78.643 1.339.692 2.694 1.317 4.05 1.935a132.768 132.768 0 0 0 7.059 2.886 106.743 106.743 0 0 0 31.271 6.031c119.78 5.618 142.986-143.194 56.545-186.408 22.137-3.85 45.115 5.053 57.947 14.067-21.012-36.714-60.25-61.484-105.3-61.484-2.85 0-5.641.235-8.442.429a120.249 120.249 0 0 0-66.142 25.488c3.664 3.1 7.8 7.244 16.514 15.828 16.302 16.067 58.13 32.705 58.219 34.657z"}),t.jsx("path",{fill:"url(#f)",d:"M256.772 209.514c-.393 5.978-21.514 26.593-28.9 26.593-68.339 0-79.432 41.335-79.432 41.335 3.027 34.81 27.261 63.475 56.611 78.643 1.339.692 2.694 1.317 4.05 1.935a132.768 132.768 0 0 0 7.059 2.886 106.743 106.743 0 0 0 31.271 6.031c119.78 5.618 142.986-143.194 56.545-186.408 22.137-3.85 45.115 5.053 57.947 14.067-21.012-36.714-60.25-61.484-105.3-61.484-2.85 0-5.641.235-8.442.429a120.249 120.249 0 0 0-66.142 25.488c3.664 3.1 7.8 7.244 16.514 15.828 16.302 16.067 58.13 32.705 58.219 34.657z"}),t.jsx("path",{fill:"url(#g)",d:"M170.829 151.036a244.042 244.042 0 0 1 4.981 3.3 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7 1.155-.033 36.014-.66 53.543 10.732z"}),t.jsx("path",{fill:"url(#h)",d:"M18.223 261.41C36.766 370.988 136.1 454.651 248.855 457.844c104.361 2.954 171.037-57.62 198.576-116.716 17.8-38.2 30.154-100.7 7.479-162.175l-.008-.026-.032-.233c-.025-.178-.04-.284-.036-.226 0 .039.015.136.047.4 8.524 55.661-19.79 109.584-64.051 146.044l-.133.313c-86.245 70.223-168.774 42.368-185.484 30.966a144.108 144.108 0 0 1-3.5-1.743c-50.282-24.029-71.054-69.838-66.6-109.124-42.457 0-56.934-35.809-56.934-35.809s38.119-27.179 88.358-3.541c46.53 21.893 90.228 3.543 90.233 3.541-.089-1.952-41.917-18.59-58.223-34.656-8.713-8.584-12.85-12.723-16.514-15.828a71.355 71.355 0 0 0-6.225-4.7 282.929 282.929 0 0 0-4.981-3.3c-17.528-11.392-52.388-10.765-53.543-10.735h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.442 26.919c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-8.65 37.842-4.44 57.199z"}),t.jsx("path",{fill:"url(#i)",d:"M341.105 166.587a130.706 130.706 0 0 1 22.31 29.112c1.323.994 2.559 1.985 3.608 2.952 54.482 50.2 25.936 121.2 23.807 126.26 44.261-36.46 72.575-90.383 64.051-146.044C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1-9.291 4.428-64.407 91.694 10.298 166.389z"}),t.jsx("path",{fill:"url(#j)",d:"M367.023 198.651c-1.049-.967-2.285-1.958-3.608-2.952-.489-.368-.969-.734-1.493-1.1-12.832-9.014-35.81-17.917-57.947-14.067 86.441 43.214 63.235 192.026-56.545 186.408a106.743 106.743 0 0 1-31.271-6.031 134.51 134.51 0 0 1-7.059-2.886c-1.356-.618-2.711-1.243-4.05-1.935.048.033.114.07.163.1 16.71 11.4 99.239 39.257 185.484-30.966l.133-.313c2.129-5.054 30.675-76.057-23.807-126.258z"}),t.jsx("path",{fill:"url(#k)",d:"M148.439 277.443s11.093-41.335 79.432-41.335c7.388 0 28.509-20.615 28.9-26.593s-43.7 18.352-90.233-3.541c-50.239-23.638-88.358 3.541-88.358 3.541s14.477 35.809 56.934 35.809c-4.453 39.286 16.319 85.1 66.6 109.124 1.124.537 2.18 1.124 3.334 1.639-29.348-15.169-53.582-43.834-56.609-78.644z"}),t.jsx("path",{fill:"url(#l)",d:"M478.711 166.353c-10.445-25.124-31.6-52.248-48.212-60.821 13.52 26.505 21.345 53.093 24.335 72.936 0 .039.015.136.047.4C427.706 111.135 381.627 83.823 344 24.355c-1.9-3.007-3.805-6.022-5.661-9.2a73.716 73.716 0 0 1-2.646-4.972A43.7 43.7 0 0 1 332.1.677a.626.626 0 0 0-.546-.644.818.818 0 0 0-.451 0c-.034.012-.084.051-.12.065-.053.021-.12.069-.176.1.027-.036.083-.117.1-.136-60.37 35.356-80.85 100.761-82.732 133.484 2.8-.194 5.592-.429 8.442-.429 45.053 0 84.291 24.77 105.3 61.484-12.832-9.014-35.81-17.917-57.947-14.067 86.441 43.214 63.235 192.026-56.545 186.408a106.743 106.743 0 0 1-31.271-6.031 134.51 134.51 0 0 1-7.059-2.886c-1.356-.618-2.711-1.243-4.05-1.935.048.033.114.07.163.1a144.108 144.108 0 0 1-3.5-1.743c1.124.537 2.18 1.124 3.334 1.639-29.35-15.168-53.584-43.833-56.611-78.643 0 0 11.093-41.335 79.432-41.335 7.388 0 28.509-20.615 28.9-26.593-.089-1.952-41.917-18.59-58.223-34.656-8.713-8.584-12.85-12.723-16.514-15.828a71.355 71.355 0 0 0-6.225-4.7 111.338 111.338 0 0 1-.674-58.732c-24.688 11.241-43.89 29.01-57.85 44.7h-.111c-9.527-12.067-8.855-51.873-8.312-60.184-.114-.515-7.107 3.63-8.023 4.255a175.073 175.073 0 0 0-23.486 20.12 210.478 210.478 0 0 0-22.435 26.916c0 .012-.007.026-.011.038 0-.013.007-.026.011-.038a202.838 202.838 0 0 0-32.247 72.805c-.115.521-.212 1.061-.324 1.586-.452 2.116-2.486 12.853-2.77 15.156-.022.177.021-.176 0 0a279.565 279.565 0 0 0-3.544 33.53c0 .41-.025.816-.025 1.227C16 388.418 123.6 496 256.324 496c118.865 0 217.56-86.288 236.882-199.63.407-3.076.733-6.168 1.092-9.271 4.777-41.21-.53-84.525-15.587-120.746zm-23.841 12.341c.012.085.027.174.04.259l-.008-.026-.032-.233z"})]}),$6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:250.076,height:248.707,viewBox:"0 0 66.166 65.804",...e,children:[t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"b",children:[t.jsx("stop",{offset:0,stopColor:"#06c2e7"}),t.jsx("stop",{offset:.25,stopColor:"#0db8ec"}),t.jsx("stop",{offset:.5,stopColor:"#12aef1"}),t.jsx("stop",{offset:.75,stopColor:"#1f86f9"}),t.jsx("stop",{offset:1,stopColor:"#107ddd"})]}),t.jsxs("linearGradient",{id:"a",children:[t.jsx("stop",{offset:0,stopColor:"#bdbdbd"}),t.jsx("stop",{offset:1,stopColor:"#fff"})]}),t.jsx("linearGradient",{xlinkHref:"#a",id:"d",x1:412.975,x2:412.975,y1:237.608,y2:59.392,gradientTransform:"translate(206.79 159.773) scale(.35154)",gradientUnits:"userSpaceOnUse"}),t.jsx("filter",{id:"f",width:1.042,height:1.045,x:-.021,y:-.022,colorInterpolationFilters:"sRGB",children:t.jsx("feGaussianBlur",{stdDeviation:.958})}),t.jsx("filter",{id:"c",width:1.096,height:1.096,x:-.048,y:-.048,colorInterpolationFilters:"sRGB",children:t.jsx("feGaussianBlur",{stdDeviation:3.564})}),t.jsx("radialGradient",{xlinkHref:"#b",id:"e",cx:413.061,cy:136.818,r:82.125,fx:413.061,fy:136.818,gradientTransform:"translate(194.545 155.58) scale(.38143)",gradientUnits:"userSpaceOnUse"})]}),t.jsx("path",{d:"M502.083 148.5a89.108 89.108 0 0 1-89.108 89.108 89.108 89.108 0 0 1-89.108-89.108 89.108 89.108 0 0 1 89.108-89.108 89.108 89.108 0 0 1 89.108 89.108Z",filter:"url(#c)",opacity:.53,paintOrder:"markers stroke fill",transform:"matrix(.33865 0 0 .3261 -106.77 -14.478)"}),t.jsx("path",{fill:"url(#d)",stroke:"#cdcdcd",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.093,d:"M383.294 211.977a31.325 31.325 0 0 1-31.325 31.325 31.325 31.325 0 0 1-31.326-31.325 31.325 31.325 0 0 1 31.326-31.325 31.325 31.325 0 0 1 31.325 31.325z",paintOrder:"markers stroke fill",transform:"translate(-318.886 -180.595)"}),t.jsx("path",{fill:"url(#e)",d:"M380.84 211.977a28.87 28.87 0 0 1-28.871 28.87 28.87 28.87 0 0 1-28.871-28.87 28.87 28.87 0 0 1 28.87-28.87 28.87 28.87 0 0 1 28.871 28.87z",paintOrder:"markers stroke fill",transform:"translate(-318.886 -180.595)"}),t.jsx("path",{fill:"#f4f2f3",d:"M33.083 4.017a.42.42 0 0 0-.421.42v4.856a.42.42 0 1 0 .842 0V4.438a.42.42 0 0 0-.421-.421zm-2.754.174a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.087l-.212-2.03a.42.42 0 0 0-.377-.376zm5.527.002a.42.42 0 0 0-.377.375l-.214 2.03a.42.42 0 1 0 .837.089l.214-2.031a.42.42 0 0 0-.46-.463zM27.5 4.6a.42.42 0 0 0-.41.508l1.005 4.75a.42.42 0 1 0 .824-.174l-1.005-4.75A.42.42 0 0 0 27.5 4.6zm11.183.004a.42.42 0 0 0-.414.333l-1.009 4.75a.42.42 0 1 0 .824.175l1.009-4.75a.42.42 0 0 0-.41-.508zm-13.883.757a.42.42 0 0 0-.437.55l.632 1.942a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.365-.29zm16.568.001a.42.42 0 0 0-.364.29l-.632 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.436-.55zM22.13 6.34a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.972-4.437a.42.42 0 0 0-.393-.25zm21.937.015a.42.42 0 0 0-.392.25l-1.978 4.434a.42.42 0 1 0 .769.343l1.978-4.434a.42.42 0 0 0-.377-.593zM19.654 7.65a.42.42 0 0 0-.394.63l1.02 1.77a.42.42 0 1 0 .73-.421L19.989 7.86a.42.42 0 0 0-.335-.21zm26.858 0a.419.419 0 0 0-.335.21l-1.021 1.769a.42.42 0 1 0 .73.42l1.02-1.768a.42.42 0 0 0-.394-.63zm-29.265 1.5a.422.422 0 0 0-.326.669l2.85 3.93a.42.42 0 1 0 .682-.494l-2.85-3.93a.42.42 0 0 0-.356-.174zm31.702.022a.42.42 0 0 0-.356.174l-2.856 3.926a.42.42 0 1 0 .681.495l2.856-3.926a.42.42 0 0 0-.325-.669zm-33.852 1.783a.42.42 0 0 0-.335.702l1.366 1.518a.42.42 0 1 0 .626-.563l-1.366-1.518a.42.42 0 0 0-.291-.14zm35.975.003a.421.421 0 0 0-.29.139l-1.367 1.517a.42.42 0 1 0 .625.564l1.367-1.518a.42.42 0 0 0-.335-.702zm-38.037 1.977a.42.42 0 0 0-.26.733l3.61 3.249a.42.42 0 1 0 .563-.626l-3.609-3.248a.42.42 0 0 0-.304-.108zm40.109.014a.419.419 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .562.626l3.61-3.245a.42.42 0 0 0-.258-.734zm-41.823 2.19a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm43.535.015a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .495.681l1.653-1.2a.42.42 0 0 0-.262-.76zM9.72 17.49a.42.42 0 0 0-.18.785l4.204 2.427a.42.42 0 1 0 .42-.729L9.96 17.546a.42.42 0 0 0-.24-.056zm46.728 0a.417.417 0 0 0-.24.056l-4.205 2.427a.42.42 0 1 0 .42.73l4.206-2.428a.42.42 0 0 0-.181-.785zM8.508 19.996a.42.42 0 0 0-.18.806l1.866.832a.42.42 0 1 0 .343-.77l-1.866-.831a.42.42 0 0 0-.163-.037zm49.158.017a.42.42 0 0 0-.164.037l-1.865.83a.42.42 0 1 0 .342.77l1.866-.831a.42.42 0 0 0-.179-.806zM7.429 22.615a.42.42 0 0 0-.094.82l4.615 1.504a.42.42 0 1 0 .261-.8l-4.616-1.504a.421.421 0 0 0-.166-.02zm51.314.018a.408.408 0 0 0-.166.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.617-1.5a.42.42 0 0 0-.094-.82zM6.756 25.365a.42.42 0 0 0-.09.833l1.998.424a.42.42 0 1 0 .175-.823l-1.998-.425a.413.413 0 0 0-.085-.009zm52.655.004a.518.518 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zM6.247 28.13a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.829-.51a.432.432 0 0 0-.085 0zm53.676.037a.386.386 0 0 0-.085 0l-4.83.504a.42.42 0 1 0 .088.837l4.83-.504a.42.42 0 0 0-.003-.837zM6.165 30.96a.42.42 0 1 0 0 .842h2.043a.42.42 0 1 0 0-.842zm51.793 0a.42.42 0 1 0 0 .842h2.043a.42.42 0 1 0 0-.842zm-46.803 2.295a.384.384 0 0 0-.085 0l-4.83.504a.42.42 0 1 0 .088.838l4.83-.504a.42.42 0 0 0-.003-.838zm43.853.03a.42.42 0 0 0-.003.838l4.828.51a.42.42 0 1 0 .089-.837l-4.828-.51a.434.434 0 0 0-.086-.001zM8.748 36.13a.43.43 0 0 0-.085.009l-1.998.424a.42.42 0 1 0 .175.823l1.998-.424a.42.42 0 0 0-.09-.833zm48.67.004a.42.42 0 0 0-.09.833l1.997.424a.42.42 0 1 0 .175-.824l-1.998-.424a.413.413 0 0 0-.085-.01zM12.111 37.79a.408.408 0 0 0-.166.02l-4.617 1.5a.42.42 0 1 0 .26.801l4.617-1.5a.42.42 0 0 0-.094-.82zm41.937.015a.42.42 0 0 0-.094.82l4.616 1.504a.42.42 0 1 0 .26-.8l-4.615-1.504a.421.421 0 0 0-.167-.02zM10.35 41.08a.42.42 0 0 0-.163.036l-1.866.831a.42.42 0 1 0 .342.769l1.866-.83a.42.42 0 0 0-.179-.806zm45.459.016a.42.42 0 0 0-.18.805l1.865.832a.42.42 0 1 0 .343-.769l-1.865-.832a.42.42 0 0 0-.163-.036zm-41.826.912a.417.417 0 0 0-.24.056L9.538 44.49a.42.42 0 1 0 .421.73l4.205-2.428a.42.42 0 0 0-.181-.785zm38.2 0a.42.42 0 0 0-.181.785l4.205 2.427a.42.42 0 1 0 .42-.729l-4.204-2.427a.42.42 0 0 0-.24-.056zm-39.249 3.562a.421.421 0 0 0-.233.08l-1.653 1.2a.42.42 0 1 0 .495.682l1.653-1.2a.42.42 0 0 0-.262-.762zm40.288.015a.42.42 0 0 0-.262.762l1.652 1.2a.42.42 0 1 0 .495-.681l-1.652-1.2a.42.42 0 0 0-.233-.081zm-36.544.145a.418.418 0 0 0-.304.108l-3.61 3.245a.42.42 0 1 0 .562.626l3.61-3.245a.42.42 0 0 0-.258-.734zm32.8.011a.421.421 0 0 0-.26.734l3.609 3.248a.42.42 0 1 0 .563-.625l-3.608-3.249a.42.42 0 0 0-.304-.107zm-29.375 3.084a.42.42 0 0 0-.355.173l-2.856 3.927a.42.42 0 1 0 .68.495l2.857-3.926a.42.42 0 0 0-.326-.669zm25.936.018a.421.421 0 0 0-.326.668l2.85 3.93a.42.42 0 1 0 .682-.494l-2.851-3.93a.42.42 0 0 0-.355-.174zm-29.623.606a.421.421 0 0 0-.29.14l-1.367 1.517a.42.42 0 1 0 .625.563l1.367-1.517a.42.42 0 0 0-.335-.703zm33.331.002a.42.42 0 0 0-.335.702l1.366 1.518a.42.42 0 1 0 .626-.563l-1.366-1.518a.42.42 0 0 0-.291-.139zm-25.655 1.684a.419.419 0 0 0-.393.25l-1.978 4.433a.42.42 0 1 0 .77.343l1.977-4.434a.42.42 0 0 0-.376-.592zm17.955.012a.42.42 0 0 0-.377.592l1.972 4.437a.42.42 0 1 0 .77-.342l-1.972-4.437a.42.42 0 0 0-.393-.25zm-21.431 1.359a.419.419 0 0 0-.335.21l-1.021 1.768a.42.42 0 1 0 .729.421l1.02-1.769a.42.42 0 0 0-.393-.63zm24.934 0a.42.42 0 0 0-.394.63l1.021 1.77a.42.42 0 1 0 .73-.422l-1.022-1.769a.42.42 0 0 0-.335-.21zm-17.054.063a.42.42 0 0 0-.415.334l-1.009 4.749a.42.42 0 1 0 .824.175l1.009-4.75a.42.42 0 0 0-.41-.508zm9.16.003a.42.42 0 0 0-.41.508l1.006 4.75a.42.42 0 1 0 .823-.175l-1.006-4.75a.42.42 0 0 0-.414-.333zm-4.573.48a.42.42 0 0 0-.421.42v4.855a.42.42 0 1 0 .842 0v-4.855a.42.42 0 0 0-.421-.42zm-7.727 1.568a.42.42 0 0 0-.364.29l-.631 1.942a.42.42 0 1 0 .8.26l.632-1.942a.42.42 0 0 0-.437-.55zm15.45 0a.42.42 0 0 0-.437.55l.632 1.943a.42.42 0 1 0 .8-.26l-.63-1.942a.42.42 0 0 0-.365-.29zm-10.365 1.083a.42.42 0 0 0-.378.375l-.213 2.03a.42.42 0 1 0 .837.088l.214-2.03a.42.42 0 0 0-.46-.463zm5.267.002a.42.42 0 0 0-.46.463l.212 2.03a.42.42 0 1 0 .837-.088l-.212-2.03a.42.42 0 0 0-.377-.375z",paintOrder:"markers stroke fill"}),t.jsx("path",{d:"m469.096 100.607-65.51 38.061-41.42 65.207 60.595-44.882z",filter:"url(#f)",opacity:.409,paintOrder:"markers stroke fill",transform:"translate(-112.095 -20.822) scale(.35154)"}),t.jsx("path",{fill:"#ff5150",d:"m36.383 34.838-6.6-6.913 23.416-15.752z",paintOrder:"markers stroke fill"}),t.jsx("path",{fill:"#f1f1f1",d:"m36.383 34.838-6.6-6.913L12.966 50.59z",paintOrder:"markers stroke fill"}),t.jsx("path",{d:"m12.967 50.59 23.416-15.752L53.2 12.173z",opacity:.243})]}),O6=e=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",...e,children:[t.jsxs("defs",{children:[t.jsxs("radialGradient",{id:"b",cx:161.8,cy:68.9,r:95.4,gradientTransform:"matrix(1 0 0 -.95 0 248.8)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:.7,stopOpacity:0}),t.jsx("stop",{offset:.9,stopOpacity:.5}),t.jsx("stop",{offset:1})]}),t.jsxs("radialGradient",{id:"d",cx:-340.3,cy:63,r:143.2,gradientTransform:"matrix(.15 -.99 -.8 -.12 176.6 -125.4)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:.8,stopOpacity:0}),t.jsx("stop",{offset:.9,stopOpacity:.5}),t.jsx("stop",{offset:1})]}),t.jsxs("radialGradient",{id:"e",cx:113.4,cy:570.2,r:202.4,gradientTransform:"matrix(-.04 1 2.13 .08 -1179.5 -106.7)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#35c1f1"}),t.jsx("stop",{offset:.1,stopColor:"#34c1ed"}),t.jsx("stop",{offset:.2,stopColor:"#2fc2df"}),t.jsx("stop",{offset:.3,stopColor:"#2bc3d2"}),t.jsx("stop",{offset:.7,stopColor:"#36c752"})]}),t.jsxs("radialGradient",{id:"f",cx:376.5,cy:568,r:97.3,gradientTransform:"matrix(.28 .96 .78 -.23 -303.8 -148.5)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#66eb6e"}),t.jsx("stop",{offset:1,stopColor:"#66eb6e",stopOpacity:0})]}),t.jsxs("linearGradient",{id:"a",x1:63.3,x2:241.7,y1:84,y2:84,gradientTransform:"matrix(1 0 0 -1 0 266)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#0c59a4"}),t.jsx("stop",{offset:1,stopColor:"#114a8b"})]}),t.jsxs("linearGradient",{id:"c",x1:157.3,x2:46,y1:161.4,y2:40.1,gradientTransform:"matrix(1 0 0 -1 0 266)",gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{offset:0,stopColor:"#1b9de2"}),t.jsx("stop",{offset:.2,stopColor:"#1595df"}),t.jsx("stop",{offset:.7,stopColor:"#0680d7"}),t.jsx("stop",{offset:1,stopColor:"#0078d4"})]})]}),t.jsx("path",{d:"M235.7 195.5a93.7 93.7 0 0 1-10.6 4.7 101.9 101.9 0 0 1-35.9 6.4c-47.3 0-88.5-32.5-88.5-74.3a31.5 31.5 0 0 1 16.4-27.3c-42.8 1.8-53.8 46.4-53.8 72.5 0 74 68.1 81.4 82.8 81.4 7.9 0 19.8-2.3 27-4.6l1.3-.4a128.3 128.3 0 0 0 66.6-52.8 4 4 0 0 0-5.3-5.6Z",style:{fill:"url(#a)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M235.7 195.5a93.7 93.7 0 0 1-10.6 4.7 101.9 101.9 0 0 1-35.9 6.4c-47.3 0-88.5-32.5-88.5-74.3a31.5 31.5 0 0 1 16.4-27.3c-42.8 1.8-53.8 46.4-53.8 72.5 0 74 68.1 81.4 82.8 81.4 7.9 0 19.8-2.3 27-4.6l1.3-.4a128.3 128.3 0 0 0 66.6-52.8 4 4 0 0 0-5.3-5.6Z",style:{isolation:"isolate",opacity:.35,fill:"url(#b)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M110.3 246.3A79.2 79.2 0 0 1 87.6 225a80.7 80.7 0 0 1 29.5-120c3.2-1.5 8.5-4.1 15.6-4a32.4 32.4 0 0 1 25.7 13 31.9 31.9 0 0 1 6.3 18.7c0-.2 24.5-79.6-80-79.6-43.9 0-80 41.6-80 78.2a130.2 130.2 0 0 0 12.1 56 128 128 0 0 0 156.4 67 75.5 75.5 0 0 1-62.8-8Z",style:{fill:"url(#c)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M110.3 246.3A79.2 79.2 0 0 1 87.6 225a80.7 80.7 0 0 1 29.5-120c3.2-1.5 8.5-4.1 15.6-4a32.4 32.4 0 0 1 25.7 13 31.9 31.9 0 0 1 6.3 18.7c0-.2 24.5-79.6-80-79.6-43.9 0-80 41.6-80 78.2a130.2 130.2 0 0 0 12.1 56 128 128 0 0 0 156.4 67 75.5 75.5 0 0 1-62.8-8Z",style:{opacity:.41,fill:"url(#d)",isolation:"isolate"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M157 153.8c-.9 1-3.4 2.5-3.4 5.6 0 2.6 1.7 5.2 4.8 7.3 14.3 10 41.4 8.6 41.5 8.6a59.6 59.6 0 0 0 30.3-8.3 61.4 61.4 0 0 0 30.4-52.9c.3-22.4-8-37.3-11.3-43.9C228 28.8 182.3 5 132.6 5a128 128 0 0 0-128 126.2c.5-36.5 36.8-66 80-66 3.5 0 23.5.3 42 10a72.6 72.6 0 0 1 30.9 29.3c6.1 10.6 7.2 24.1 7.2 29.5s-2.7 13.3-7.8 19.9Z",style:{fill:"url(#e)"},transform:"translate(-4.6 -5)"}),t.jsx("path",{d:"M157 153.8c-.9 1-3.4 2.5-3.4 5.6 0 2.6 1.7 5.2 4.8 7.3 14.3 10 41.4 8.6 41.5 8.6a59.6 59.6 0 0 0 30.3-8.3 61.4 61.4 0 0 0 30.4-52.9c.3-22.4-8-37.3-11.3-43.9C228 28.8 182.3 5 132.6 5a128 128 0 0 0-128 126.2c.5-36.5 36.8-66 80-66 3.5 0 23.5.3 42 10a72.6 72.6 0 0 1 30.9 29.3c6.1 10.6 7.2 24.1 7.2 29.5s-2.7 13.3-7.8 19.9Z",style:{fill:"url(#f)"},transform:"translate(-4.6 -5)"})]}),Z6=e=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,role:"img","aria-label":"Opera",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"opera-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FF1B2D"}),t.jsx("stop",{offset:"50%",stopColor:"#CC0000"}),t.jsx("stop",{offset:"100%",stopColor:"#A02128"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"url(#opera-gradient)"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"6.5",ry:"8.5",fill:"none",stroke:"#fff",strokeWidth:"1.2",opacity:"0.9"}),t.jsx("ellipse",{cx:"12",cy:"12",rx:"3.5",ry:"5.5",fill:"#fff"}),t.jsx("path",{d:"M12 8.5c-1.4 0-2.5 1.6-2.5 3.5s1.1 3.5 2.5 3.5 2.5-1.6 2.5-3.5-1.1-3.5-2.5-3.5z",fill:"url(#opera-gradient)"})]}),H6=e=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,role:"img","aria-label":"Brave",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"brave-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:"#FB542B"}),t.jsx("stop",{offset:"50%",stopColor:"#FF6B35"}),t.jsx("stop",{offset:"100%",stopColor:"#FF4500"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"url(#brave-gradient)"}),t.jsx("path",{d:"M12 3.5l1.5 2h2.5l-.8 3 1.3 2.5-2.5.8v2.7l-2-.7-2 .7v-2.7l-2.5-.8L8.8 8.5 8 5.5h2.5L12 3.5z",fill:"#fff"}),t.jsx("path",{d:"M12 6.5c-.8 0-1.5.7-1.5 1.5v3c0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5V8c0-.8-.7-1.5-1.5-1.5z",fill:"url(#brave-gradient)"}),t.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"url(#brave-gradient)"})]}),F6=()=>t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"w-text-secondary",children:[t.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.6"}),t.jsx("circle",{cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.3"}),t.jsx("path",{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",fill:"currentColor",opacity:"0.5"}),t.jsx("circle",{cx:"12",cy:"12",r:"1",fill:"currentColor"}),t.jsx("text",{x:"12",y:"16.5",textAnchor:"middle",fill:"currentColor",fontSize:"6",opacity:"0.7",children:"?"})]}),T6=({browser:e})=>{const a=(e==null?void 0:e.toLowerCase())||"",s={width:20,height:20};return a.includes("chrome")?t.jsx(L6,{...s}):a.includes("firefox")?t.jsx(P6,{...s}):a.includes("safari")?t.jsx($6,{...s}):a.includes("edge")?t.jsx(O6,{...s}):a.includes("opera")?t.jsx(Z6,{...s}):a.includes("brave")?t.jsx(H6,{...s}):t.jsx(F6,{})},I6=()=>{const{signins:e,removeSignin:a,refetch:s,loading:n}=ko(),{refetch:i}=it(),{toast:l}=ta(),m=e,c=async p=>{try{await a(p),await Promise.all([s(),i()]),l("Session ended successfully","info")}catch(u){l(u.message||"Failed to end session. Please try again.","error")}},d=p=>{if(!p||p.trim()==="")return"Unknown";const u=new Date(p);if(isNaN(u.getTime()))return"Unknown";const f=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return f<1?"Just now":f<60?`${f}m ago`:f<1440?`${Math.floor(f/60)}h ago`:u.toLocaleDateString()};return n?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):t.jsx("div",{children:m&&m.length>0?t.jsx(t.Fragment,{children:t.jsx(hn,{children:t.jsxs(Zt,{children:[t.jsx(Ht,{children:t.jsxs(rt,{children:[t.jsx(Oe,{children:"Browser & Device"}),t.jsx(Oe,{children:"Location"}),t.jsx(Oe,{children:"Last Active"}),t.jsx(Oe,{})]})}),t.jsx(Ft,{children:m.map(p=>t.jsxs(rt,{children:[t.jsx(Qe,{children:t.jsxs("div",{className:"w-flex w-items-center w-gap-3",children:[t.jsx(Vr,{children:t.jsx(T6,{browser:p.browser||"Unknown"})}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{children:p.browser||"Unknown Browser"}),p.device&&t.jsx("div",{className:"w-text-muted",children:p.device})]})]})}),t.jsx(Qe,{children:t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{children:p.city&&p.country?`${p.city}, ${p.country}`:"Unknown location"}),p.ip_address&&t.jsx("div",{className:"w-text-muted",children:p.ip_address})]})}),t.jsx(Qe,{children:d(p.last_active_at)}),t.jsx(Tt,{children:t.jsxs(se,{$size:"sm",$outline:!0,$destructive:!0,onClick:()=>c(p.id),children:[t.jsx(Aa,{size:12}),"Sign out"]})})]},p.id))})]})})}):t.jsx(Nt,{title:"No active sessions",description:"You don't have any active sessions at the moment."})})},V6=(e,a)=>`${(e==null?void 0:e[0])||""}${(a==null?void 0:a[0])||""}`.toUpperCase()||"U",M0=()=>{var N,_,C,y,E,M,F,A;const{loading:e,user:a,updateProfilePicture:s}=xa(),{deployment:n}=ke(),[i,l]=o.useState("profile"),[m,c]=o.useState(null),[d,p]=o.useState("info"),[u,h]=o.useState(!1),f=o.useRef(null),g=o.useCallback((T,P="info")=>{c(T),p(P),setTimeout(()=>c(null),3e3)},[c]),x=async T=>{var S;const P=(S=T.target.files)==null?void 0:S[0];if(P){if(P.size>2*1024*1024){g("File size cannot exceed 2MB","error");return}if(!P.type.startsWith("image/")){g("Please select a valid image file","error");return}try{h(!0),await s(P),await(a==null?void 0:a.refetch()),g("Profile picture updated","info")}catch($){g(($==null?void 0:$.message)||"Failed to update profile picture","error")}finally{h(!1),f.current&&(f.current.value="")}}};if(e)return t.jsx(Re,{children:t.jsx(mr,{className:"w-flex w-items-center w-justify-center",children:t.jsx(je,{})})});const w=n==null?void 0:n.auth_settings,b=(N=w==null?void 0:w.email_address)==null?void 0:N.enabled,j=(_=w==null?void 0:w.phone_number)==null?void 0:_.enabled,v=((C=n==null?void 0:n.social_connections)==null?void 0:C.some(T=>T.enabled))||!1,k=((y=w==null?void 0:w.password)==null?void 0:y.enabled)||((E=w==null?void 0:w.auth_factors_enabled)==null?void 0:E.authenticator)||((M=w==null?void 0:w.auth_factors_enabled)==null?void 0:M.phone_otp)||((F=w==null?void 0:w.auth_factors_enabled)==null?void 0:F.backup_code);return t.jsx(Re,{children:t.jsx(i0,{children:t.jsx(r0.Provider,{value:{screen:null,setScreen:()=>{},toast:g},children:t.jsxs(mr,{className:"w-relative",children:[a&&t.jsxs(f0,{className:"mac-page-header",children:[t.jsxs("button",{type:"button",className:"w-avatar-edit","data-busy":u?"":void 0,onClick:()=>{var T;return(T=f.current)==null?void 0:T.click()},disabled:u,title:"Change profile picture","aria-label":"Change profile picture",children:[t.jsx("span",{className:"w-avatar w-avatar--lg",children:a.profile_picture_url?t.jsx("img",{src:a.profile_picture_url,alt:""}):V6(a.first_name,a.last_name)}),t.jsx("span",{className:"w-avatar-veil",children:u?t.jsx(je,{size:14}):t.jsx(sn,{size:16})})]}),t.jsx("input",{ref:f,type:"file",accept:"image/*",style:{display:"none"},onChange:x}),t.jsxs(w0,{children:[t.jsx(g0,{children:`${a.first_name||""} ${a.last_name||""}`.trim()||a.username||"Account"}),((A=a.primary_email_address)==null?void 0:A.email)&&t.jsx(x0,{children:a.primary_email_address.email})]})]}),t.jsx(o0,{children:t.jsxs(l0,{children:[t.jsx(ka,{$isActive:i==="profile",onClick:()=>l("profile"),children:t.jsxs(Ca,{children:[t.jsx(hs,{size:16}),"Profile"]})}),b&&t.jsx(ka,{$isActive:i==="email",onClick:()=>l("email"),children:t.jsxs(Ca,{children:[t.jsx(dl,{size:16}),"Email"]})}),j&&t.jsx(ka,{$isActive:i==="phone",onClick:()=>l("phone"),children:t.jsxs(Ca,{children:[t.jsx(Pu,{size:16}),"Phone"]})}),v&&t.jsx(ka,{$isActive:i==="social",onClick:()=>l("social"),children:t.jsxs(Ca,{children:[t.jsx(Lu,{size:16}),"Connections"]})}),k&&t.jsx(ka,{$isActive:i==="security",onClick:()=>l("security"),children:t.jsxs(Ca,{children:[t.jsx(Xt,{size:16}),"Security"]})}),t.jsx(ka,{$isActive:i==="sessions",onClick:()=>l("sessions"),children:t.jsxs(Ca,{children:[t.jsx($u,{size:16}),"Sessions"]})})]})}),t.jsxs(c0,{children:[i==="profile"&&t.jsx(u6,{}),i==="email"&&b&&t.jsx(m6,{}),i==="phone"&&j&&t.jsx(p6,{}),i==="social"&&v&&t.jsx(w6,{}),i==="security"&&k&&t.jsx(R6,{}),i==="sessions"&&t.jsx(I6,{})]}),m&&t.jsxs("div",{className:`w-toast w-toast--contained ${d==="error"?"w-toast--error":"w-toast--success"}`,style:{minWidth:0},children:[t.jsx("span",{className:"w-toast-ic",children:d==="error"?t.jsx(Fa,{size:12}):t.jsx(qe,{size:12})}),t.jsx("span",{className:"w-toast-msg",children:m})]})]})})})})},R0=({isOpen:e,onClose:a,title:s,showHeader:n,headerContent:i,footerContent:l,customContent:m,children:c,showCloseButton:d})=>t.jsx(ze,{isOpen:e,onClose:a,children:t.jsx(ze.Overlay,{children:t.jsxs(ze.Content,{className:"w-dialog--panel",children:[n&&t.jsx(ze.Header,{showCloseButton:d,children:i||s}),m||c||t.jsx(M0,{}),l&&t.jsx(ze.Footer,{children:l})]})})}),Le=(...e)=>e.filter(Boolean).join(" "),z6=e=>t.jsx("div",{...e,className:Le("w-relative",e.className)}),L0=o.forwardRef((e,a)=>t.jsx("button",{...e,ref:a,className:Le("w-acct",e.className),style:{width:"auto",margin:0,padding:4,gap:8,...e.style}}));L0.displayName="AccountButton";const D6=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","w-avatar--md",a.className),style:{width:28,height:28,fontSize:11,...a.style},children:e}),U6=e=>t.jsx("div",{...e,className:Le("w-sec","w-text-secondary",e.className)}),P0=o.forwardRef(({$position:e,$isOpen:a,$maxHeight:s,children:n,...i},l)=>t.jsx("div",{...i,ref:l,className:"w-menu",style:{position:"fixed",width:300,maxWidth:"calc(100vw - 24px)",maxHeight:s?`${s}px`:"calc(100vh - 48px)",overflowY:"auto",zIndex:99999,top:(e==null?void 0:e.top)!==void 0?`${e.top}px`:void 0,bottom:(e==null?void 0:e.bottom)!==void 0?`${e.bottom}px`:void 0,left:(e==null?void 0:e.left)!==void 0?`${e.left}px`:void 0,right:(e==null?void 0:e.right)!==void 0?`${e.right}px`:void 0,visibility:e&&a?"visible":"hidden",opacity:a&&e?1:0,transition:`opacity 0.15s ease, visibility 0s linear ${a?"0s":"0.15s"}`,padding:0},children:n}));P0.displayName="DropdownContainer";const $0=o.forwardRef(({$top:e,$left:a,$isOpen:s,$maxHeight:n,children:i,...l},m)=>t.jsx("div",{...l,ref:m,className:"w-menu",style:{position:"fixed",width:300,maxWidth:"calc(100vw - 24px)",maxHeight:`${n}px`,overflowY:"auto",zIndex:99999,display:"flex",flexDirection:"column",top:`${e}px`,left:`${a}px`,visibility:s?"visible":"hidden",opacity:s?1:0,transition:`opacity 0.15s ease, visibility 0s linear ${s?"0s":"0.15s"}`,padding:0},children:i}));$0.displayName="SidePanel";const qi=e=>t.jsx("hr",{...e,className:Le("w-hr",e.className)}),W6=e=>t.jsx("div",{...e,style:{padding:"16px 14px 8px",...e.style}}),B6=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-gap-3",e.className)}),G6=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","w-avatar--lg",a.className),children:e}),q6=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-grow",e.className),style:{gap:2,...e.style}}),K6=e=>t.jsx("div",{...e,className:Le("w-sec","w-truncate",e.className)}),Y6=e=>t.jsx("div",{...e,className:Le("w-secsub","w-truncate",e.className)}),Q6=({$active:e,...a})=>t.jsx("button",{...a,className:"w-menu-item",style:{border:"0.5px solid var(--wa-border)",background:e?"var(--wa-surface-subtle)":void 0,...a.style}}),J6=({children:e,...a})=>t.jsx("div",{...a,className:"w-avatar w-avatar--sm",children:e}),X6=e=>t.jsx("div",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),ep=e=>t.jsx("div",{...e,className:Le("w-secsub","w-none",e.className)}),tp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),ap=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className)}),sp=e=>t.jsx("span",{...e,className:Le("w-grow",e.className)}),np=e=>t.jsx("span",{...e,className:Le("w-menu-trail",e.className)}),rp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),ip=e=>t.jsx("div",{...e,className:Le("w-menu-label",e.className)}),Hn=({$active:e,...a})=>t.jsx("button",{...a,className:"w-menu-item",style:{cursor:e?"default":"pointer",...a.style}}),Fn=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-flex","w-items-center","w-justify-center","w-none",a.className),style:{width:14,height:14,color:"var(--wa-primary)",...a.style},children:e}),op=e=>t.jsx("div",{...e,className:"w-none",style:{width:14,...e.style}}),Tn=e=>t.jsx("div",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),Ki=e=>t.jsx("div",{...e,className:Le("w-secsub","w-none",e.className)}),lp=e=>t.jsx("div",{...e,style:{padding:"5px",...e.style}}),cp=e=>t.jsx("button",{...e,className:Le("w-menu-item","w-menu-item--danger",e.className)}),dp=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className),style:{borderBottom:"0.5px solid var(--wa-border)",borderRadius:0,flex:"none",...e.style}}),up=e=>t.jsx("div",{...e,style:{flex:"1 1 auto",overflowY:"auto",padding:5,...e.style}}),Yi=({$active:e,...a})=>t.jsx("button",{...a,className:Le("w-menu-item","sp-row",e&&"sp-row--active",a.className),style:{height:30,...a.style}}),Qi=({$active:e,...a})=>t.jsx("button",{...a,className:Le("w-menu-item","sp-row","sp-ws-row",e&&"sp-row--active",a.className),style:{height:30,paddingLeft:30,position:"relative",...a.style},children:a.children}),Ji=({$personal:e,children:a,...s})=>t.jsx("div",{...s,className:Le("w-avatar","w-avatar--sm",!e&&"",s.className),children:a}),Xi=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","","w-avatar--sm",a.className),children:e}),eo=e=>t.jsx("span",{...e,className:Le("w-sec","w-grow","w-truncate",e.className)}),to=e=>t.jsx("span",{...e,className:Le("w-secsub","w-grow","w-truncate",e.className)}),In=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-none",e.className),style:{gap:4,...e.style}}),mp=({$open:e,...a})=>t.jsx(Ut,{...a,className:"w-text-muted",style:{flexShrink:0,transition:"transform 0.2s ease",transform:e?"rotate(0deg)":"rotate(-90deg)"}}),Vn=e=>t.jsx(qe,{...e,className:"w-text-primary",style:{flexShrink:0}}),pp=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-gap-3","w-none",e.className),style:{padding:"12px 12px 16px",borderBottom:"0.5px solid var(--wa-border)",...e.style}}),hp=e=>t.jsx("button",{...e,className:Le("w-btn","w-btn--icon",e.className),style:{width:24,height:24,...e.style}}),ao=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-gap-3",e.className),style:{padding:"4px 4px 0",minWidth:0,...e.style}}),so=({children:e,...a})=>t.jsx("div",{...a,className:Le("w-avatar","","w-avatar--md",a.className),children:e}),no=e=>t.jsx("div",{...e,className:Le("w-flex-col","w-grow",e.className),style:{gap:1,minWidth:0,...e.style}}),ro=e=>t.jsx("div",{...e,className:Le("w-sec","w-truncate",e.className)}),io=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-none",e.className),style:{gap:2,...e.style}}),Fs=({$destructive:e,...a})=>t.jsx("button",{...a,className:Le("w-btn","w-btn--icon",e&&"w-btn--danger",a.className),style:{width:24,height:24,...a.style}}),oo=e=>t.jsx("div",{...e,className:"w-none",style:{borderTop:"0.5px solid var(--wa-border)",padding:5,...e.style}}),lo=e=>t.jsx("button",{...e,className:Le("w-menu-item",e.className),style:{height:30,color:"var(--wa-text-muted)",...e.style}}),co=e=>t.jsx("div",{...e,className:Le("w-flex","w-items-center","w-justify-center","w-none",e.className),style:{width:20,height:20,...e.style}}),Dr=({showName:e=!0,onCreateOrg:a,showOrgSwitcher:s=!0,narrowBreakpoint:n=640})=>{var He,Ge,ct,Rt,Wt,ba,ya,yt,aa,sa,na,ra;const i=ts(),[l,m]=o.useState(!1),[c,d]=o.useState(!1),[p,u]=o.useState(typeof window<"u"&&window.innerWidth<n),[h,f]=o.useState(!1),[g,x]=o.useState("org"),[w,b]=o.useState(null),[j,v]=o.useState({top:0,left:0,maxHeight:400}),[k,N]=o.useState(new Set),[_,C]=o.useState(null),y=o.useRef(null),E=o.useRef(null),M=o.useRef(null),F=bt({triggerRef:y,isOpen:l,minWidth:300}),A=Kt(!1),T=Kt(!1),P=Kt(!1),S=Kt(!1),$=Kt(!1),{session:H,signOut:R,switchSignIn:O,switchOrganization:Z,switchWorkspace:L,refetch:U}=it(),{navigateToSignIn:D}=kt(),{deployment:Y}=ke(),{activeOrganization:B,activeMembership:Q,leave:ue}=fa(),{organizationMemberships:we}=wa(),{workspaces:ne}=ga(),{activeWorkspace:ae,activeMembership:re,leave:Me}=Dt(),q=(He=H==null?void 0:H.active_signin)==null?void 0:He.user,tt=((ct=(Ge=Y==null?void 0:Y.auth_settings)==null?void 0:Ge.multi_session_support)==null?void 0:ct.enabled)??!1,Ie=((Rt=Y==null?void 0:Y.b2b_settings)==null?void 0:Rt.allow_users_to_create_orgs)??!1,De=((Wt=Y==null?void 0:Y.b2b_settings)==null?void 0:Wt.organizations_enabled)??!1,Ee=De&&(((ba=Y==null?void 0:Y.b2b_settings)==null?void 0:ba.workspaces_enabled)??!1),ce=s&&De,W=!B,G=o.useMemo(()=>{var xe;const oe={};for(const Ne of ne||[]){const J=(xe=Ne.organization)==null?void 0:xe.id;J&&(oe[J]||(oe[J]=[]),oe[J].push(Ne))}return oe},[ne]),K=we||[],V=o.useCallback(()=>{if(!E.current)return;const oe=E.current.getBoundingClientRect(),xe=300,Ne=8,J=window.innerWidth<n;if(u(J),J){v({top:oe.top,left:oe.left,maxHeight:oe.height});return}const ve=Math.min(Math.max(oe.height,520),window.innerHeight-oe.top-16),Ye=oe.right+Ne+xe<=window.innerWidth-8;v({top:oe.top,left:Ye?oe.right+Ne:oe.left-Ne-xe,maxHeight:ve})},[n]),de=o.useCallback(()=>{V(),d(!0)},[V]),z=o.useCallback(oe=>{N(xe=>{const Ne=new Set(xe);return Ne.has(oe)?Ne.delete(oe):Ne.add(oe),Ne})},[]);o.useEffect(()=>{B&&Ee&&N(oe=>{if(oe.has(B.id))return oe;const xe=new Set(oe);return xe.add(B.id),xe})},[B,Ee]),o.useEffect(()=>{x(Ee&&ae?"ws":"org")},[Ee,ae==null?void 0:ae.id]),o.useEffect(()=>{const oe=()=>{u(window.innerWidth<n),c&&V()};return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[n,c,V]),o.useEffect(()=>{l||(d(!1),f(!1))},[l]),o.useEffect(()=>{if(!l)return;const oe=setTimeout(()=>{const xe=Ne=>{var ve,Ye,Ve;const J=Ne.target;(ve=y.current)!=null&&ve.contains(J)||(Ye=E.current)!=null&&Ye.contains(J)||(Ve=M.current)!=null&&Ve.contains(J)||m(!1)};return document.addEventListener("mousedown",xe),()=>document.removeEventListener("mousedown",xe)},50);return()=>clearTimeout(oe)},[l]);const le=oe=>oe.split(" ").filter(Boolean).map(xe=>xe[0]).join("").toUpperCase().slice(0,2),Je=(oe,xe,Ne,J,ve)=>t.jsx(ve,{children:oe?t.jsx("img",{src:xe,alt:Ne}):le(`${Ne||""} ${J||""}`)}),ot=async oe=>{try{await R(oe),await U(),m(!1)}catch{}},ge=async oe=>{try{await O(oe),await U(),m(!1)}catch{}},lt=async oe=>{if(!h){f(!0);try{await Z(oe),await U(),d(!1)}catch{}finally{f(!1)}}},Ke=async oe=>{if(!h){f(!0);try{await L(oe),await U(),d(!1)}catch{}finally{f(!1)}}},ee=()=>{A.open(),m(!1)},ie=[...(H==null?void 0:H.signins)||[]].sort((oe,xe)=>{const Ne=oe.user.id===(q==null?void 0:q.id),J=xe.user.id===(q==null?void 0:q.id);return Ne===J?0:Ne?-1:1}),me=((ya=ie.find(oe=>oe.user.id===(q==null?void 0:q.id)))==null?void 0:ya.id)||"",Ze=((aa=(yt=Q==null?void 0:Q.roles)==null?void 0:yt[0])==null?void 0:aa.name)??null;return t.jsx(Re,{children:t.jsxs(z6,{children:[t.jsxs(L0,{ref:y,onClick:()=>m(!l),children:[Je(q==null?void 0:q.has_profile_picture,q==null?void 0:q.profile_picture_url,q==null?void 0:q.first_name,q==null?void 0:q.last_name,D6),e&&t.jsx(U6,{children:`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`.trim()})]}),typeof window<"u"&&en.createPortal(t.jsxs("div",{className:"wacht-root",style:i,children:[t.jsxs(P0,{ref:E,$position:F,$isOpen:l&&!(p&&c),$maxHeight:F==null?void 0:F.maxHeight,children:[t.jsx(W6,{children:t.jsxs(B6,{children:[Je(q==null?void 0:q.has_profile_picture,q==null?void 0:q.profile_picture_url,q==null?void 0:q.first_name,q==null?void 0:q.last_name,G6),t.jsxs(q6,{children:[t.jsx(K6,{children:`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`.trim()}),t.jsx(Y6,{children:(sa=q==null?void 0:q.primary_email_address)==null?void 0:sa.email})]})]})}),t.jsxs(tp,{children:[ce&&t.jsxs(Q6,{$active:c,onClick:de,style:{marginBottom:8},children:[t.jsx(J6,{children:B?B.image_url?t.jsx("img",{src:B.image_url,alt:B.name}):(na=B.name)==null?void 0:na.charAt(0).toUpperCase():q!=null&&q.has_profile_picture?t.jsx("img",{src:q.profile_picture_url,alt:q.first_name}):le(`${(q==null?void 0:q.first_name)||""} ${(q==null?void 0:q.last_name)||""}`)}),t.jsx(X6,{children:(B==null?void 0:B.name)??"Personal account"}),Ze&&t.jsx(ep,{children:Ze})]}),t.jsxs(ap,{onClick:ee,children:[t.jsx(Ea,{}),t.jsx(sp,{children:"Manage account"}),t.jsx(np,{children:"⌘,"})]})]}),t.jsx(qi,{}),t.jsxs(rp,{children:[t.jsx(ip,{children:"Accounts"}),tt?ie.map(({user:oe,id:xe})=>{var J;const Ne=oe.id===(q==null?void 0:q.id);return t.jsxs(Hn,{$active:Ne,onClick:Ne?void 0:()=>ge(xe),children:[Ne?t.jsx(Fn,{children:t.jsx(qe,{})}):t.jsx(op,{}),t.jsx(Tn,{children:(J=oe.primary_email_address)==null?void 0:J.email}),Ne&&t.jsx(Ki,{children:"Current"})]},oe.id)}):q&&t.jsxs(Hn,{$active:!0,children:[t.jsx(Fn,{children:t.jsx(qe,{})}),t.jsx(Tn,{children:(ra=q.primary_email_address)==null?void 0:ra.email}),t.jsx(Ki,{children:"Current"})]}),tt&&t.jsxs(Hn,{onClick:()=>{D(),m(!1)},children:[t.jsx(Fn,{style:{color:"var(--wa-text-muted)"},children:t.jsx(St,{})}),t.jsx(Tn,{style:{color:"var(--wa-text-muted)"},children:"Add account"})]})]}),t.jsx(qi,{}),t.jsx(lp,{children:t.jsxs(cp,{onClick:()=>ot(me),children:[t.jsx(Aa,{}),"Sign out"]})})]}),t.jsxs($0,{ref:M,$top:j.top,$left:j.left,$isOpen:l&&c,$maxHeight:j.maxHeight,children:[p&&t.jsxs(dp,{onClick:()=>d(!1),children:[t.jsx(nn,{size:13}),"Back"]}),(()=>{var _t;if(W)return null;const oe=Ee&&!!ae,xe=!!((_t=Q==null?void 0:Q.eligibility_restriction)!=null&&_t.type)&&Q.eligibility_restriction.type!=="none",Ne=!!B&&!xe&&Hr(Q),J=oe&&!xe&&Tr(re),ve=oe?g:"org",Ye=async()=>{if(ue){b("org");try{await ue(),await U(),d(!1)}catch{}finally{b(null)}}},Ve=async()=>{if(Me){b("ws");try{await Me(),d(!1)}catch{}finally{b(null)}}},jt=()=>{if(!oe)return null;const Be=ve==="org"?"ws":"org",wt=Be==="ws"?"Switch to workspace context":"Switch to organization context";return t.jsx(hp,{type:"button",onClick:()=>x(Be),title:wt,"aria-label":wt,children:t.jsx(bu,{size:12})})};return t.jsxs(pp,{children:[ve==="org"&&B&&t.jsxs(ao,{children:[jt(),t.jsx(so,{children:B.image_url?t.jsx("img",{src:B.image_url,alt:B.name}):le(B.name)}),t.jsx(no,{children:t.jsx(ro,{children:B.name})}),t.jsxs(io,{children:[Ne&&t.jsx(Fs,{onClick:()=>{P.open(),m(!1)},title:"Organization settings","aria-label":"Organization settings",children:t.jsx(Ea,{size:14})}),t.jsx(Fs,{$destructive:!0,onClick:Ye,disabled:w==="org",title:"Leave organization","aria-label":"Leave organization",children:t.jsx(Aa,{size:14})})]})]}),ve==="ws"&&oe&&t.jsxs(ao,{children:[jt(),t.jsx(so,{children:ae.image_url?t.jsx("img",{src:ae.image_url,alt:ae.name}):le(ae.name)}),t.jsx(no,{children:t.jsx(ro,{children:ae.name})}),t.jsxs(io,{children:[J&&t.jsx(Fs,{onClick:()=>{$.open(),m(!1)},title:"Workspace settings","aria-label":"Workspace settings",children:t.jsx(Ea,{size:14})}),t.jsx(Fs,{$destructive:!0,onClick:Ve,disabled:w==="ws",title:"Leave workspace","aria-label":"Leave workspace",children:t.jsx(Aa,{size:14})})]})]})]})})(),t.jsxs(up,{children:[t.jsxs(Yi,{$active:W,onClick:()=>{W||lt(void 0)},disabled:h,style:W?{cursor:"default"}:void 0,children:[t.jsx(Ji,{$personal:!0,children:q!=null&&q.has_profile_picture?t.jsx("img",{src:q.profile_picture_url,alt:q.first_name}):t.jsx(hs,{size:12})}),t.jsx(eo,{children:"Personal account"}),W&&t.jsx(In,{children:t.jsx("span",{className:"sp-check",style:{display:"inline-flex"},children:t.jsx(Vn,{size:13})})})]}),K.map(oe=>{var Ve,jt;const xe=oe.organization,Ne=xe.id===(B==null?void 0:B.id),J=k.has(xe.id),ve=Ee?G[xe.id]||[]:[],Ye=!!((Ve=oe.eligibility_restriction)!=null&&Ve.type)&&oe.eligibility_restriction.type!=="none";return t.jsxs(o.Fragment,{children:[t.jsxs(Yi,{$active:Ne,onClick:()=>{Ye||(Ee?z(xe.id):Ne||lt(xe.id))},disabled:h,style:Ye?{opacity:.55,cursor:"not-allowed"}:Ne&&!Ee?{cursor:"default"}:void 0,title:(jt=oe.eligibility_restriction)==null?void 0:jt.message,children:[t.jsx(Ji,{children:xe.image_url?t.jsx("img",{src:xe.image_url,alt:xe.name}):le(xe.name)}),t.jsx(eo,{children:xe.name}),t.jsxs(In,{children:[Ye&&t.jsx(Ma,{size:12,color:"var(--wa-error)"}),Ne&&!Ee&&t.jsx(Vn,{size:13}),Ee&&t.jsx(mp,{size:11,$open:J})]})]}),Ee&&J&&t.jsxs(t.Fragment,{children:[ve.map(_t=>{var ia,oa;const Be=Ne&&(ae==null?void 0:ae.id)===_t.id,wt=_t,Bt=((ia=wt.eligibility_restriction)==null?void 0:ia.type)&&wt.eligibility_restriction.type!=="none";return t.jsxs(Qi,{$active:Be,onClick:()=>{!Be&&!Bt&&Ke(_t.id)},disabled:h,style:Bt||Ye?{opacity:.55,cursor:"not-allowed"}:Be?{cursor:"default"}:void 0,title:(oa=wt.eligibility_restriction)==null?void 0:oa.message,children:[t.jsx(Xi,{children:wt.image_url?t.jsx("img",{src:wt.image_url,alt:wt.name}):le(wt.name).charAt(0)}),t.jsx(to,{children:wt.name}),t.jsxs(In,{children:[Bt&&t.jsx(Ma,{size:12,color:"var(--wa-error)"}),Be&&t.jsx(Vn,{size:12})]})]},_t.id)}),!Ye&&t.jsxs(Qi,{onClick:()=>{C(xe.id),S.open()},disabled:h,children:[t.jsx(Xi,{style:{background:"transparent",border:"1px dashed var(--wa-border-strong)"},children:t.jsx(St,{size:10})}),t.jsx(to,{children:"New workspace"})]})]})]},xe.id)})]}),(()=>{var Ye,Ve,jt;const oe=((we==null?void 0:we.length)??0)>0,xe=()=>Ie&&t.jsx(oo,{children:t.jsxs(lo,{onClick:()=>{a?(a(),m(!1)):T.open()},disabled:h,children:[t.jsx(co,{children:t.jsx(St,{size:12})}),"New organization"]})});if(!Ee||!oe)return xe();const Ne=!!((Ye=Q==null?void 0:Q.eligibility_restriction)!=null&&Ye.type)&&Q.eligibility_restriction.type!=="none",J=((jt=(Ve=we==null?void 0:we[0])==null?void 0:Ve.organization)==null?void 0:jt.id)??null,ve=B&&!Ne?B.id:J;return t.jsx(oo,{children:t.jsxs(lo,{onClick:()=>{C(ve),S.open()},disabled:h,children:[t.jsx(co,{children:t.jsx(St,{size:12})}),"New workspace"]})})})()]})]}),document.body),t.jsx(R0,{isOpen:A.isOpen,onClose:A.close}),ce&&t.jsxs(t.Fragment,{children:[t.jsx(Bc,{isOpen:T.isOpen,onClose:T.close}),t.jsx(Qc,{isOpen:P.isOpen,onClose:P.close}),Ee&&t.jsxs(t.Fragment,{children:[t.jsx(Pr,{isOpen:S.isOpen,onClose:()=>{S.close(),C(null)},organizationId:_||void 0}),t.jsx(Or,{isOpen:$.isOpen,onClose:$.close})]})]})]})})};function O0({notification:e,onAction:a}){const[s,n]=o.useState(!1),i=c=>{c.target.closest("button")||(n(!s),e.is_read||a({type:"read",id:e.id}))},l=c=>{a({type:"custom",payload:c.payload})},m=c=>{const d=new Date(c),u=new Date().getTime()-d.getTime();if(u<6e4)return"Just now";const h=Math.floor(u/6e4);if(h<60)return`${h}m`;const f=Math.floor(h/60);if(f<24)return`${f}h`;const g=Math.floor(f/24);return g<7?`${g}d`:d.toLocaleDateString(void 0,{month:"short",day:"numeric"})};return t.jsxs("div",{className:"w-flex w-gap-3 w-row--hover w-notif-row",onClick:i,"data-unread":e.is_read?void 0:"",children:[t.jsxs("div",{className:"w-grow w-flex-col w-justify-center",children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-2",style:{marginBottom:2},children:[!e.is_read&&t.jsx("span",{className:"w-notif-dot"}),t.jsx("h4",{className:"w-sec w-truncate",style:{margin:0},children:e.title})]}),t.jsx("p",{className:`w-secsub${s?"":" w-truncate"}`,style:{margin:0,wordWrap:s?"break-word":void 0},children:e.body}),e.ctas&&e.ctas.length>0&&t.jsx("div",{className:"w-flex w-wrap w-gap-2",style:{marginTop:10},children:e.ctas.map((c,d)=>t.jsx("button",{className:"w-btn w-btn--secondary w-btn--sm",onClick:()=>l(c),children:c.label},d))})]}),t.jsxs("div",{className:"w-flex-col w-items-end w-gap-2 w-none",children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-1",children:[e.is_read&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"unread",id:e.id})},title:"Mark as unread",children:t.jsx(ku,{size:14})}),t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"star",id:e.id})},title:e.is_starred?"Unstar":"Star","data-on":e.is_starred?"":void 0,children:t.jsx(Ou,{size:14,fill:e.is_starred?"currentColor":"none"})}),t.jsx("button",{className:"w-btn w-btn--icon",onClick:c=>{c.stopPropagation(),a({type:"archive",id:e.id})},title:e.is_archived?"Unarchive":"Archive",children:e.is_archived?t.jsx(Vo,{size:14}):t.jsx(To,{size:14})})]}),t.jsx("span",{className:"w-secsub",style:{whiteSpace:"nowrap"},children:m(e.created_at)})]})]})}const Z0=o.forwardRef(({scope:e="all",onAction:a,fullWidth:s,maxHeight:n,className:i},l)=>{const[m,c]=o.useState("inbox"),[d,p]=o.useState(!1),[u,h]=o.useState(!1),f=o.useRef(null),g={scope:e,limit:20,is_archived:m==="archive",is_starred:m==="starred",is_read:d?!1:void 0},{notifications:x,loading:w,error:b,hasMore:j,loadMore:v,markAsRead:k,markAsUnread:N,markAllAsRead:_,archiveAllRead:C,archiveNotification:y,starNotification:E}=Ro(g);o.useEffect(()=>{if(!u)return;const T=P=>{f.current&&!f.current.contains(P.target)&&h(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[u]);const M=async T=>{switch(T.type){case"read":await k(T.id);break;case"unread":await N(T.id);break;case"archive":await y(T.id);break;case"star":await E(T.id);break;case"custom":a==null||a(T.payload);break}},F=()=>{_(),h(!1)},A=()=>{C(),h(!1)};return t.jsxs("div",{ref:l,className:`w-flex-col w-relative w-notif-panel${s?" w-notif-panel--fill":""}${i?` ${i}`:""}`,style:{maxHeight:n||"100%"},children:[t.jsxs("div",{className:"w-flex w-items-center w-justify-between w-gap-3 w-none w-notif-head",children:[t.jsxs("div",{className:"w-tabs w-grow",children:[t.jsx("button",{className:`w-tab${m==="inbox"?" w-tab--active":""}`,onClick:()=>c("inbox"),children:"Inbox"}),t.jsx("button",{className:`w-tab${m==="archive"?" w-tab--active":""}`,onClick:()=>c("archive"),children:"Archive"}),t.jsx("button",{className:`w-tab${m==="starred"?" w-tab--active":""}`,onClick:()=>c("starred"),children:"Starred"})]}),t.jsxs("label",{className:"w-switch w-none","data-on":d?"":void 0,onClick:()=>p(!d),children:[t.jsx("span",{className:"w-switch-track",children:t.jsx("span",{className:"w-switch-knob"})}),t.jsx("span",{className:"w-switch-label",children:"Unread Only"})]}),t.jsx("button",{className:"w-btn w-btn--icon w-none",onClick:()=>h(!u),children:t.jsx(Su,{size:16})}),u&&t.jsxs("div",{ref:f,className:"w-menu w-notif-menu",children:[m==="inbox"&&t.jsxs("button",{className:"w-menu-item",onClick:F,children:[t.jsx(_u,{})," Mark all as read"]}),t.jsxs("button",{className:"w-menu-item",onClick:A,children:[t.jsx(To,{})," Archive all read"]})]})]}),t.jsx("div",{className:"w-grow w-notif-body",children:w?t.jsx("div",{className:"w-loading",children:t.jsx(je,{})}):b?t.jsx(Nt,{icon:t.jsx(ci,{size:20,className:"w-text-error"}),title:"Failed to load notifications",description:b.message||"An unexpected error occurred."}):x.length===0?t.jsx(Nt,{icon:t.jsx(ci,{size:20}),title:"No notifications",description:"You're all caught up!"}):t.jsxs(t.Fragment,{children:[x.map(T=>t.jsx(O0,{notification:T,onAction:M},T.id)),j&&t.jsx("div",{className:"w-flex w-justify-center",style:{padding:12},children:t.jsx("button",{className:"w-btn w-btn--ghost w-btn--sm",onClick:v,children:"Load more"})})]})})]})}),H0=o.forwardRef(({position:e,scope:a,onAction:s,className:n},i)=>t.jsx("div",{ref:i,className:`w-card w-flex-col w-notif-pop${n?` ${n}`:""}`,style:{top:(e==null?void 0:e.top)!==void 0?e.top:void 0,bottom:(e==null?void 0:e.bottom)!==void 0?e.bottom:void 0,left:(e==null?void 0:e.left)!==void 0?e.left:void 0,right:(e==null?void 0:e.right)!==void 0?e.right:void 0,maxHeight:e!=null&&e.maxHeight?e.maxHeight:"90vh"},children:t.jsx(Z0,{scope:a,onAction:s,fullWidth:!0,maxHeight:e!=null&&e.maxHeight?`${e.maxHeight}px`:"100%"})}));function F0({className:e,showBadge:a=!0,scope:s="all",onAction:n}){const[i,l]=o.useState(!1),m=ts(),c=o.useRef(null),d=o.useRef(null),p=o.useRef(null),{count:u,refetch:h}=Lo({scope:s}),f=async x=>{await h(),n==null||n(x.payload)},g=bt({triggerRef:p,isOpen:i,minWidth:Math.min(450,typeof window<"u"?window.innerWidth-32:300),defaultMaxHeight:550});return o.useEffect(()=>{if(!i)return;const x=setTimeout(()=>{const w=b=>{var v,k;const j=b.target;(v=c.current)!=null&&v.contains(j)||(k=d.current)!=null&&k.contains(j)||l(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},50);return()=>{clearTimeout(x)}},[i]),t.jsx(Re,{children:t.jsxs("div",{ref:c,className:`w-inline w-relative${e?` ${e}`:""}`,children:[t.jsxs("button",{ref:p,className:"w-btn w-btn--icon w-notif-bell",onClick:()=>l(!i),"aria-label":u>0?`${u} unread notifications`:"Notifications",children:[t.jsx(yu,{strokeWidth:1}),a&&u>0&&t.jsx("span",{className:"w-notif-badge","data-dot":u<=9?"":void 0,children:u>9?"9+":""})]}),typeof window<"u"&&i&&en.createPortal(t.jsx("div",{className:"wacht-root",style:m,children:t.jsx(H0,{ref:d,position:g,scope:s,onAction:f,onClose:()=>l(!1)})}),document.body)]})})}const fp=({showName:e=!0,showNotifications:a=!0})=>t.jsxs("div",{className:"w-flex w-items-center w-gap-2",children:[a&&t.jsx(F0,{}),t.jsx(Dr,{showName:e})]}),wp=({children:e})=>{var n;const{session:a,loading:s}=it();return s||!((n=a.signins)!=null&&n.length)||!a.active_signin?null:t.jsx(t.Fragment,{children:e})},gp=({children:e})=>{var n;const{loading:a,session:s}=it();return a||(n=s.signins)!=null&&n.length&&s.active_signin?null:t.jsx(t.Fragment,{children:e})},xp=({onAccountSelect:e,showAddAccount:a=!0})=>{var _,C,y,E;const{session:s,loading:n,switchSignIn:i,signOut:l}=it(),{deployment:m}=ke(),{navigateToSignIn:c,navigate:d}=kt(),[p,u]=o.useState(null),[h,f]=o.useState(null),g=s==null?void 0:s.active_signin,x=(s==null?void 0:s.signins)||[],w=((C=(_=m==null?void 0:m.auth_settings)==null?void 0:_.multi_session_support)==null?void 0:C.enabled)??!1,b=(y=m==null?void 0:m.ui_settings)==null?void 0:y.app_name;o.useEffect(()=>{n||x.length||c()},[n,x,c]);const j=M=>M.split(" ").map(F=>F[0]).join("").toUpperCase().slice(0,2),v=async M=>{var F;f(M);try{if(await i(M),e)e(M),f(null);else{let A=gt(m,new URLSearchParams(window.location.search).get("redirect_uri"));if(A||(A=(F=m.ui_settings)==null?void 0:F.after_signin_redirect_url),A){let T;try{T=new URL(A)}catch{T=new URL(A,window.location.origin)}(m==null?void 0:m.mode)==="staging"&&T.searchParams.set("__dev_session__",xt(m.backend_host)??""),d(T.toString())}else f(null)}}catch{f(null)}},k=async(M,F)=>{M.stopPropagation(),u(F);try{await l(F)}catch{}finally{u(null)}},N=()=>{var F;let M=gt(m,new URLSearchParams(window.location.search).get("redirect_uri"));M||(M=(F=m.ui_settings)==null?void 0:F.after_signin_redirect_url),c(M)};return n?t.jsx(js,{}):x.length?t.jsx(Re,{children:t.jsxs(et,{footer:t.jsxs("span",{className:"w-sub",style:{fontSize:12.5},children:["Don't have an account?"," ",t.jsx(Et,{to:`${(E=m.ui_settings)==null?void 0:E.sign_up_page_url}${window.location.search}`,className:"w-link",children:"Sign up"})]}),children:[t.jsx(nt,{title:"Choose an account",sub:`Select an account to continue${b?` to ${b}`:""}`}),t.jsx("div",{className:"w-flex-col",children:x.map(({user:M,id:F})=>{var R,O;if(!M)return null;const A=F===(g==null?void 0:g.id),T=h===F,P=p===F,S=`${M.first_name||""} ${M.last_name||""}`.trim(),$=S||((R=M.primary_email_address)==null?void 0:R.email)||M.username||"User",H=((O=M.primary_email_address)==null?void 0:O.email)||M.username;return t.jsxs("button",{className:"w-acct","data-active":A?"":void 0,"data-busy":T?"":void 0,onClick:()=>v(F),children:[t.jsx("div",{className:"w-avatar",children:T?t.jsx(vt,{onAccent:!0}):M.has_profile_picture?t.jsx("img",{src:M.profile_picture_url,alt:S}):j($)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:$}),H&&H!==$&&t.jsx("div",{className:"w-secsub w-truncate",children:H})]}),A&&t.jsxs("span",{className:"w-pill w-pill--current",children:[t.jsx(qe,{size:11,weight:"bold"}),"current"]}),t.jsx("span",{className:"w-kebab w-acct-out",role:"button","aria-disabled":P,title:"Sign out",onClick:Z=>k(Z,F),children:P?t.jsx(vt,{}):t.jsx(Aa,{size:15})})]},F)})}),a&&w&&t.jsx("div",{className:"w-acct-foot",children:t.jsxs("button",{className:"w-acct-add",onClick:N,children:[t.jsx(St,{size:15}),"Add another account"]})})]})}):null},vp=()=>{const{navigateToSignIn:e}=kt();return o.useEffect(()=>{e()},[e]),null},bp=()=>{const{navigateToSignUp:e}=kt();return o.useEffect(()=>{e()},[e]),null},yp=()=>{var A,T;const{organizationMemberships:e,refetch:a,loading:s}=wa(),{workspaces:n}=ga(),{switchOrganization:i,switchWorkspace:l}=it(),{deployment:m}=ke(),[c,d]=o.useState(null),[p,u]=o.useState("orgList"),[h,f]=o.useState(null),g=((m==null?void 0:m.b2b_settings.organizations_enabled)??!1)&&((m==null?void 0:m.b2b_settings.workspaces_enabled)??!1),x=(m==null?void 0:m.b2b_settings.allow_users_to_create_orgs)??!1,w=o.useRef(!1);o.useEffect(()=>{if(!(w.current||!e)){if(w.current=!0,e.length===0){u("createOrg");return}if(!g){u("orgList");return}if(!n||n.length===0){const P=e.find(S=>{var $,H;return!(($=S.eligibility_restriction)!=null&&$.type)||((H=S.eligibility_restriction)==null?void 0:H.type)==="none"});if(P){f(P.organization.id),u("createWorkspace");return}}u("orgList")}},[e,n,g]);const b=P=>P.split(" ").map(S=>S[0]).join("").toUpperCase().slice(0,2),j=async P=>{if(g){f(P.id),u("workspaceList");return}d(P.id);try{await i(P.id)}finally{d(null)}},v=async P=>{d(P.id);try{await l(P.id)}finally{d(null)}},k=async P=>{var $;await a();const S=(($=P==null?void 0:P.data)==null?void 0:$.organization)||(P==null?void 0:P.organization)||P;if(!g){u("orgList");return}S!=null&&S.id?(f(S.id),u("createWorkspace")):u("orgList")},N=async P=>{var $;const S=(P==null?void 0:P.id)??(($=P==null?void 0:P.workspace)==null?void 0:$.id);if(S){d(S);try{await l(S)}finally{d(null)}}},_=async()=>{f(null),u("orgList")},C=(A=e==null?void 0:e.find(P=>P.organization.id===h))==null?void 0:A.organization,y=h?n==null?void 0:n.filter(P=>P.organization.id===h):[];if(s)return null;if(p==="createOrg")return t.jsx(ze.Body,{style:{padding:0},children:t.jsx(mn,{onSuccess:k,onCancel:()=>u("orgList")})});if(p==="createWorkspace"&&h)return t.jsx(ze.Body,{style:{padding:0},children:t.jsx(Lr,{organizationId:h,onSuccess:N,onCancel:()=>u("workspaceList"),onCreateOrganization:()=>u("createOrg")})});const E=p==="workspaceList",M=E?"Select a workspace":"Select an organization",F=E?`Choose a workspace in ${(C==null?void 0:C.name)||""}`:`to continue to ${((T=m==null?void 0:m.ui_settings)==null?void 0:T.app_name)||"App"}`;return t.jsxs("div",{className:"w-split",children:[t.jsxs("div",{className:"w-split-aside w-flex-col w-justify-between w-gap-6",children:[t.jsxs("div",{className:"w-flex-col w-gap-4",children:[t.jsx(Sr,{placement:"left"}),t.jsxs("div",{className:"w-flex-col w-gap-1",children:[t.jsx("div",{className:"w-title",children:M}),t.jsx("p",{className:"w-sub",children:F})]})]}),t.jsx(Dr,{showName:!0})]}),t.jsxs("div",{className:"w-split-main",children:[t.jsxs("div",{className:"w-grow w-flex-col",style:{overflow:"hidden",marginBottom:24},children:[t.jsxs("div",{className:"w-flex w-items-center w-gap-2",style:{marginBottom:8},children:[E&&t.jsx("button",{className:"w-btn w-btn--icon",onClick:_,"aria-label":"Go back",title:"Go back",children:t.jsx(nn,{})}),t.jsx("h2",{className:"w-sec",children:E?"Workspaces":"Your organizations"})]}),t.jsx("div",{className:"w-grow w-flex-col",style:{overflowY:"auto"},children:E?t.jsx(t.Fragment,{children:y&&y.length>0?y.map(P=>{var $,H,R;const S=(($=P.eligibility_restriction)==null?void 0:$.type)!=="none"&&((H=P.eligibility_restriction)==null?void 0:H.type)!==void 0;return t.jsxs("button",{className:"w-listrow",onClick:()=>!S&&v(P),disabled:c===P.id||S,title:S?(R=P.eligibility_restriction)==null?void 0:R.message:void 0,children:[t.jsx("div",{className:"w-avatar w-avatar--lg",children:P.image_url?t.jsx("img",{src:P.image_url,alt:P.name}):b(P.name).charAt(0)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:P.name}),t.jsxs("div",{className:"w-secsub w-inline w-gap-1",children:[t.jsx(cs,{}),"Workspace"]})]}),t.jsxs("div",{className:"w-inline w-gap-1 w-text-secondary",children:[S&&t.jsx(Ma,{size:16,className:"w-text-error"}),t.jsx(Qt,{})]})]},P.id)}):t.jsxs("div",{className:"w-empty",children:[t.jsx("div",{className:"w-empty-ic",children:t.jsx(cs,{size:20})}),t.jsxs("div",{className:"w-empty-text",children:[t.jsx("h4",{children:"No workspaces yet"}),t.jsxs("p",{children:["Create your first workspace for"," ",(C==null?void 0:C.name)||"this organization"]})]}),t.jsx("div",{className:"w-empty-action",children:t.jsxs(se,{$size:"sm",onClick:()=>u("createWorkspace"),children:[t.jsx(St,{}),"Create workspace"]})})]})}):e&&e.length>0?e.map(P=>{var D,Y,B,Q,ue;const S=P.organization,$=n==null?void 0:n.filter(we=>we.organization.id===S.id),H=($==null?void 0:$.length)||0,R=S.member_count,O=((Y=(D=P.roles)==null?void 0:D[0])==null?void 0:Y.name)||"No role",Z=P.roles.length-1,L=Z>0?`${O.charAt(0).toUpperCase()+O.slice(1)} +${Z}`:O.charAt(0).toUpperCase()+O.slice(1),U=((B=P.eligibility_restriction)==null?void 0:B.type)!=="none"&&((Q=P.eligibility_restriction)==null?void 0:Q.type)!==void 0;return t.jsxs("button",{className:"w-listrow",onClick:()=>!U&&j(S),disabled:c===S.id||U,title:U?(ue=P.eligibility_restriction)==null?void 0:ue.message:void 0,children:[t.jsx("div",{className:"w-avatar w-avatar--lg",children:S.image_url?t.jsx("img",{src:S.image_url,alt:S.name}):b(S.name)}),t.jsxs("div",{className:"w-grow",children:[t.jsx("div",{className:"w-sec w-truncate",children:S.name}),t.jsx("div",{className:"w-secsub w-inline w-gap-1",children:g?t.jsxs(t.Fragment,{children:[t.jsx(cs,{}),H," ","workspace",H!==1?"s":""]}):t.jsxs(t.Fragment,{children:[t.jsx(ps,{}),L," •"," ",R," member",R!==1?"s":""]})})]}),t.jsxs("div",{className:"w-inline w-gap-1 w-text-secondary",children:[U&&t.jsx(Ma,{size:16,className:"w-text-error"}),t.jsx(Qt,{})]})]},S.id)}):t.jsxs("div",{className:"w-empty",children:[t.jsx("div",{className:"w-empty-ic",children:t.jsx(ps,{size:20})}),t.jsxs("div",{className:"w-empty-text",children:[t.jsx("h4",{children:"No organizations yet"}),t.jsx("p",{children:x?"Create your first organization to get started":"You don't have access to any organizations yet"})]}),x&&t.jsx("div",{className:"w-empty-action",children:t.jsxs(se,{$size:"sm",onClick:()=>u("createOrg"),children:[t.jsx(St,{}),"Create organization"]})})]})})]}),E&&h&&t.jsxs(se,{$outline:!0,onClick:()=>u("createWorkspace"),disabled:c!==null,children:[t.jsx(St,{size:12}),"Create workspace"]}),!E&&e&&e.length>0&&x&&t.jsxs(se,{$outline:!0,onClick:()=>u("createOrg"),disabled:c!==null,children:[t.jsx(St,{size:12}),"Create new organization"]})]})]})},jp=({children:e})=>{var h,f,g,x;const{activeOrganization:a}=fa(),{activeWorkspace:s}=Dt(),{deployment:n}=ke(),{loading:i,orgMembership:l,workspaceMembership:m}=Co(),c=((n==null?void 0:n.b2b_settings.organizations_enabled)??!1)&&((n==null?void 0:n.b2b_settings.workspaces_enabled)??!1),d=((h=l==null?void 0:l.eligibility_restriction)==null?void 0:h.type)!=="none"&&((f=l==null?void 0:l.eligibility_restriction)==null?void 0:f.type)!==void 0,p=((g=m==null?void 0:m.eligibility_restriction)==null?void 0:g.type)!=="none"&&((x=m==null?void 0:m.eligibility_restriction)==null?void 0:x.type)!==void 0;return i?null:(d||p||!a?!1:c?s?(m==null?void 0:m.workspace.id)===s.id&&m.organization_id===a.id:!1:!0)?t.jsx(t.Fragment,{children:e}):t.jsx(Re,{children:t.jsx(ze,{isOpen:!0,children:t.jsx(ze.Overlay,{children:t.jsx(ze.Content,{className:"w-flex w-justify-center",style:{padding:0,width:900,maxWidth:"90vw"},children:t.jsx(yp,{})})})})})},_p=e=>{const a=e.toLowerCase().trim();return["javascript:","data:","vbscript:"].some(i=>a.startsWith(i))?!0:["http://","https://","//","ftp://","ftps://","mailto:","tel:","sms:","file:","blob:"].some(i=>a.startsWith(i))},kp=e=>{const a=e.toLowerCase().trim();return!["javascript:","data:","vbscript:"].some(n=>a.startsWith(n))};exports.AcceptInvite=Sm;exports.AuthFormImage=Sr;exports.CreateOrganizationForm=mn;exports.CreateWorkspaceDialog=Pr;exports.CreateWorkspaceForm=Lr;exports.DefaultStylesProvider=Re;exports.DeploymentInitialized=v2;exports.DeploymentInitializing=b2;exports.DeploymentProvider=W0;exports.Dialog=ze;exports.DialogTrigger=Om;exports.Dropdown=_s;exports.DropdownDivider=Tc;exports.DropdownItem=ea;exports.DropdownItems=ks;exports.DropdownTrigger=Cs;exports.Form=Ic;exports.FormGroup=We;exports.Input=be;exports.Label=Te;exports.MagicLinkVerification=km;exports.ManageAccount=M0;exports.ManageAccountDialog=R0;exports.ManageOrganization=Yc;exports.ManageWorkspace=Xc;exports.ManageWorkspaceDialog=Or;exports.NavigateToSignIn=vp;exports.NavigateToSignUp=bp;exports.NavigationLink=Et;exports.NotificationBell=F0;exports.NotificationItem=O0;exports.NotificationPanel=Z0;exports.NotificationPopover=H0;exports.OAuthProvider=mo;exports.ORG_ADMIN_PERMISSIONS=e0;exports.ORG_MANAGEMENT_PERMISSIONS=t0;exports.OTPInput=va;exports.OrganizationSwitcher=n0;exports.PhoneNumberInput=ys;exports.PhoneVerification=Rc;exports.ProfileCompletion=Pc;exports.RequireActiveTenancy=jp;exports.SSOCallback=_m;exports.SignInForm=bm;exports.SignUpForm=mm;exports.SignedIn=wp;exports.SignedInAccounts=xp;exports.SignedOut=gp;exports.SimpleDialog=$m;exports.Spinner=je;exports.Switch=Za;exports.TwoFactorMethodSelector=Mc;exports.TwoFactorVerification=Lc;exports.UserButton=Dr;exports.UserControls=fp;exports.WORKSPACE_ADMIN_PERMISSIONS=a0;exports.WORKSPACE_MANAGEMENT_PERMISSIONS=s0;exports.WaitlistForm=jm;exports.canManageOrganization=Hr;exports.canManageWorkspace=Tr;exports.clearTokenCache=$t;exports.hasIncompleteProfile=Cm;exports.hasOrgPermission=Zr;exports.hasWorkspacePermission=Fr;exports.isExternalUrl=_p;exports.isOrgAdmin=E4;exports.isSafeUrl=kp;exports.isWorkspaceAdmin=A4;exports.redirectToProfileCompletion=Nm;exports.useActiveOrganization=fa;exports.useActiveTenancy=Co;exports.useActiveWorkspace=Dt;exports.useActorMcpServers=zd;exports.useActorProjectSearch=Md;exports.useActorProjects=Ad;exports.useActorThreadSearch=Pd;exports.useAgentSession=_d;exports.useAgentThread=$d;exports.useAgentThreadAssignments=Zd;exports.useAgentThreadConversation=jd;exports.useAgentThreadFilesystem=Od;exports.useAgentThreadTaskGraphs=Id;exports.useApiAuthAppSession=h2;exports.useApiAuthAuditAnalytics=g2;exports.useApiAuthAuditLogs=w2;exports.useApiAuthAuditTimeseries=x2;exports.useApiAuthKeys=f2;exports.useClient=ye;exports.useCreateWebhookEndpoint=c2;exports.useDeployment=ke;exports.useExternalAgentConnections=Dd;exports.useForgotPassword=Ao;exports.useInvitation=Ho;exports.useMagicLinkVerification=Eo;exports.useNavigation=kt;exports.useNotificationStream=Mo;exports.useNotificationUnreadCount=Lo;exports.useNotifications=Ro;exports.useOrganizationList=zt;exports.useOrganizationMemberships=wa;exports.useProjectTaskBoardItem=Td;exports.useProjectTaskBoardItemComments=Vd;exports.useProjectTasks=Fd;exports.useProjectThreadFeed=Ld;exports.useProjectThreads=Rd;exports.useSSOCallback=So;exports.useSession=it;exports.useSignIn=po;exports.useSignUp=ho;exports.useThemeOverrideVars=ts;exports.useUser=xa;exports.useUserSignins=ko;exports.useWaitlist=No;exports.useWebhookAnalytics=m2;exports.useWebhookAppSession=i2;exports.useWebhookDeliveries=u2;exports.useWebhookEndpoints=l2;exports.useWebhookEvents=d2;exports.useWebhookStats=o2;exports.useWebhookTimeseries=p2;exports.useWorkspaceList=ga;exports.useWorkspaceMemberships=tn;Object.keys(Ur).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>Ur[e]})});
119
119
  //# sourceMappingURL=index.cjs.js.map