import { $APP, shadow$provide } from "./shared.js";
const shadow_esm_import = function(x) { return import(x) };
var $app$config$external_notify_register_success$$,$app$main$ui$static$0$invalid_token$$,$app$main$ui$auth$login$demo_warning_STAR_$$,$app$main$data$auth$show_redirect_error$$,$app$main$data$auth$login_from_token$$,$app$main$data$auth$create_demo_profile$$,$app$main$ui$auth$login$create_demo_profile$$,$app$main$ui$auth$register$register_validate_page_STAR_$$,$app$main$ui$auth$register$register_page_STAR_$$,$app$main$ui$auth$login$login_page$$,$app$main$data$profile$recover_profile$$,$app$main$ui$auth$recovery$on_error$$,
$app$main$ui$auth$recovery$on_success$$,$app$main$ui$auth$recovery$on_submit$$,$app$main$ui$auth$recovery$recovery_form_STAR_$$,$app$main$ui$auth$recovery$recovery_page_STAR_$$,$app$main$ui$auth$auth_STAR_$$,$app$main$ui$auth$verify_token$verify_token_STAR_$$,$app$main$data$profile$recover_profile_55406$$,$app$main$data$auth$login_from_token_55872$$,$app$main$data$auth$create_demo_profile_55990$$,$app$main$data$auth$show_redirect_error_55995$$,$cljs$cst$6402$iss$$,$cljs$cst$6407$org_team_id$$,$cljs$cst$6411$invalid_token$$,
$cljs$cst$6410$org_not_found$$,$cljs$cst$6403$verify_email$$,$cljs$cst$6405$auth$$,$cljs$cst$6414$email_already_validated$$,$cljs$cst$6413$email_mismatch$$,$cljs$cst$6406$team_invitation$$,$cljs$cst$6415$verify_token$$,$cljs$cst$6412$token_expired$$,$cljs$cst$6408$redirect_to$$,$cljs$cst$6409$invalid_token_already_member$$,$cljs$cst$6401$register_validate_page$$;
$app$config$external_notify_register_success$$=function($G__43699_profile_id$$){var $f$jscomp$656$$=$APP.$app$util$object$get$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$app$util$globals$global$$,"externalNotifyRegisterSuccess");$APP.$cljs$core$fn_QMARK_$$($f$jscomp$656$$)&&($G__43699_profile_id$$=$APP.$cljs$core$str$$.$cljs$core$IFn$_invoke$arity$1$($G__43699_profile_id$$),$f$jscomp$656$$.$cljs$core$IFn$_invoke$arity$1$?$f$jscomp$656$$.$cljs$core$IFn$_invoke$arity$1$($G__43699_profile_id$$):$f$jscomp$656$$($G__43699_profile_id$$))};
$app$main$ui$static$0$invalid_token$$=function($map__76108_map__76108__$1_props_76101$$){$map__76108_map__76108__$1_props_76101$$=$APP.$rumext$v2$util$wrap_props$$($map__76108_map__76108__$1_props_76101$$);$map__76108_map__76108__$1_props_76101$$=$APP.$cljs$core$__destructure_map$$($map__76108_map__76108__$1_props_76101$$);var $reason$jscomp$25$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__76108_map__76108__$1_props_76101$$,$APP.$cljs$cst$984$reason$$);return $APP.$rumext$v2$jsx$$($APP.$app$main$ui$static$0$error_container_STAR_$$,
{children:function(){switch($reason$jscomp$25$$ instanceof $APP.$cljs$core$Keyword$$?$reason$jscomp$25$$.$fqn$:null){case "email-mismatch":return(0,$APP.$rumext$v2$jsx$$)($APP.$rumext$v2$Fragment$$,{children:(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_static__main-message",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.invite-email-mismatch")})});case "token-expired":return(0,$APP.$rumext$v2$jsx$$)($APP.$rumext$v2$Fragment$$,{children:(0,$APP.$rumext$v2$jsx$$)("div",
{className:"main_ui_static__main-message",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.invite-expired")})});default:return(0,$APP.$rumext$v2$jsxs$$)($APP.$rumext$v2$Fragment$$,{children:[(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_static__main-message",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.invite-invalid")}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_static__desc-message",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.invite-invalid.info")})]})}}()})};
$app$main$ui$auth$login$demo_warning_STAR_$$=function(){return $APP.$rumext$v2$jsx$$($APP.$app$main$ui$ds$notifications$context_notification$context_notification_STAR_$$,{level:$APP.$cljs$cst$2354$warning$$,children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.demo-warning")})};
$app$main$data$auth$show_redirect_error$$=function($error$jscomp$55$$){typeof $app$main$data$auth$show_redirect_error_55995$$==="undefined"&&($app$main$data$auth$show_redirect_error_55995$$=function($error$jscomp$56$$,$meta55996$$){this.error=$error$jscomp$56$$;this.$meta55996$=$meta55996$$;this.$cljs$lang$protocol_mask$partition0$$=393216;this.$cljs$lang$protocol_mask$partition1$$=0},$app$main$data$auth$show_redirect_error_55995$$.prototype.$potok$v2$core$Event$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,
$app$main$data$auth$show_redirect_error_55995$$.prototype.$potok$v2$core$Event$_type$arity$1$=function(){return $APP.$cljs$cst$3417$app_DOT_main_DOT_data_DOT_auth_SLASH_show_redirect_error$$},$app$main$data$auth$show_redirect_error_55995$$.prototype.$cljs$core$IWithMeta$_with_meta$arity$2$=function($_55997$$,$meta55996__$1$$){return new $app$main$data$auth$show_redirect_error_55995$$(this.error,$meta55996__$1$$)},$app$main$data$auth$show_redirect_error_55995$$.prototype.$cljs$core$IMeta$_meta$arity$1$=
function(){return this.$meta55996$},$app$main$data$auth$show_redirect_error_55995$$.prototype.$potok$v2$core$WatchEvent$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$auth$show_redirect_error_55995$$.prototype.$potok$v2$core$WatchEvent$watch$arity$3$=function(){var $self__$jscomp$3888$$=this,$temp__5825__auto__$jscomp$182$$=function(){switch($self__$jscomp$3888$$.error){case "registration-disabled":return $APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.registration-disabled");
case "profile-blocked":return $APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.profile-blocked");case "auth-provider-not-allowed":return $APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.auth-provider-not-allowed");case "email-domain-not-allowed":return $APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.email-domain-not-allowed");case "unable-to-auth":return null;default:return $APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.generic")}}();
return $APP.$cljs$core$truth_$$($temp__5825__auto__$jscomp$182$$)?(0,$APP.$beicon$v2$core$of$$)($APP.$app$main$data$notifications$warn$cljs$0core$0IFn$0_invoke$0arity$02$$($temp__5825__auto__$jscomp$182$$)):null});return new $app$main$data$auth$show_redirect_error_55995$$($error$jscomp$55$$,$APP.$cljs$core$PersistentArrayMap$EMPTY$$)};
$app$main$data$auth$login_from_token$$=function($p__55869$$){var $map__55870__$1$$=$APP.$cljs$core$__destructure_map$$($p__55869$$),$profile$jscomp$16$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__55870__$1$$,$APP.$cljs$cst$1931$profile$$),$invitation_token$jscomp$2$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__55870__$1$$,$APP.$cljs$cst$1134$invitation_token$$);typeof $app$main$data$auth$login_from_token_55872$$==="undefined"&&($app$main$data$auth$login_from_token_55872$$=
function($p__55869$jscomp$1$$,$map__55870$jscomp$1$$,$tdata$jscomp$1$$,$profile$jscomp$17$$,$invitation_token$jscomp$3$$,$meta55873$$){this.$p__55869$=$p__55869$jscomp$1$$;this.$map__55870$=$map__55870$jscomp$1$$;this.$tdata$=$tdata$jscomp$1$$;this.profile=$profile$jscomp$17$$;this.$invitation_token$=$invitation_token$jscomp$3$$;this.$meta55873$=$meta55873$$;this.$cljs$lang$protocol_mask$partition0$$=393216;this.$cljs$lang$protocol_mask$partition1$$=0},$app$main$data$auth$login_from_token_55872$$.prototype.$potok$v2$core$Event$$=
$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$auth$login_from_token_55872$$.prototype.$potok$v2$core$Event$_type$arity$1$=function(){return $APP.$cljs$cst$3407$app_DOT_main_DOT_data_DOT_auth_SLASH_login_from_token$$},$app$main$data$auth$login_from_token_55872$$.prototype.$cljs$core$IWithMeta$_with_meta$arity$2$=function($_55874$$,$meta55873__$1$$){return new $app$main$data$auth$login_from_token_55872$$(this.$p__55869$,this.$map__55870$,this.$tdata$,this.profile,this.$invitation_token$,$meta55873__$1$$)},
$app$main$data$auth$login_from_token_55872$$.prototype.$cljs$core$IMeta$_meta$arity$1$=function(){return this.$meta55873$},$app$main$data$auth$login_from_token_55872$$.prototype.$potok$v2$core$WatchEvent$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$auth$login_from_token_55872$$.prototype.$potok$v2$core$WatchEvent$watch$arity$3$=function(){var $self__$jscomp$3857$$=this;return $APP.$beicon$v2$core$map$$(function($G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$){$G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$=
$APP.$cljs$core$truth_$$($self__$jscomp$3857$$.$invitation_token$)?$APP.$cljs$core$assoc$$.$cljs$core$IFn$_invoke$arity$3$($G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$,$APP.$cljs$cst$1134$invitation_token$$,$self__$jscomp$3857$$.$invitation_token$):$G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$;$G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$=$APP.$cljs$core$with_meta$$($G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$,
new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$3400$app_DOT_main_DOT_data_DOT_event_SLASH_source$$,"login-with-token"],null));return $APP.$app$main$data$auth$logged_in$$($G__55885__$1$jscomp$inline_9770_profile__$1$jscomp$4_profile__$2$$)},$APP.$app$main$data$profile$on_fetch_profile_success$$($self__$jscomp$3857$$.profile))});return new $app$main$data$auth$login_from_token_55872$$($p__55869$$,$map__55870__$1$$,$map__55870__$1$$,$profile$jscomp$16$$,$invitation_token$jscomp$2$$,$APP.$cljs$core$PersistentArrayMap$EMPTY$$)};
$app$main$data$auth$create_demo_profile$$=function(){typeof $app$main$data$auth$create_demo_profile_55990$$==="undefined"&&($app$main$data$auth$create_demo_profile_55990$$=function($meta55991$$){this.$meta55991$=$meta55991$$;this.$cljs$lang$protocol_mask$partition0$$=393216;this.$cljs$lang$protocol_mask$partition1$$=0},$app$main$data$auth$create_demo_profile_55990$$.prototype.$potok$v2$core$Event$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$auth$create_demo_profile_55990$$.prototype.$potok$v2$core$Event$_type$arity$1$=
function(){return $APP.$cljs$cst$3415$app_DOT_main_DOT_data_DOT_auth_SLASH_create_demo_profile$$},$app$main$data$auth$create_demo_profile_55990$$.prototype.$cljs$core$IWithMeta$_with_meta$arity$2$=function($_55992$$,$meta55991__$1$$){return new $app$main$data$auth$create_demo_profile_55990$$($meta55991__$1$$)},$app$main$data$auth$create_demo_profile_55990$$.prototype.$cljs$core$IMeta$_meta$arity$1$=function(){return this.$meta55991$},$app$main$data$auth$create_demo_profile_55990$$.prototype.$potok$v2$core$WatchEvent$$=
$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$auth$create_demo_profile_55990$$.prototype.$potok$v2$core$WatchEvent$watch$arity$3$=function(){return $APP.$beicon$v2$core$map$$($APP.$app$main$data$auth$login$$,$APP.$app$main$repo$cmd_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$cst$3416$create_demo_profile$$,$APP.$cljs$core$PersistentArrayMap$EMPTY$$))});return new $app$main$data$auth$create_demo_profile_55990$$($APP.$cljs$core$PersistentArrayMap$EMPTY$$)};
$app$main$ui$auth$login$create_demo_profile$$=function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($app$main$data$auth$create_demo_profile$$())};
$APP.$app$main$ui$auth$register$register_validate_form_STAR_$$=function($form$jscomp$187_props_75686$$){var $on_submit$jscomp$16_params$jscomp$412$$=$form$jscomp$187_props_75686$$.params,$on_success_callback$jscomp$5$$=$form$jscomp$187_props_75686$$.onSuccessCallback;$form$jscomp$187_props_75686$$=$APP.$app$util$forms$use_form$$.$cljs$core$IFn$_invoke$arity$4$?$APP.$app$util$forms$use_form$$.$cljs$core$IFn$_invoke$arity$4$($APP.$cljs$cst$298$schema$$,$APP.$app$main$ui$auth$register$schema_COLON_register_validate_form$$,
$APP.$cljs$cst$4840$initial$$,$on_submit$jscomp$16_params$jscomp$412$$):$APP.$app$util$forms$use_form$$($APP.$cljs$cst$298$schema$$,$APP.$app$main$ui$auth$register$schema_COLON_register_validate_form$$,$APP.$cljs$cst$4840$initial$$,$on_submit$jscomp$16_params$jscomp$412$$);var $submitted_QMARK_$jscomp$1$$=$APP.$rumext$v2$use_state$cljs$0core$0IFn$0_invoke$0arity$01$$(!1),$on_success$jscomp$55$$=$APP.$rumext$v2$use_fn$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$rumext$v2$adapt$$($on_success_callback$jscomp$5$$)],
function($G__75687_params__$1$jscomp$55_token$jscomp$123$$){$app$config$external_notify_register_success$$($APP.$cljs$cst$266$id$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$));if($APP.$cljs$core$fn_QMARK_$$($on_success_callback$jscomp$5$$))return $G__75687_params__$1$jscomp$55_token$jscomp$123$$=$APP.$cljs$cst$3207$email$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$),$on_success_callback$jscomp$5$$.$cljs$core$IFn$_invoke$arity$1$?
$on_success_callback$jscomp$5$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$):$on_success_callback$jscomp$5$$($G__75687_params__$1$jscomp$55_token$jscomp$123$$);if($APP.$cljs$cst$1134$invitation_token$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$)!=null)return $G__75687_params__$1$jscomp$55_token$jscomp$123$$=$APP.$cljs$cst$1134$invitation_token$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$),
$APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$cljs$cst$3364$auth_verify_token$$,new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$1136$token$$,$G__75687_params__$1$jscomp$55_token$jscomp$123$$],null)));if($APP.$cljs$core$truth_$$($APP.$cljs$cst$3374$is_active$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$)))return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$auth$login_from_register$$());
$APP.$cljs$core$swap_BANG_$$.$cljs$core$IFn$_invoke$arity$4$($APP.$app$util$storage$user$$,$APP.$cljs$core$assoc$$,$APP.$cljs$cst$5495$app_DOT_main_DOT_ui_DOT_auth_DOT_register_SLASH_email$$,$APP.$cljs$cst$3207$email$$.$cljs$core$IFn$_invoke$arity$1$($G__75687_params__$1$jscomp$55_token$jscomp$123$$));return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$5496$auth_register_success$$))}),$on_error$jscomp$71$$=
$APP.$rumext$v2$use_fn$cljs$0core$0IFn$0_invoke$0arity$01$$(function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$error$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.generic")))});$on_submit$jscomp$16_params$jscomp$412$$=$APP.$rumext$v2$use_fn$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$rumext$v2$adapt$$($on_success$jscomp$55$$),$APP.$rumext$v2$adapt$$($on_error$jscomp$71$$)],function($form__$1$jscomp$19$$){$APP.$cljs$core$reset_BANG_$$($submitted_QMARK_$jscomp$1$$,
!0);var $create_welcome_file_QMARK_$jscomp$1$$=$APP.$app$config$external_feature_flag$$(),$params__$1$jscomp$56$$=function(){var $G__75694$$=$APP.$cljs$cst$4838$clean_data$$.$cljs$core$IFn$_invoke$arity$1$($APP.$cljs$core$_deref$$($form__$1$jscomp$19$$));return $APP.$cljs$core$truth_$$($create_welcome_file_QMARK_$jscomp$1$$)?$APP.$cljs$core$assoc$$.$cljs$core$IFn$_invoke$arity$3$($G__75694$$,$APP.$cljs$cst$5498$create_welcome_file$$,!0):$G__75694$$}();return $APP.$beicon$v2$core$subs_BANG_$cljs$0core$0IFn$0_invoke$0arity$03$$($on_success$jscomp$55$$,
$on_error$jscomp$71$$,$APP.$beicon$v2$core$finalize$$(function(){return $APP.$cljs$core$reset_BANG_$$($submitted_QMARK_$jscomp$1$$,!1)},$APP.$app$main$repo$cmd_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$cst$5497$register_profile$$,$params__$1$jscomp$56$$)))});return $APP.$rumext$v2$jsxs$$($APP.$app$main$ui$components$forms$form$$,{"on-submit":$on_submit$jscomp$16_params$jscomp$412$$,form:$form$jscomp$187_props_75686$$,"class":"main_ui_auth_register__register-validate-form",children:[(0,$APP.$rumext$v2$jsx$$)("div",
{className:"main_ui_auth_register__fields-row",children:$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$forms$input$$,{name:$APP.$cljs$cst$1365$fullname$$,label:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.fullname"),type:"text","show-success?":!0,"class":"main_ui_auth_register__form-field"})}),$APP.$cljs$core$contains_QMARK_$$($APP.$app$config$flags$$,$APP.$cljs$cst$1232$terms_and_privacy_checkbox$$)?$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$terms_and_privacy_STAR_$$,
{}):null,$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$newsletter_options_STAR_$$,{}),$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$forms$submit_button_STAR_$$,{label:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register-submit"),disabled:$APP.$cljs$core$_deref$$($submitted_QMARK_$jscomp$1$$),className:"main_ui_auth_register__register-btn"})]})};
$app$main$ui$auth$register$register_validate_page_STAR_$$=function($params$jscomp$413_props_75697$$){$params$jscomp$413_props_75697$$=$params$jscomp$413_props_75697$$.params;return(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_register__auth-form-wrapper main_ui_auth_register__register-form",children:[(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_register__auth-title-wrapper",children:[(0,$APP.$rumext$v2$jsx$$)("h2",{"data-testid":"register-title",className:"main_ui_auth_register__auth-title",
children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register-account-title")}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_register__auth-subtitle",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register-account-tagline")})]}),$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$register_validate_form_STAR_$$,{params:$params$jscomp$413_props_75697$$}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_register__links",children:(0,$APP.$rumext$v2$jsx$$)("div",
{className:"main_ui_auth_register__go-back",children:$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$link$link_STAR_$$,{action:function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$navigate$$($APP.$cljs$cst$5486$auth_register$$,$APP.$cljs$core$PersistentArrayMap$EMPTY$$))},className:"main_ui_auth_register__go-back-link",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("labels.go-back")})})})]})};
$app$main$ui$auth$register$register_page_STAR_$$=function($props_75668$$){var $params$jscomp$410$$=$props_75668$$.params;return(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_register__auth-form-wrapper main_ui_auth_register__register-form",children:[(0,$APP.$rumext$v2$jsx$$)("h1",{"data-testid":"registration-title",className:"main_ui_auth_register__auth-title",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register-title")}),$APP.$cljs$core$contains_QMARK_$$($APP.$app$config$flags$$,
$APP.$cljs$cst$1187$demo_warning$$)?(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$login$demo_warning_STAR_$$,{}):null,$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$register_methods_STAR_$$,{params:$params$jscomp$410$$}),(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_register__links",children:[(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_register__account",children:[(0,$APP.$rumext$v2$jsxs$$)("span",{className:"main_ui_auth_register__account-text",children:[$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.already-have-account"),
" "]}),$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$link$link_STAR_$$,{action:function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$navigate$$($APP.$cljs$cst$3410$auth_login$$,$params$jscomp$410$$))},className:"main_ui_auth_register__account-link","data-testid":"login-here-link",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.login-here")})]}),$APP.$cljs$core$contains_QMARK_$$($APP.$app$config$flags$$,$APP.$cljs$cst$1207$demo_users$$)?
(0,$APP.$rumext$v2$jsxs$$)($APP.$rumext$v2$Fragment$$,{children:[(0,$APP.$rumext$v2$jsx$$)("hr",{className:"main_ui_auth_register__separator"}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_register__demo-account",children:$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$link$link_STAR_$$,{action:$app$main$ui$auth$login$create_demo_profile$$,className:"main_ui_auth_register__demo-account-link",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.create-demo-account")})})]}):
null]})]})};
$app$main$ui$auth$login$login_page$$=function($go_register_map__75627_map__75627__$1_props_75626$$){$go_register_map__75627_map__75627__$1_props_75626$$=$APP.$rumext$v2$util$wrap_props$$($go_register_map__75627_map__75627__$1_props_75626$$);$go_register_map__75627_map__75627__$1_props_75626$$=$APP.$cljs$core$__destructure_map$$($go_register_map__75627_map__75627__$1_props_75626$$);var $params$jscomp$405$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($go_register_map__75627_map__75627__$1_props_75626$$,$APP.$cljs$cst$1435$params$$);
$go_register_map__75627_map__75627__$1_props_75626$$=$APP.$rumext$v2$use_fn$cljs$0core$0IFn$0_invoke$0arity$01$$(function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$navigate$$($APP.$cljs$cst$5486$auth_register$$,$params$jscomp$405$$))});return(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_login__auth-form-wrapper",children:[(0,$APP.$rumext$v2$jsx$$)("h1",{"data-testid":"login-title",className:"main_ui_auth_login__auth-title",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.login-account-title")}),
(0,$APP.$rumext$v2$jsx$$)("p",{className:"main_ui_auth_login__auth-tagline",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.login-tagline")}),$APP.$cljs$core$contains_QMARK_$$($APP.$app$config$flags$$,$APP.$cljs$cst$1187$demo_warning$$)?(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$login$demo_warning_STAR_$$,{}):null,$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$login$login_dialog_STAR_$$,{params:$params$jscomp$405$$}),(0,$APP.$rumext$v2$jsx$$)("hr",{className:"main_ui_auth_login__separator"}),
(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_login__links",children:$APP.$cljs$core$contains_QMARK_$$($APP.$app$config$flags$$,$APP.$cljs$cst$1178$registration$$)?(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_login__register",children:[(0,$APP.$rumext$v2$jsxs$$)("span",{className:"main_ui_auth_login__register-text",children:[$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register")," "]}),$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$link$link_STAR_$$,
{action:$go_register_map__75627_map__75627__$1_props_75626$$,className:"main_ui_auth_login__register-link","data-testid":"register-submit",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.register-submit")})]}):null})]})};
$app$main$data$profile$recover_profile$$=function($data$jscomp$273_data__$1$jscomp$11$$){$data$jscomp$273_data__$1$jscomp$11$$=(0,$APP.$app$main$data$profile$check_recover_profile$$)($data$jscomp$273_data__$1$jscomp$11$$);typeof $app$main$data$profile$recover_profile_55406$$==="undefined"&&($app$main$data$profile$recover_profile_55406$$=function($data$jscomp$274$$,$meta55407$$){this.data=$data$jscomp$274$$;this.$meta55407$=$meta55407$$;this.$cljs$lang$protocol_mask$partition0$$=393216;this.$cljs$lang$protocol_mask$partition1$$=
0},$app$main$data$profile$recover_profile_55406$$.prototype.$potok$v2$core$Event$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$profile$recover_profile_55406$$.prototype.$potok$v2$core$Event$_type$arity$1$=function(){return $APP.$cljs$cst$3269$app_DOT_main_DOT_data_DOT_profile_SLASH_recover_profile$$},$app$main$data$profile$recover_profile_55406$$.prototype.$cljs$core$IWithMeta$_with_meta$arity$2$=function($_55408$$,$meta55407__$1$$){return new $app$main$data$profile$recover_profile_55406$$(this.data,
$meta55407__$1$$)},$app$main$data$profile$recover_profile_55406$$.prototype.$cljs$core$IMeta$_meta$arity$1$=function(){return this.$meta55407$},$app$main$data$profile$recover_profile_55406$$.prototype.$potok$v2$core$WatchEvent$$=$APP.$cljs$core$PROTOCOL_SENTINEL$$,$app$main$data$profile$recover_profile_55406$$.prototype.$potok$v2$core$WatchEvent$watch$arity$3$=function(){var $map__55422_on_error$jscomp$11$$=$APP.$cljs$core$meta$$(this.data),$map__55422__$1_on_success$jscomp$7$$=$APP.$cljs$core$__destructure_map$$($map__55422_on_error$jscomp$11$$);
$map__55422_on_error$jscomp$11$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$3$($map__55422__$1_on_success$jscomp$7$$,$APP.$cljs$cst$1300$on_error$$,$APP.$beicon$v2$core$throw$0$$);$map__55422__$1_on_success$jscomp$7$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$3$($map__55422__$1_on_success$jscomp$7$$,$APP.$cljs$cst$2499$on_success$$,$APP.$cljs$core$identity$$);return $APP.$beicon$v2$core$catch$0$cljs$0core$0IFn$0_invoke$0arity$02$$($map__55422_on_error$jscomp$11$$,$APP.$beicon$v2$core$tap$cljs$0core$0IFn$0_invoke$0arity$02$$($map__55422__$1_on_success$jscomp$7$$,
$APP.$app$main$repo$cmd_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$cst$3270$recover_profile$$,this.data)))});return new $app$main$data$profile$recover_profile_55406$$($data$jscomp$273_data__$1$jscomp$11$$,$APP.$cljs$core$PersistentArrayMap$EMPTY$$)};$app$main$ui$auth$recovery$on_error$$=function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$error$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.invalid-recovery-token")))};
$app$main$ui$auth$recovery$on_success$$=function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$data$notifications$info$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.notifications.password-changed-successfully")),$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$3410$auth_login$$)]))};
$app$main$ui$auth$recovery$on_submit$$=function($form$jscomp$210_params$jscomp$447$$){var $mdata$jscomp$28$$=new $APP.$cljs$core$PersistentArrayMap$$(null,2,[$APP.$cljs$cst$1300$on_error$$,$app$main$ui$auth$recovery$on_error$$,$APP.$cljs$cst$2499$on_success$$,$app$main$ui$auth$recovery$on_success$$],null);$form$jscomp$210_params$jscomp$447$$=new $APP.$cljs$core$PersistentArrayMap$$(null,2,[$APP.$cljs$cst$1136$token$$,$APP.$cljs$core$get_in$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$core$_deref$$($form$jscomp$210_params$jscomp$447$$),
new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$4838$clean_data$$,$APP.$cljs$cst$1136$token$$],null)),$APP.$cljs$cst$751$password$$,$APP.$cljs$core$get_in$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$core$_deref$$($form$jscomp$210_params$jscomp$447$$),new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$4838$clean_data$$,$APP.$cljs$cst$3240$password_2$$],null))],null);return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($app$main$data$profile$recover_profile$$($APP.$cljs$core$with_meta$$($form$jscomp$210_params$jscomp$447$$,
$mdata$jscomp$28$$)))};
$app$main$ui$auth$recovery$recovery_form_STAR_$$=function($form$jscomp$211_params$jscomp$448_props_83364$$){$form$jscomp$211_params$jscomp$448_props_83364$$=$form$jscomp$211_params$jscomp$448_props_83364$$.params;$form$jscomp$211_params$jscomp$448_props_83364$$=$APP.$app$util$forms$use_form$$.$cljs$core$IFn$_invoke$arity$4$?$APP.$app$util$forms$use_form$$.$cljs$core$IFn$_invoke$arity$4$($APP.$cljs$cst$298$schema$$,$app$main$ui$auth$recovery$schema_COLON_recovery_form$$,$APP.$cljs$cst$4840$initial$$,$form$jscomp$211_params$jscomp$448_props_83364$$):
$APP.$app$util$forms$use_form$$($APP.$cljs$cst$298$schema$$,$app$main$ui$auth$recovery$schema_COLON_recovery_form$$,$APP.$cljs$cst$4840$initial$$,$form$jscomp$211_params$jscomp$448_props_83364$$);return $APP.$rumext$v2$jsxs$$($APP.$app$main$ui$components$forms$form$$,{"on-submit":$app$main$ui$auth$recovery$on_submit$$,"class":"main_ui_auth_recovery__recovery-form",form:$form$jscomp$211_params$jscomp$448_props_83364$$,children:[(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_recovery__fields-row",
children:$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$forms$input$$,{type:"password",name:$APP.$cljs$cst$3239$password_1$$,"show-success?":!0,label:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.new-password"),"class":"main_ui_auth_recovery__form-field"})}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_recovery__fields-row",children:$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$forms$input$$,{type:"password",name:$APP.$cljs$cst$3240$password_2$$,"show-success?":!0,
label:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.confirm-password"),"class":"main_ui_auth_recovery__form-field"})}),$APP.$rumext$v2$jsx$$($APP.$app$main$ui$components$forms$submit_button_STAR_$$,{label:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.recovery-submit"),className:"main_ui_auth_recovery__submit-btn"})]})};
$app$main$ui$auth$recovery$recovery_page_STAR_$$=function($params$jscomp$449_props_83365$$){$params$jscomp$449_props_83365$$=$params$jscomp$449_props_83365$$.params;return(0,$APP.$rumext$v2$jsxs$$)("div",{className:"main_ui_auth_recovery__auth-form-wrapper",children:[(0,$APP.$rumext$v2$jsx$$)("h1",{className:"main_ui_auth_recovery__auth-title",children:"Forgot your password?"}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_recovery__auth-subtitle",children:"Please enter your new password"}),
(0,$APP.$rumext$v2$jsx$$)("hr",{className:"main_ui_auth_recovery__separator"}),(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$recovery$recovery_form_STAR_$$,{params:$params$jscomp$449_props_83365$$}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_recovery__links",children:(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth_recovery__go-back",children:(0,$APP.$rumext$v2$jsx$$)("a",{onClick:function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$3410$auth_login$$))},
className:"main_ui_auth_recovery__go-back-link",children:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("profile.recovery.go-to-login")})})})]})};
$app$main$ui$auth$auth_STAR_$$=function($props_83370_route$jscomp$22$$){$props_83370_route$jscomp$22$$=$props_83370_route$jscomp$22$$.route;var $section$jscomp$46$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($props_83370_route$jscomp$22$$,$APP.$cljs$cst$142$data$$),$APP.$cljs$cst$725$name$$),$is_register$$=$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($section$jscomp$46$$,$APP.$cljs$cst$5486$auth_register$$)||$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($section$jscomp$46$$,
$APP.$cljs$cst$6400$auth_register_validate$$)||$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($section$jscomp$46$$,$cljs$cst$6401$register_validate_page$$)||$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($section$jscomp$46$$,$APP.$cljs$cst$5496$auth_register_success$$),$params$jscomp$450$$=$APP.$cljs$cst$2278$query_params$$.$cljs$core$IFn$_invoke$arity$1$($props_83370_route$jscomp$22$$),$error$jscomp$155$$=$APP.$cljs$cst$849$error$$.$cljs$core$IFn$_invoke$arity$1$($params$jscomp$450$$);
$APP.$rumext$v2$use_effect$cljs$0core$0IFn$0_invoke$0arity$02$$([],function(){return $APP.$app$util$dom$set_html_title$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("title.default"))});$APP.$rumext$v2$use_effect$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$rumext$v2$adapt$$($error$jscomp$155$$)],function(){return $APP.$cljs$core$truth_$$($error$jscomp$155$$)?$APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($app$main$data$auth$show_redirect_error$$($error$jscomp$155$$)):
null});return(0,$APP.$rumext$v2$jsxs$$)("main",{className:"main_ui_auth__auth-section "+($is_register$$?"main_ui_auth__register":""),children:[(0,$APP.$rumext$v2$jsx$$)("h1",{className:"main_ui_auth__logo-container",children:(0,$APP.$rumext$v2$jsx$$)("a",{href:"#/",title:"Penpot",className:"main_ui_auth__logo-btn",children:$APP.$app$main$ui$icons$logo$$})}),(0,$APP.$rumext$v2$jsx$$)("div",{className:"main_ui_auth__login-illustration",children:(0,$APP.$rumext$v2$jsx$$)("img",{src:"images/registration-illustration.png"})}),
(0,$APP.$rumext$v2$jsxs$$)("section",{className:"main_ui_auth__auth-content",children:[function(){var $G__83378__$1$$=$section$jscomp$46$$ instanceof $APP.$cljs$core$Keyword$$?$section$jscomp$46$$.$fqn$:null;switch($G__83378__$1$$){case "auth-register":return(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$register$register_page_STAR_$$,{params:$params$jscomp$450$$});case "auth-register-success":return $APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$register_success_page_STAR_$$,{params:$params$jscomp$450$$});
case "auth-register-validate":return(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$register$register_validate_page_STAR_$$,{params:$params$jscomp$450$$});case "auth-login":return(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$login$login_page$$,{params:$params$jscomp$450$$});case "auth-recovery-request":return $APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$recovery_request$recovery_request_page$$,{});case "auth-recovery":return(0,$APP.$rumext$v2$jsx$$)($app$main$ui$auth$recovery$recovery_page_STAR_$$,{params:$params$jscomp$450$$});
default:throw Error(["No matching clause: ",$APP.$cljs$core$str$$.$cljs$core$IFn$_invoke$arity$1$($G__83378__$1$$)].join(""));}}(),$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($section$jscomp$46$$,$APP.$cljs$cst$5486$auth_register$$)?$APP.$rumext$v2$jsx$$($APP.$app$main$ui$auth$register$terms_register_STAR_$$,{}):null]})]})};$APP.$app$main$ui$auth$auth_page_STAR_$$=function($props_83379$$){return(0,$APP.$rumext$v2$create_element$$)($app$main$ui$auth$auth_STAR_$$,$props_83379$$)};
$app$main$ui$auth$verify_token$verify_token_STAR_$$=function($props_83419$$){var $token$jscomp$214$$=$APP.$cljs$core$get_in$$.$cljs$core$IFn$_invoke$arity$2$($props_83419$$.route,new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$2278$query_params$$,$APP.$cljs$cst$1136$token$$],null)),$bad_token_reason$$=$APP.$rumext$v2$use_state$cljs$0core$0IFn$0_invoke$0arity$01$$(null);$APP.$rumext$v2$use_effect$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$rumext$v2$adapt$$($token$jscomp$214$$)],
function(){$APP.$app$util$dom$set_html_title$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("title.default"));return $APP.$beicon$v2$core$subs_BANG_$cljs$0core$0IFn$0_invoke$0arity$03$$(function($tdata$jscomp$4$$){return $app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IFn$_invoke$arity$1$($tdata$jscomp$4$$)},function($cause$jscomp$116_type$jscomp$728$$){var $map__83420__$1_reason$jscomp$30$$=$APP.$cljs$core$__destructure_map$$($APP.$cljs$core$ex_data$$($cause$jscomp$116_type$jscomp$728$$));
$cause$jscomp$116_type$jscomp$728$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83420__$1_reason$jscomp$30$$,$APP.$cljs$cst$139$type$$);var $code$jscomp$64$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83420__$1_reason$jscomp$30$$,$APP.$cljs$cst$273$code$$),$team_id$jscomp$186$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83420__$1_reason$jscomp$30$$,$APP.$cljs$cst$1944$team_id$$);$map__83420__$1_reason$jscomp$30$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83420__$1_reason$jscomp$30$$,
$APP.$cljs$cst$984$reason$$);if($APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6409$invalid_token_already_member$$,$code$jscomp$64$$))return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$cljs$cst$2533$dashboard_recent$$,new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$1944$team_id$$,$team_id$jscomp$186$$],null)));if($APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6410$org_not_found$$,
$code$jscomp$64$$))return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$02$$($APP.$cljs$cst$2533$dashboard_recent$$,new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$1944$team_id$$,$team_id$jscomp$186$$],null)),$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$data$notifications$error$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.org-not-found"))]));if($APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$cst$2261$validation$$,
$cause$jscomp$116_type$jscomp$728$$)||$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6411$invalid_token$$,$code$jscomp$64$$)||$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6412$token_expired$$,$map__83420__$1_reason$jscomp$30$$))return $APP.$cljs$core$reset_BANG_$$($bad_token_reason$$,$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6412$token_expired$$,$map__83420__$1_reason$jscomp$30$$)?$cljs$cst$6412$token_expired$$:$APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6413$email_mismatch$$,
$map__83420__$1_reason$jscomp$30$$)?$cljs$cst$6413$email_mismatch$$:$cljs$cst$6411$invalid_token$$);if($APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($APP.$cljs$cst$5493$email_already_exists$$,$code$jscomp$64$$)){var $msg$jscomp$50$$=$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.email-already-exists");$APP.$app$util$timers$schedule$cljs$0core$0IFn$0_invoke$0arity$02$$(100,function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$error$$($msg$jscomp$50$$))})}else $APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6414$email_already_validated$$,
$code$jscomp$64$$)?($msg$jscomp$50$$=$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.email-already-validated"),$APP.$app$util$timers$schedule$cljs$0core$0IFn$0_invoke$0arity$02$$(100,function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$warn$cljs$0core$0IFn$0_invoke$0arity$02$$($msg$jscomp$50$$))})):($msg$jscomp$50$$=$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.generic"),$APP.$app$util$timers$schedule$cljs$0core$0IFn$0_invoke$0arity$02$$(100,
function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$error$$($msg$jscomp$50$$))}));return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$3410$auth_login$$))},$APP.$app$main$repo$cmd_BANG_$$.$cljs$core$IFn$_invoke$arity$2$($cljs$cst$6415$verify_token$$,new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$1136$token$$,$token$jscomp$214$$],
null)))});return $APP.$cljs$core$truth_$$($APP.$cljs$core$_deref$$($bad_token_reason$$))?(0,$APP.$rumext$v2$jsx$$)($app$main$ui$static$0$invalid_token$$,{reason:$APP.$cljs$core$_deref$$($bad_token_reason$$)}):$APP.$rumext$v2$jsx$$($APP.$app$main$ui$ds$product$loader$loader_STAR_$$,{title:$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("labels.loading"),overlay:!0})};
$APP.$app$main$ui$auth$verify_token$verify_token_page_STAR_$$=function($props_83422$$){return(0,$APP.$rumext$v2$create_element$$)($app$main$ui$auth$verify_token$verify_token_STAR_$$,$props_83422$$)};$cljs$cst$6402$iss$$=new $APP.$cljs$core$Keyword$$(null,"iss","iss",1130086696);$cljs$cst$6407$org_team_id$$=new $APP.$cljs$core$Keyword$$(null,"org-team-id","org-team-id",1556726570);$cljs$cst$6411$invalid_token$$=new $APP.$cljs$core$Keyword$$(null,"invalid-token","invalid-token",2042664034);
$cljs$cst$6410$org_not_found$$=new $APP.$cljs$core$Keyword$$(null,"org-not-found","org-not-found",-1609825269);$cljs$cst$6403$verify_email$$=new $APP.$cljs$core$Keyword$$(null,"verify-email","verify-email",464870696);$cljs$cst$6405$auth$$=new $APP.$cljs$core$Keyword$$(null,"auth","auth",1389754926);$cljs$cst$6414$email_already_validated$$=new $APP.$cljs$core$Keyword$$(null,"email-already-validated","email-already-validated",-1757263672);
$cljs$cst$6413$email_mismatch$$=new $APP.$cljs$core$Keyword$$(null,"email-mismatch","email-mismatch",-961790449);$cljs$cst$6406$team_invitation$$=new $APP.$cljs$core$Keyword$$(null,"team-invitation","team-invitation",672622666);$cljs$cst$6415$verify_token$$=new $APP.$cljs$core$Keyword$$(null,"verify-token","verify-token",1740891189);$cljs$cst$6412$token_expired$$=new $APP.$cljs$core$Keyword$$(null,"token-expired","token-expired",-312857642);
$cljs$cst$6408$redirect_to$$=new $APP.$cljs$core$Keyword$$(null,"redirect-to","redirect-to",-1381988340);$cljs$cst$6409$invalid_token_already_member$$=new $APP.$cljs$core$Keyword$$(null,"invalid-token-already-member","invalid-token-already-member",-320000205);$cljs$cst$6401$register_validate_page$$=new $APP.$cljs$core$Keyword$$(null,"register-validate-page","register-validate-page",2093054747);var $app$main$ui$auth$recovery$schema_COLON_recovery_form$$=new $APP.$cljs$core$PersistentVector$$(null,3,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$429$and$$,new $APP.$cljs$core$PersistentVector$$(null,5,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$202$map$$,new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$939$title$$,"RecoveryForm"],null),new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$1136$token$$,
$APP.$cljs$cst$972$app_DOT_common_DOT_schema_SLASH_text$$],null),new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$3239$password_1$$,$APP.$cljs$cst$973$app_DOT_common_DOT_schema_SLASH_password$$],null),new $APP.$cljs$core$PersistentVector$$(null,2,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$3240$password_2$$,$APP.$cljs$cst$973$app_DOT_common_DOT_schema_SLASH_password$$],null)],null),new $APP.$cljs$core$PersistentVector$$(null,
3,5,$APP.$cljs$core$PersistentVector$EMPTY_NODE$$,[$APP.$cljs$cst$516$fn$$,new $APP.$cljs$core$PersistentArrayMap$$(null,2,[$APP.$cljs$cst$945$error_SLASH_code$$,"errors.password-invalid-confirmation",$APP.$cljs$cst$3441$error_SLASH_field$$,$APP.$cljs$cst$3240$password_2$$],null),function($p__83362_password_1$$){var $map__83363__$1_password_2$$=$APP.$cljs$core$__destructure_map$$($p__83362_password_1$$);$p__83362_password_1$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83363__$1_password_2$$,
$APP.$cljs$cst$3239$password_1$$);$map__83363__$1_password_2$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83363__$1_password_2$$,$APP.$cljs$cst$3240$password_2$$);return $APP.$cljs$core$_EQ_$$.$cljs$core$IFn$_invoke$arity$2$($p__83362_password_1$$,$map__83363__$1_password_2$$)}],null)],null);var $app$main$ui$auth$verify_token$handle_token$$=function(){var $method_table__5622__auto__$jscomp$24$$=$APP.$cljs$core$atom$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$core$PersistentArrayMap$EMPTY$$),$prefer_table__5623__auto__$jscomp$24$$=$APP.$cljs$core$atom$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$core$PersistentArrayMap$EMPTY$$),$method_cache__5624__auto__$jscomp$24$$=$APP.$cljs$core$atom$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$core$PersistentArrayMap$EMPTY$$),$cached_hierarchy__5625__auto__$jscomp$24$$=
$APP.$cljs$core$atom$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$core$PersistentArrayMap$EMPTY$$),$hierarchy__5626__auto__$jscomp$24$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$3$($APP.$cljs$core$PersistentArrayMap$EMPTY$$,$APP.$cljs$cst$204$hierarchy$$,$APP.$cljs$core$get_global_hierarchy$$.$cljs$core$IFn$_invoke$arity$0$?$APP.$cljs$core$get_global_hierarchy$$.$cljs$core$IFn$_invoke$arity$0$():$APP.$cljs$core$get_global_hierarchy$$());return new $APP.$cljs$core$MultiFn$$($APP.$cljs$core$symbol$$.$cljs$core$IFn$_invoke$arity$2$("app.main.ui.auth.verify-token",
"handle-token"),function($token$jscomp$213$$){return $cljs$cst$6402$iss$$.$cljs$core$IFn$_invoke$arity$1$($token$jscomp$213$$)},$APP.$cljs$cst$205$default$$,$hierarchy__5626__auto__$jscomp$24$$,$method_table__5622__auto__$jscomp$24$$,$prefer_table__5623__auto__$jscomp$24$$,$method_cache__5624__auto__$jscomp$24$$,$cached_hierarchy__5625__auto__$jscomp$24$$)}();
$app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IMultiFn$_add_method$arity$3$(null,$cljs$cst$6403$verify_email$$,function($data$jscomp$512$$){$app$config$external_notify_register_success$$($APP.$cljs$cst$2321$profile_id$$.$cljs$core$IFn$_invoke$arity$1$($data$jscomp$512$$));var $msg$jscomp$48$$=$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("dashboard.notifications.email-verified-successfully");$APP.$app$util$timers$schedule$cljs$0core$0IFn$0_invoke$0arity$02$$(1E3,function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$success$cljs$0core$0IFn$0_invoke$0arity$02$$($msg$jscomp$48$$))});
return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($app$main$data$auth$login_from_token$$($data$jscomp$512$$))});
$app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IMultiFn$_add_method$arity$3$(null,$APP.$cljs$cst$6404$change_email$$,function(){var $msg$jscomp$49$$=$APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("dashboard.notifications.email-changed-successfully");$APP.$app$util$timers$schedule$cljs$0core$0IFn$0_invoke$0arity$02$$(100,function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$data$notifications$success$cljs$0core$0IFn$0_invoke$0arity$02$$($msg$jscomp$49$$))});return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$5477$settings_profile$$),
$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$data$profile$refresh_profile$$()]))});$app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IMultiFn$_add_method$arity$3$(null,$cljs$cst$6405$auth$$,function($tdata$jscomp$2$$){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($app$main$data$auth$login_from_token$$($tdata$jscomp$2$$))});
$app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IMultiFn$_add_method$arity$3$(null,$cljs$cst$6406$team_invitation$$,function($invitation_token$jscomp$4_p__83413$$){var $map__83414__$1_route_id$jscomp$1$$=$APP.$cljs$core$__destructure_map$$($invitation_token$jscomp$4_p__83413$$),$G__83415__$1_state$jscomp$1255$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,$APP.$cljs$cst$769$state$$),$team_id$jscomp$185$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,
$APP.$cljs$cst$1944$team_id$$),$org_team_id$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,$cljs$cst$6407$org_team_id$$),$organization_name$jscomp$7$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,$APP.$cljs$cst$3302$organization_name$$);$invitation_token$jscomp$4_p__83413$$=$APP.$cljs$core$get$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,$APP.$cljs$cst$1134$invitation_token$$);$G__83415__$1_state$jscomp$1255$$=
$G__83415__$1_state$jscomp$1255$$ instanceof $APP.$cljs$core$Keyword$$?$G__83415__$1_state$jscomp$1255$$.$fqn$:null;switch($G__83415__$1_state$jscomp$1255$$){case "created":return $APP.$cljs$core$truth_$$($org_team_id$$)?$APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$data$profile$refresh_profile$$(),$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$data$common$go_to_dashboard_recent$cljs$0core$0IFn$0_invoke$0arity$0variadic$$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$cst$1944$team_id$$,
$org_team_id$$])),$APP.$app$main$data$notifications$success$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$variadic$("auth.notifications.org-invitation-accepted",$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$organization_name$jscomp$7$$])))])):$APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$data$profile$refresh_profile$$(),$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$data$common$go_to_dashboard_recent$cljs$0core$0IFn$0_invoke$0arity$0variadic$$($APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$cljs$cst$1944$team_id$$,
$team_id$jscomp$185$$])),$APP.$app$main$data$notifications$success$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("auth.notifications.team-invitation-accepted"))]));case "pending":return $map__83414__$1_route_id$jscomp$1$$=$cljs$cst$6408$redirect_to$$.$cljs$core$IFn$_invoke$arity$2$($map__83414__$1_route_id$jscomp$1$$,$APP.$cljs$cst$5486$auth_register$$),$APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$1$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$02$$($map__83414__$1_route_id$jscomp$1$$,
new $APP.$cljs$core$PersistentArrayMap$$(null,1,[$APP.$cljs$cst$1134$invitation_token$$,$invitation_token$jscomp$4_p__83413$$],null)));default:throw Error(["No matching clause: ",$APP.$cljs$core$str$$.$cljs$core$IFn$_invoke$arity$1$($G__83415__$1_state$jscomp$1255$$)].join(""));}});
$app$main$ui$auth$verify_token$handle_token$$.$cljs$core$IMultiFn$_add_method$arity$3$(null,$APP.$cljs$cst$205$default$$,function(){return $APP.$app$main$store$emit_BANG_$$.$cljs$core$IFn$_invoke$arity$variadic$($APP.$app$main$router$nav$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$cljs$cst$3410$auth_login$$),$APP.$cljs$core$prim_seq$cljs$0core$0IFn$0_invoke$0arity$02$$([$APP.$app$main$data$notifications$warn$cljs$0core$0IFn$0_invoke$0arity$01$$($APP.$app$util$i18n$tr$$.$cljs$core$IFn$_invoke$arity$1$("errors.unexpected-token"))]))});
//# sourceMappingURL=main-auth.js.map
