@frontegg/js 6.185.0-alpha.0 → 6.185.0-alpha.2

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see frontegg.production.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Frontegg=t():e.Frontegg=t()}(window,(()=>(()=>{var e={6987:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConditionEvaluator=void 0;const a=n(3651),i=n(9082);t.createConditionEvaluator=function(e){const t=(0,i.useSanitizer)(e.condition.op);if(!t)return()=>!1;const{isSanitized:n,sanitizedValue:o}=t(e.condition.value);if(!n||void 0===o)return()=>!1;const r=(0,a.useOperation)(e.condition.op,o);return t=>{const n=t[e.condition.attribute];if(void 0===n||!r)return!1;const{isValid:a}=r(n);return e.condition.negate?!a:a}}},2898:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6987),t),i(n(7371),t)},7371:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3840:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFeatureFlag=void 0;const a=n(2380);t.evaluateFeatureFlag=function(e,t){if(!e.on)return{treatment:e.offTreatment};const n=function(e,t){var n;return null===(n=e.rules)||void 0===n?void 0:n.find((e=>(0,a.createRuleEvaluator)({rule:e})(t)===a.RuleEvaluationResultEnum.Treatable))}(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}},6095:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3840),t)},9314:(e,t,n)=>{"use strict";t.wJ=t.tE=void 0;n(6095),n(521),n(2380),n(2379);var a=n(5535);Object.defineProperty(t,"tE",{enumerable:!0,get:function(){return a.evaluateIsEntitledToFeature}}),Object.defineProperty(t,"wJ",{enumerable:!0,get:function(){return a.evaluateIsEntitledToPermissions}})},195:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanOperationsMapper=void 0;const o=n(2379),r=n(6610);i(n(6610),t),i(n(7226),t),t.BooleanOperationsMapper={[o.OperationEnum.Is]:e=>(0,r.useIsOperation)(e)}},6610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useIsOperation=void 0,t.useIsOperation=function(e){return t=>({isValid:t===e.boolean})}},7226:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizersMapper=t.singleBooleanSanitizer=void 0;const a=n(2379);t.singleBooleanSanitizer=e=>{const t=void 0!==e.boolean&&(e=>"boolean"==typeof e)(e.boolean)?{boolean:e.boolean}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.BooleanSanitizersMapper={[a.OperationEnum.Is]:t.singleBooleanSanitizer}},3651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOperation=void 0;const a=n(5943),i=n(1610),o=n(9004),r=n(195),s={...a.StringOperationsMapper,...i.NumericOperationsMapper,...o.DateOperationsMapper,...r.BooleanOperationsMapper};t.useOperation=function(e,t){const n=s[e];return n?n(t):void 0}},9082:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSanitizer=void 0;const a=n(195),i=n(2903),o=n(6886),r=n(1610),s={...i.StringSanitizersMapper,...r.NumericSanitizersMapper,...o.DateSanitizersMapper,...a.BooleanSanitizersMapper};t.useSanitizer=function(e){return s[e]}},9004:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateOperationsMapper=void 0;const o=n(2379),r=n(4569);i(n(4569),t),i(n(5931),t),t.DateOperationsMapper={[o.OperationEnum.On]:e=>(0,r.useDateOnOperation)(e),[o.OperationEnum.OnOrAfter]:e=>(0,r.useDateOnOrAfterOperation)(e),[o.OperationEnum.OnOrBefore]:e=>(0,r.useDateOnOrBeforeOperation)(e),[o.OperationEnum.BetweenDate]:e=>(0,r.useDateBetweenOperation)(e)}},4569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDateBetweenOperation=t.useDateOnOrBeforeOperation=t.useDateOnOrAfterOperation=t.useDateOnOperation=void 0,t.useDateOnOperation=function(e){return t=>({isValid:t.getTime()===e.date.getTime()})},t.useDateOnOrAfterOperation=function(e){return t=>({isValid:t.getTime()>=e.date.getTime()})},t.useDateOnOrBeforeOperation=function(e){return t=>({isValid:t.getTime()<=e.date.getTime()})},t.useDateBetweenOperation=function(e){return t=>({isValid:t.getTime()>=e.start.getTime()&&t.getTime()<=e.end.getTime()})}},6886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateSanitizersMapper=t.sanitizeDateRange=t.sanitizeSingleDate=t.isValidDate=t.sanitizeDateValue=void 0;const a=n(2379);t.sanitizeDateValue=e=>new Date(e),t.isValidDate=e=>e instanceof Date&&!isNaN(e),t.sanitizeSingleDate=e=>{const n=e.date?(0,t.sanitizeDateValue)(e.date):void 0,a=n&&(0,t.isValidDate)(n)?{date:n}:void 0;return{isSanitized:!!a,sanitizedValue:a}},t.sanitizeDateRange=e=>{const n=e.start?(0,t.sanitizeDateValue)(e.start):void 0,a=e.end?(0,t.sanitizeDateValue)(e.end):void 0,i=n&&a&&(0,t.isValidDate)(n)&&(0,t.isValidDate)(a)?{start:n,end:a}:void 0;return{isSanitized:!!i,sanitizedValue:i}},t.DateSanitizersMapper={[a.OperationEnum.On]:t.sanitizeSingleDate,[a.OperationEnum.OnOrAfter]:t.sanitizeSingleDate,[a.OperationEnum.OnOrBefore]:t.sanitizeSingleDate,[a.OperationEnum.BetweenDate]:t.sanitizeDateRange}},5931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1610:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.NumericOperationsMapper=void 0;const o=n(2379),r=n(9217);t.NumericOperationsMapper={[o.OperationEnum.Equal]:e=>(0,r.useEqualsOperation)(e),[o.OperationEnum.GreaterThan]:e=>(0,r.useGreaterThanOperation)(e),[o.OperationEnum.GreaterThanEqual]:e=>(0,r.useGreaterThanEqualOperation)(e),[o.OperationEnum.LesserThan]:e=>(0,r.useLesserThanOperation)(e),[o.OperationEnum.LesserThanEqual]:e=>(0,r.useLesserThanEqualOperation)(e),[o.OperationEnum.BetweenNumeric]:e=>(0,r.useBetweenNumericOperation)(e)},i(n(9217),t),i(n(9326),t),i(n(1764),t)},9217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useBetweenNumericOperation=t.useLesserThanEqualOperation=t.useLesserThanOperation=t.useGreaterThanEqualOperation=t.useGreaterThanOperation=t.useEqualsOperation=void 0,t.useEqualsOperation=function(e){return t=>({isValid:t===e.number})},t.useGreaterThanOperation=function(e){return t=>({isValid:t>e.number})},t.useGreaterThanEqualOperation=function(e){return t=>({isValid:t>=e.number})},t.useLesserThanOperation=function(e){return t=>({isValid:t<e.number})},t.useLesserThanEqualOperation=function(e){return t=>({isValid:t<=e.number})},t.useBetweenNumericOperation=function(e){return t=>({isValid:t>=e.start&&t<=e.end})}},9326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumericSanitizersMapper=t.sanitizeNumericRange=t.sanitizeSingleNumber=void 0;const a=n(2379),i=e=>"number"==typeof e;t.sanitizeSingleNumber=e=>{const t=void 0!==e.number&&i(e.number)?{number:e.number}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.sanitizeNumericRange=e=>{const t=void 0!==e.start&&void 0!==e.end&&i(e.start)&&i(e.end)?{start:e.start,end:e.end}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.NumericSanitizersMapper={[a.OperationEnum.Equal]:t.sanitizeSingleNumber,[a.OperationEnum.GreaterThan]:t.sanitizeSingleNumber,[a.OperationEnum.GreaterThanEqual]:t.sanitizeSingleNumber,[a.OperationEnum.LesserThan]:t.sanitizeSingleNumber,[a.OperationEnum.LesserThanEqual]:t.sanitizeSingleNumber,[a.OperationEnum.BetweenNumeric]:t.sanitizeNumericRange}},1764:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5943:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.StringOperationsMapper=void 0;const o=n(2379),r=n(2431);i(n(2431),t),i(n(2097),t),t.StringOperationsMapper={[o.OperationEnum.StartsWith]:e=>(0,r.useStartsWithOperation)(e),[o.OperationEnum.EndsWith]:e=>(0,r.useEndsWithOperation)(e),[o.OperationEnum.Contains]:e=>(0,r.useContainsOperation)(e),[o.OperationEnum.InList]:e=>(0,r.useInListOperation)(e),[o.OperationEnum.Matches]:e=>(0,r.useMatchesOperation)(e)}},2431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useMatchesOperation=t.useInListOperation=t.useContainsOperation=t.useEndsWithOperation=t.useStartsWithOperation=void 0,t.useStartsWithOperation=function(e){return t=>({isValid:e.list.some((e=>t.startsWith(e)))})},t.useEndsWithOperation=function(e){return t=>({isValid:e.list.some((e=>t.endsWith(e)))})},t.useContainsOperation=function(e){return t=>({isValid:e.list.some((e=>t.includes(e)))})},t.useInListOperation=function(e){return t=>({isValid:e.list.includes(t)})},t.useMatchesOperation=function(e){return t=>{let n;try{n=new RegExp(e.string)}catch(e){return{isValid:!1}}return{isValid:n.test(t)}}}},2903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringSanitizersMapper=t.sanitizeListString=t.sanitizeSingleString=void 0;const a=n(2379),i=e=>"string"==typeof e;t.sanitizeSingleString=e=>{const t=void 0!==e.string&&i(e.string)?{string:e.string}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.sanitizeListString=e=>{const t=void 0!==e.list&&e.list.every((e=>i(e)))?{list:e.list}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.StringSanitizersMapper={[a.OperationEnum.Matches]:t.sanitizeSingleString,[a.OperationEnum.Contains]:t.sanitizeListString,[a.OperationEnum.StartsWith]:t.sanitizeListString,[a.OperationEnum.EndsWith]:t.sanitizeListString,[a.OperationEnum.InList]:t.sanitizeListString}},2097:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2379:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3982),t)},3982:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.OperationEnum=void 0,(n=t.OperationEnum||(t.OperationEnum={})).InList="in_list",n.StartsWith="starts_with",n.EndsWith="ends_with",n.Contains="contains",n.Matches="matches",n.Equal="equal",n.GreaterThan="greater_than",n.GreaterThanEqual="greater_than_equal",n.LesserThan="lower_than",n.LesserThanEqual="lower_than_equal",n.BetweenNumeric="between_numeric",n.Is="is",n.On="on",n.BetweenDate="between_date",n.OnOrAfter="on_or_after",n.OnOrBefore="on_or_before"},521:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3603),t)},3603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluatePlan=void 0;const a=n(2380);t.evaluatePlan=function(e,t){const n=function(e,t){var n;return null===(n=e.rules)||void 0===n?void 0:n.find((e=>(0,a.createRuleEvaluator)({rule:e})(t)===a.RuleEvaluationResultEnum.Treatable))}(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}},2380:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2930),t),i(n(1304),t)},1304:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuleEvaluator=void 0;const a=n(2930),i=n(2898);t.createRuleEvaluator=function(e){return t=>e.rule.conditions.every((e=>(0,i.createConditionEvaluator)({condition:e})(t)))?a.RuleEvaluationResultEnum.Treatable:a.RuleEvaluationResultEnum.Insufficient}},2930:(e,t)=>{"use strict";var n,a;Object.defineProperty(t,"__esModule",{value:!0}),t.RuleEvaluationResultEnum=t.TreatmentEnum=t.ConditionLogicEnum=void 0,(t.ConditionLogicEnum||(t.ConditionLogicEnum={})).And="and",(a=t.TreatmentEnum||(t.TreatmentEnum={})).True="true",a.False="false",(n=t.RuleEvaluationResultEnum||(t.RuleEvaluationResultEnum={})).Treatable="treatable",n.Insufficient="insufficient"},5535:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3779),t),i(n(1038),t),i(n(5113),t),i(n(4848),t)},5640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directEntitlementEvalutor=void 0;const a=n(5113);t.directEntitlementEvalutor=function(e,t,n={}){const i=t.features[e];let o=!1;return i&&null!==i.expireTime&&(o=i.expireTime!==a.NO_EXPIRATION_TIME&&i.expireTime<Date.now(),!o)?{isEntitled:!0}:{isEntitled:!1,justification:o?a.NotEntitledJustification.BUNDLE_EXPIRED:a.NotEntitledJustification.MISSING_FEATURE}}},9838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.featureFlagEvaluator=void 0;const a=n(5113),i=n(6095),o=n(4668),r=n(2380);t.featureFlagEvaluator=function(e,t,n={}){const s=t.features[e];if(s&&s.featureFlag){const e=(0,o.prepareAttributes)(n),{treatment:t}=(0,i.evaluateFeatureFlag)(s.featureFlag,e);if(t===r.TreatmentEnum.True)return{isEntitled:!0}}return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE}}},4529:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIsEntitledEvaluators=void 0;const a=n(5640),i=n(9838),o=n(3751);t.getIsEntitledEvaluators=function(){return[a.directEntitlementEvalutor,i.featureFlagEvaluator,o.planTargetingRulesEvalutor]}},3751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planTargetingRulesEvalutor=void 0;const a=n(5113),i=n(4668),o=n(2380),r=n(521);t.planTargetingRulesEvalutor=function(e,t,n={}){const s=t.features[e];if(s&&s.planIds&&s.planIds.length>0){const e=(0,i.prepareAttributes)(n),a=t.plans;for(const t of s.planIds){const n=a[t];if(n){const{treatment:t}=(0,r.evaluatePlan)(n,e);if(t===o.TreatmentEnum.True)return{isEntitled:!0}}}}return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE}}},3779:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7850),t)},7850:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateIsEntitledToFeature=void 0;const a=n(5113),i=n(4848),o=n(4529);t.evaluateIsEntitledToFeature=function(e,t,n={}){if(!t)return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE};const r=[];for(const a of(0,o.getIsEntitledEvaluators)())if(r.push(a(e,t,n)),!(0,i.shouldContinue)(r))break;return(0,i.getResult)(r)}},1038:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(519),t)},519:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateIsEntitledToPermissions=void 0;const a=n(7850),i=n(5113),o=n(4848),r=n(4852);t.evaluateIsEntitledToPermissions=function(e,t,n){if(!t)return{isEntitled:!1,justification:i.NotEntitledJustification.MISSING_PERMISSION};if(!(0,r.checkPermission)(t.permissions,e))return{isEntitled:!1,justification:i.NotEntitledJustification.MISSING_PERMISSION};const s=function(e,t){return Object.keys(t.features).filter((n=>t.features[n].linkedPermissions.includes(e)))}(e,t);if(!s.length)return{isEntitled:!0};const l=[];for(const e of s)if(l.push((0,a.evaluateIsEntitledToFeature)(e,t,n)),!(0,o.shouldContinue)(l))break;return(0,o.getResult)(l)}},5113:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NO_EXPIRATION_TIME=t.NotEntitledJustification=void 0,(n=t.NotEntitledJustification||(t.NotEntitledJustification={})).MISSING_FEATURE="MISSING_FEATURE",n.MISSING_PERMISSION="MISSING_PERMISSION",n.BUNDLE_EXPIRED="BUNDLE_EXPIRED",t.NO_EXPIRATION_TIME=-1},4668:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modifyObjectKeysWithPrefix=t.defaultFronteggAttributesMapper=t.prepareAttributes=void 0;const a=n(193);function i(e){return{email:e.email,emailVerified:e.email_verified,tenantId:e.tenantId,userId:e.id}}function o(e,t){return Object.keys(e).reduce(((n,a)=>(n[`${t}${a}`]=e[a],n)),{})}t.prepareAttributes=function(e={},t){const{custom:n={},jwt:r={}}=e,s=(0,a.flatten)(r);return{...n,...o(t?t(r):i(r),"frontegg."),...o(s,"jwt.")}},t.defaultFronteggAttributesMapper=i,t.modifyObjectKeysWithPrefix=o},1882:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldContinue=t.getResult=void 0;const a=n(5113);t.getResult=function(e){let t=!1;for(const n of e){if(n.isEntitled)return n;n.justification===a.NotEntitledJustification.BUNDLE_EXPIRED&&(t=!0)}return{isEntitled:!1,justification:t?a.NotEntitledJustification.BUNDLE_EXPIRED:a.NotEntitledJustification.MISSING_FEATURE}},t.shouldContinue=function(e){return e.every((({isEntitled:e})=>!e))}},193:(e,t)=>{"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.flatten=void 0,t.flatten=function(e,t){const a=(null==(t=t||{})?void 0:t.delimiter)||".",i=null==t?void 0:t.maxDepth,o=(null==t?void 0:t.transformKey)||n,r={};return function e(n,s,l){l=l||1,Object.keys(n).forEach((function(c){const d=n[c],u=(null==t?void 0:t.safe)&&Array.isArray(d),y=Object.prototype.toString.call(d),f=(p=d)&&p.constructor&&"function"==typeof p.constructor.isBuffer&&p.constructor.isBuffer(p);var p;const g="[object Object]"===y||"[object Array]"===y,S=s?s+a+o(c):o(c);if(!u&&!f&&g&&Object.keys(d).length&&(!(null==t?void 0:t.maxDepth)||i&&l<i))return e(d,S,l+1);r[S]=d}))}(e),r}},4848:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4852),t),i(n(4668),t),i(n(1882),t)},4852:(e,t)=>{"use strict";function n(e){return new RegExp("^"+e.replace(/\./g,"\\.").replace(/\*/g,".*")+"$","gs")}Object.defineProperty(t,"__esModule",{value:!0}),t.createPermissionCheckRegex=t.checkPermission=void 0,t.checkPermission=function(e,t){return Object.keys(e).some((e=>n(e).test(t)))},t.createPermissionCheckRegex=n},9714:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function r(e,t){try{return t in e}catch(e){return!1}}function s(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=a;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=a(e[t],n)})),o(t).forEach((function(o){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(r(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,n)(e[o],t[o],n):i[o]=a(t[o],n))})),i}(e,n,l):a(n,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var l=s;e.exports=l},9378:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var a,i,o;if(Array.isArray(t)){if((a=t.length)!=n.length)return!1;for(i=a;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((a=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=a;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=a;0!=i--;){var r=o[i];if(!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}},7609:(e,t,n)=>{var a=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function y(e,t,n,a){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new _(a||[]);return r(o,"_invoke",{value:k(e,n,s)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var p={};function g(){}function S(){}function v(){}var h={};u(h,l,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(L([])));b&&b!==n&&o.call(b,l)&&(h=b);var A=v.prototype=g.prototype=Object.create(h);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,r,s,l){var c=f(e[i],e,r);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==a(u)&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var i;r(this,"_invoke",{value:function(e,a){function o(){return new t((function(t,i){n(e,a,t,i)}))}return i=i?i.then(o,o):o()}})}function k(e,t,n){var a="suspendedStart";return function(i,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var r=n.delegate;if(r){var s=I(r,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var l=f(e,t,n);if("normal"===l.type){if(a=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a="completed",n.method="throw",n.arg=l.arg)}}}function I(e,t){var n=t.method,a=e.iterator[n];if(void 0===a)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(a,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:w}}function w(){return{value:void 0,done:!0}}return S.prototype=v,r(A,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:S,configurable:!0}),S.displayName=u(v,d,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,d,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},T(E.prototype),u(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,a,i,o){void 0===o&&(o=Promise);var r=new E(y(e,n,a,i),o);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},T(A),u(A,d,"Generator"),u(A,l,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},t.values=L,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,a){return r.type="throw",r.arg=e,t.next=n,a&&(t.method="next",t.arg=void 0),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],r=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&o.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var r=i?i.completion:{};return r.type=e,r.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var i=a.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var a=n(7609)();e.exports=a;try{regeneratorRuntime=a}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{AdminPortal:()=>yw,AdminPortalRenderer:()=>gw,AppHolder:()=>D,CheckoutDialog:()=>fw,FronteggApp:()=>dw,HostedLogin:()=>uw,LoginBoxRenderer:()=>hw,createElement:()=>zL,defaultTheme:()=>Sw,formatName:()=>WL,getThemeAdminByName:()=>pw,getThemeByName:()=>vw,initialize:()=>Pw,mockFlagsList:()=>cw,restoreSearchParams:()=>HL,waitThemeSetter:()=>KL});var e={};n.r(e),n.d(e,{Delete:()=>Nr,Get:()=>Dr,Patch:()=>Rr,Post:()=>Ur,PostDownload:()=>Mr,Put:()=>Cr,extractHeadersFromOptions:()=>Fr,getBaseUrl:()=>Pr,getMetadataHeaders:()=>_r,getScopedTenant:()=>Lr});var t={};n.r(t),n.d(t,{FeatureFlags:()=>Vr,loadFeatureFlags:()=>jr});var i={};n.r(i),n.d(i,{GetUserJwt:()=>Br,getCurrentUserTenantsV1:()=>Jr,getCurrentUserTenantsV3:()=>qr,getUsersGroups:()=>Hr,getUsersRoles:()=>Kr,getUsersV2:()=>Wr,getUsersV3:()=>zr,sendResetBreachedPasswordEmails:()=>Yr,updateUserProfileV2:()=>Xr});var o={};n.r(o),n.d(o,{getHierarchyMetadata:()=>ds,getParentTenants:()=>rs,getParentTenantsById:()=>ss,getSubTenants:()=>is,getSubTenantsAsTree:()=>os,getTenants:()=>as,getTenantsUsersCount:()=>ls,searchSubTenants:()=>cs,switchTenant:()=>ns});var r={};n.r(r),n.d(r,{loadEntitlements:()=>Ws,loadEntitlementsV2:()=>zs});var s={};n.r(s),n.d(s,{AuthStrategyEnum:()=>Ea,MachineToMachineAuthStrategy:()=>ka,OAuthLogout:()=>Tl,SocialLoginProviders:()=>Ta,acceptInvitation:()=>vl,activateAccount:()=>yl,activateAccountV2:()=>fl,bulkCreateIPRestriction:()=>Ds,changePhoneNumber:()=>Id,changePhoneNumberWithVerification:()=>Ed,checkIfAllowToRememberMfaDevice:()=>Hc,createDomainRestriction:()=>Is,createIPRestriction:()=>ws,createOrUpdateSessionConfigrations:()=>Dc,createSSOConfiguration:()=>Zc,createSSOConfigurationByMetadata:()=>nd,createSSOConfigurationByMetadataUrl:()=>id,createSSODomain:()=>rd,createSSOGroup:()=>ud,createSamlGroup:()=>gc,createTenantAccessToken:()=>$c,createUserAccessToken:()=>Gc,deleteAllSessionsForUser:()=>Rc,deleteDomainRestriction:()=>Ps,deleteIPRestriction:()=>Rs,deleteSSOConfiguration:()=>td,deleteSSODomain:()=>sd,deleteSSOGroup:()=>fd,deleteSamlGroup:()=>vc,deleteSessionForUser:()=>Uc,deleteTenantAccessToken:()=>Mc,deleteTenantApiToken:()=>Wc,deleteUserAccessToken:()=>Fc,deleteUserApiToken:()=>zc,deleteWebAuthnDevice:()=>Dd,disableMFAAuthenticatorApp:()=>Ml,disableMFASMS:()=>Gl,disableMFAWebAuthn:()=>xl,disableMfa:()=>Nl,enrollMFAAuthenticatorApp:()=>Ll,enrollMFAAuthenticatorAppForLogin:()=>Bl,enrollMFAAuthenticatorAppForLoginV2:()=>Wl,enrollMFASMS:()=>Dl,enrollMFASMSForLogin:()=>Yl,enrollMFASMSForLoginV2:()=>Xl,enrollMFAWebAuthn:()=>Rl,enrollMFAWebAuthnForLogin:()=>nc,enrollMFAWebAuthnForLoginV2:()=>ac,enrollMfa:()=>Pl,exchangeOAuthTokens:()=>md,exchangeOAuthTokensV2:()=>vd,forgotPassword:()=>El,generateLoginResponse:()=>Xs,generateLoginResponseFromOAuthResponse:()=>nl,generateLoginResponseFromOAuthResponseV2:()=>al,generateLoginResponseV2:()=>Qs,generateLoginResponseV3:()=>tl,generateStepupSession:()=>xd,getActivateAccountStrategy:()=>pl,getCaptchaPolicy:()=>hs,getCurrentUserSession:()=>_c,getCurrentUserSessions:()=>Pc,getCurrentUserTenantsFunction:()=>ts,getCustomSocialLoginProvidersV1:()=>Ec,getDomainRestrictions:()=>Es,getDomainRestrictionsConfig:()=>ks,getGlobalSecurityPolicy:()=>us,getIPRestrictions:()=>_s,getIPRestrictionsConfig:()=>Ls,getLockoutPolicy:()=>gs,getMFADevices:()=>Vl,getMFAStrategiesConfig:()=>Nd,getMeAndEntitlements:()=>$d,getMeV2:()=>Fd,getMfaPolicy:()=>ys,getOidcConfiguration:()=>hc,getPasswordConfigPolicy:()=>Ts,getPasswordHistoryPolicy:()=>ms,getPublicAuthStrategiesConfigForAuthenticatedUser:()=>Cd,getSSOConfigurations:()=>Qc,getSSODefaultRoles:()=>cd,getSSOGroups:()=>pd,getSSOPublicConfiguration:()=>mc,getSamlConfiguration:()=>sc,getSamlRoles:()=>yc,getSamlRolesGroups:()=>fc,getSamlVendorConfiguration:()=>cc,getSessionConfigurations:()=>wc,getSocialLoginProviders:()=>bc,getSocialLoginProvidersV2:()=>Ac,getSocialLoginProvidersV2ForAuthenticatedUser:()=>Tc,getTabTenantFromSessionStorage:()=>es,getTenantAccessTokensData:()=>Nc,getTenantApiTokensData:()=>Vc,getUserAccessTokensData:()=>Cc,getUserApiTokensData:()=>xc,getUserAuthorization:()=>Md,getUserById:()=>Kc,getVendorConfig:()=>Ic,getVendorLockoutPolicy:()=>Ss,getVendorMfaPolicy:()=>fs,getVendorPasswordHistoryPolicy:()=>bs,getVendorPublicAuthStrategiesConfig:()=>Rd,getWebAuthnDevices:()=>wd,loadPasswordConfig:()=>Il,login:()=>ll,loginViaSocialLogin:()=>kc,loginWithMfa:()=>dl,loginWithMfaV2:()=>ul,loginv2:()=>cl,logout:()=>Al,oidcPostLogin:()=>sl,oidcPostLoginV2:()=>Sd,passwordlessPostLogin:()=>Yc,passwordlessPostLoginV2:()=>Jc,passwordlessPreLogin:()=>qc,postLogin:()=>rl,preDisableMFASMS:()=>Fl,preDisableMFAWebAuthn:()=>$l,preEnrollMFAAuthenticatorApp:()=>_l,preEnrollMFAAuthenticatorAppForLogin:()=>jl,preEnrollMFASMS:()=>wl,preEnrollMFASMSForLogin:()=>Jl,preEnrollMFAWebAuthn:()=>Ul,preEnrollMFAWebAuthnForLogin:()=>tc,preLogin:()=>il,preLoginV2:()=>gd,preLoginWithIdpType:()=>ol,preVerifyMFAEmailCode:()=>Kl,preVerifyMFASMSForLogin:()=>Ql,preVerifyMFAWebAuthnForLogin:()=>ic,recoverMfaToken:()=>Ol,refreshToken:()=>hl,refreshTokenV2:()=>ml,refreshTokenV3:()=>bl,removeTabTenantFromSessionStorage:()=>Zr,resendActivationEmail:()=>gl,resendInvitationEmail:()=>Sl,resetPassword:()=>kl,resetPhoneNumber:()=>Ad,revokeSessionsForUser:()=>Lc,saveLockoutPolicy:()=>vs,saveMfaPolicy:()=>ps,savePasswordHistoryPolicy:()=>As,setSSODefaultRoles:()=>dd,setTabTenantInSessionStorage:()=>Qr,signUpUser:()=>Oc,silentOAuthRefreshToken:()=>bd,silentOAuthRefreshTokenV2:()=>hd,testCurrentIp:()=>Cs,testCurrentIpInAllowList:()=>Ns,updateDomainRestrictionConfig:()=>Os,updateIPRestrictionConfig:()=>Us,updateSSOConfiguration:()=>ed,updateSSOConfigurationByMetadata:()=>ad,updateSSOConfigurationByMetadataUrl:()=>od,updateSSOGroup:()=>yd,updateSamlConfiguration:()=>lc,updateSamlGroup:()=>Sc,updateSamlRoles:()=>pc,updateSamlVendorMetadata:()=>dc,updateTenantApiTokensData:()=>Bc,updateUserApiTokensData:()=>jc,validateSSODomain:()=>ld,validateSamlDomain:()=>uc,verifyChangePhoneNumber:()=>kd,verifyInviteToken:()=>Xc,verifyMFAAuthenticatorAppForLogin:()=>zl,verifyMFAEmailCode:()=>Hl,verifyMFAEmailCodeV2:()=>ql,verifyMFASMSForLogin:()=>Zl,verifyMFASMSForLoginV2:()=>ec,verifyMFAWebAuthnForLogin:()=>oc,verifyMFAWebAuthnForLoginV2:()=>rc,verifyMfa:()=>Cl,verifyNewDeviceSession:()=>Ud,verifyResetPhoneNumber:()=>Td,webAuthnCreateNewDeviceSession:()=>Ld,webAuthnPostLogin:()=>Pd,webAuthnPostLoginV2:()=>_d,webAuthnPreLogin:()=>Od});var l={};n.r(l),n.d(l,{addUser:()=>Kd,changePassword:()=>Wd,createInviteUserLink:()=>Qd,deleteInviteUserLink:()=>eu,deleteUser:()=>Hd,getInviteLinkConfiguration:()=>nu,getInviteUserLink:()=>tu,getProfile:()=>Vd,getTemporaryUserConfiguration:()=>Xd,loadAvailablePermissions:()=>iu,loadAvailableRoles:()=>au,loadStats:()=>ou,loadUsers:()=>zd,resendActivationLink:()=>ru,resendInvitationLink:()=>su,resendInvitationLinkToAllTenants:()=>lu,setPermanentUser:()=>Yd,updateInviteUserLink:()=>Zd,updateProfile:()=>jd,updateProfileImage:()=>Bd,updateUser:()=>qd,updateUserExpirationTime:()=>Jd});var c={};n.r(c),n.d(c,{getAdminBoxMetadata:()=>du,getAuditsMetadata:()=>gu,getCurrentUserIpMetadata:()=>yu,getIpAdressMetadata:()=>Su,getNotificationsMetadata:()=>fu,getSamlMetadata:()=>pu,updateAdminBoxMetadata:()=>uu});var d={};n.r(d),n.d(d,{downloadReport:()=>ku,getReport:()=>Au,getReports:()=>bu,renderReport:()=>Tu,scheduleReport:()=>Eu,sendReport:()=>Iu});var u={};n.r(u),n.d(u,{getNotifications:()=>Ou,markAllAsRead:()=>Lu,updateNotificationIsPinned:()=>_u,updateNotificationStatus:()=>Pu});var y={};n.r(y),n.d(y,{exportAudits:()=>Ru,getAudits:()=>Du,getAuditsStats:()=>Uu});var f={};n.r(f),n.d(f,{deleteEmailConfiguration:()=>Hu,deleteEmailSubscriptions:()=>zu,deleteSMSConfiguration:()=>Zu,deleteSMSSubscriptions:()=>Xu,deleteSlackConfiguration:()=>xu,deleteWebhooksConfiguration:()=>ny,getCategories:()=>ry,getChannelMaps:()=>sy,getEmailConfiguration:()=>ju,getSMSConfiguration:()=>qu,getSlackChannels:()=>Gu,getSlackConfiguration:()=>Mu,getSlackScope:()=>Fu,getWebhookLog:()=>ay,getWebhooksConfigurations:()=>ey,patchEmailConfiguration:()=>Wu,patchSMSConfiguration:()=>Yu,postEmailConfiguration:()=>Bu,postSMSConfiguration:()=>Ju,postSlackCode:()=>Vu,postSlackConfiguration:()=>$u,postWebhookRetry:()=>oy,postWebhookTest:()=>iy,postWebhooksConfiguration:()=>ty,putEmailSubscriptions:()=>Ku,putSMSSubscriptions:()=>Qu});var p={};n.r(p),n.d(p,{getPublicSettings:()=>dy,getSettings:()=>cy,updateSettings:()=>ly});var g={};n.r(g),n.d(g,{addRole:()=>gy,addRoleV2:()=>Ty,attachPermissionToRoles:()=>by,attachPermissionsToRole:()=>hy,deleteRole:()=>Sy,getPermissionCategories:()=>Ay,getPermissions:()=>my,getRoles:()=>py,updateRole:()=>vy});var S={};n.r(S),n.d(S,{ISubscriptionCancellationPolicy:()=>ef,ISubscriptionStatus:()=>Qy,PaymentMethodType:()=>Zy,ProviderType:()=>tf,TenantCreatedAction:()=>af,TrialEndAction:()=>nf,cancelManagedSubscription:()=>wy,cancelSubscription:()=>Iy,createStripeCustomer:()=>Wy,createStripePaymentMethodSetupIntentSecret:()=>Ky,createSubscription:()=>jy,createTenantConfiguration:()=>Jy,getManagedSubscription:()=>_y,getManagedSubscriptions:()=>Ly,getPaymentMethod:()=>xy,getPaymentMethods:()=>$y,getPaymentProviders:()=>Yy,getStripeCustomer:()=>By,getStripePaymentProviderConfiguration:()=>zy,getSubscription:()=>ky,getSubscriptionInvoice:()=>My,getSubscriptionInvoicePdf:()=>Fy,getSubscriptionInvoices:()=>Ny,getSubscriptionPlan:()=>Cy,getSubscriptionPlans:()=>Ry,getSubscriptionSummaries:()=>Hy,getSubscriptions:()=>Ey,getTenantConfiguration:()=>qy,getVendorPublicConfigurations:()=>Xy,renewManagedSubscription:()=>Dy,renewSubscription:()=>Oy,updateManagedSubscription:()=>Uy,updatePaymentMethodBillingDetails:()=>Vy,updateSubscription:()=>Py});var v={};n.r(v),n.d(v,{getVendorPublicInfo:()=>of});var h={};n.r(h),n.d(h,{addUserRolesForSubTenants:()=>cf,addUserToTenantAndSubTenants:()=>sf,addUsersToSubTenant:()=>Sf,createSubTenant:()=>yf,deleteSubTenant:()=>ff,loadAllUsers:()=>rf,removeUserFromTenantAndSubTenants:()=>lf,removeUserRolesFromSubTenants:()=>df,setUserRolesForSubTenants:()=>uf,updateSubAccountAccess:()=>gf,updateSubTenant:()=>pf});var m={};n.r(m),n.d(m,{countConfigurationUsers:()=>Af,createConfiguration:()=>mf,deleteConfiguration:()=>bf,getConfigs:()=>vf,updateConfiguration:()=>hf});var b={};n.r(b),n.d(b,{impersonate:()=>Tf});var A={};n.r(A),n.d(A,{addRolesToGroup:()=>wf,addUsersToGroup:()=>Uf,createGroup:()=>Pf,deleteGroup:()=>Lf,deleteRolesFromGroup:()=>Df,deleteUsersFromGroup:()=>Rf,getGroupById:()=>kf,getGroupConfiguration:()=>Cf,getGroups:()=>If,getGroupsByIds:()=>Of,updateGroup:()=>_f,updateGroupConfiguration:()=>Nf});var T={};n.r(T),n.d(T,{getInsights:()=>Ff,getRecommendations:()=>Mf});var E={};n.r(E),n.d(E,{createPhoneNumber:()=>$f,deletePhoneNumber:()=>xf,getUserPhoneNumbers:()=>Gf,preVerifyPhoneNumber:()=>Vf,verifyDeletePhoneNumber:()=>Bf,verifyPhoneNumber:()=>jf});var k={};n.r(k),n.d(k,{ADMIN_PORTAL_ENTITLEMENTS_FF:()=>Hs,AuthStrategyEnum:()=>Ea,ContextHolder:()=>$o,FeatureFlags:()=>Vr,FronteggApiError:()=>Vo,FronteggContext:()=>xo,FronteggFrameworks:()=>ca,GetUsersFilterPreset:()=>ya,GroupManagedByEnum:()=>np,GroupRelations:()=>tp,ISubscriptionCancellationPolicy:()=>ef,ISubscriptionStatus:()=>Qy,InsightCode:()=>ip,LOAD_AUTHORIZATION_FF:()=>Bs,MFAStrategyEnum:()=>js,MachineToMachineAuthStrategy:()=>ka,NotEntitledJustification:()=>Ks,PaginationOrderEnum:()=>da,PaymentMethodType:()=>Zy,PermissionAssignmentTypeEnum:()=>Hf,ProviderType:()=>tf,RecommendationActionKey:()=>op,RecommendationCode:()=>ap,RecommendationSeverity:()=>rp,RequestSource:()=>la,RestrictionType:()=>Bn,ScimConnectionSource:()=>ep,SecondaryAuthStrategy:()=>xs,SecurityCategory:()=>sp,SocialLoginProviders:()=>Ta,SortByEnum:()=>ua,TenantSortByEnum:()=>zf,TenantType:()=>Kf,USE_ENTITLEMENTS_V2_ENDPOINT_FF:()=>$r,UserManagedByEnum:()=>Wf,WebAuthnDeviceType:()=>Vs,api:()=>lp,countConfigurationUsers:()=>Af,createConfiguration:()=>mf,default:()=>cp,deleteConfiguration:()=>bf,fetch:()=>e,fronteggAuthApiRoutesRegex:()=>qf,fronteggHeaders:()=>sa,fronteggRefreshTokenUrl:()=>Jf,fronteggSilentRefreshTokenUrl:()=>Yf,fronteggTenantsUrl:()=>Qf,fronteggTenantsV3Url:()=>Zf,fronteggUsersUrl:()=>Xf,getConfigs:()=>vf,getCurrentUserTenantsFunction:()=>ts,getTabTenantFromSessionStorage:()=>es,loadFeatureFlags:()=>jr,providersArray:()=>fa,setTabTenantInSessionStorage:()=>Qr,updateConfiguration:()=>hf});var I={};function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function _(e){var t=function(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t);if("object"!==P(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===P(t)?t:String(t)}function L(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,_(a.key),a)}}function w(e,t,n){return t&&L(e.prototype,t),n&&L(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.r(I),n.d(I,{AccountDetailsPageTabs:()=>ow,AccountPageFields:()=>QL,DomainRestrictionsTabFields:()=>iw,GeneralSettingsTabFields:()=>nw,InviteUserModalFields:()=>XL,IpRestrictionsTabFields:()=>aw,Metadata:()=>BL,PrivacyPageFields:()=>YL,ProfilePageFields:()=>JL,SecurityPageTabs:()=>ew,SessionManagementTabFields:()=>tw,SignupFields:()=>qL,SubscriptionsPageFields:()=>ZL,alpha:()=>ML,fieldAppearance:()=>rw,tabAppearance:()=>sw});var D=function(){function e(){O(this,e)}return w(e,null,[{key:"setInstance",value:function(t,n){e._apps[t]=n}},{key:"getInstance",value:function(t){var n=e._apps[t];if(!n)throw Error("[".concat(t,"] FronteggApp not found"));return n}}]),e}();function U(e,t,n,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,i)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function r(e){U(o,a,i,r,s,"next",e)}function s(e){U(o,a,i,r,s,"throw",e)}r(void 0)}))}}D._apps={};var C=n(2841),N=n.n(C);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},M.apply(this,arguments)}function F(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function G(e){return!!e&&!!e[ke]}function $(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Ie}(e)||Array.isArray(e)||!!e[Ee]||!!e.constructor[Ee]||z(e)||K(e))}function x(e,t,n){void 0===n&&(n=!1),0===V(e)?(n?Object.keys:Oe)(e).forEach((function(a){n&&"symbol"==typeof a||t(a,e[a],e)})):e.forEach((function(n,a){return t(a,n,e)}))}function V(e){var t=e[ke];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:z(e)?2:K(e)?3:0}function j(e,t){return 2===V(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function B(e,t,n){var a=V(e);2===a?e.set(t,n):3===a?(e.delete(t),e.add(n)):e[t]=n}function W(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function z(e){return me&&e instanceof Map}function K(e){return be&&e instanceof Set}function H(e){return e.o||e.t}function q(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Pe(e);delete t[ke];for(var n=Oe(t),a=0;a<n.length;a++){var i=n[a],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function J(e,t){return void 0===t&&(t=!1),X(e)||G(e)||!$(e)||(V(e)>1&&(e.set=e.add=e.clear=e.delete=Y),Object.freeze(e),t&&x(e,(function(e,t){return J(t,!0)}),!0)),e}function Y(){F(2)}function X(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Q(e){var t=_e[e];return t||F(18,e),t}function Z(){return ve}function ee(e,t){t&&(Q("Patches"),e.u=[],e.s=[],e.v=t)}function te(e){ne(e),e.p.forEach(ie),e.p=null}function ne(e){e===ve&&(ve=e.l)}function ae(e){return ve={p:[],l:ve,h:e,m:!0,_:0}}function ie(e){var t=e[ke];0===t.i||1===t.i?t.j():t.O=!0}function oe(e,t){t._=t.p.length;var n=t.p[0],a=void 0!==e&&e!==n;return t.h.g||Q("ES5").S(t,e,a),a?(n[ke].P&&(te(t),F(4)),$(e)&&(e=re(t,e),t.l||le(t,e)),t.u&&Q("Patches").M(n[ke].t,e,t.u,t.s)):e=re(t,n,[]),te(t),t.u&&t.v(t.u,t.s),e!==Te?e:void 0}function re(e,t,n){if(X(t))return t;var a=t[ke];if(!a)return x(t,(function(i,o){return se(e,a,t,i,o,n)}),!0),t;if(a.A!==e)return t;if(!a.P)return le(e,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var i=4===a.i||5===a.i?a.o=q(a.k):a.o;x(3===a.i?new Set(i):i,(function(t,o){return se(e,a,i,t,o,n)})),le(e,i,!1),n&&e.u&&Q("Patches").R(a,n,e.u,e.s)}return a.o}function se(e,t,n,a,i,o){if(G(i)){var r=re(e,i,o&&t&&3!==t.i&&!j(t.D,a)?o.concat(a):void 0);if(B(n,a,r),!G(r))return;e.m=!1}if($(i)&&!X(i)){if(!e.h.F&&e._<1)return;re(e,i),t&&t.A.l||le(e,i)}}function le(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&J(t,n)}function ce(e,t){var n=e[ke];return(n?H(n):e)[t]}function de(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Object.getPrototypeOf(n)}}function ue(e){e.P||(e.P=!0,e.l&&ue(e.l))}function ye(e){e.o||(e.o=q(e.t))}function fe(e,t,n){var a=z(t)?Q("MapSet").N(t,n):K(t)?Q("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),a={i:n?1:0,A:t?t.A:Z(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=a,o=Le;n&&(i=[a],o=we);var r=Proxy.revocable(i,o),s=r.revoke,l=r.proxy;return a.k=l,a.j=s,l}(t,n):Q("ES5").J(t,n);return(n?n.A:Z()).p.push(a),a}function pe(e){return G(e)||F(22,e),function e(t){if(!$(t))return t;var n,a=t[ke],i=V(t);if(a){if(!a.P&&(a.i<4||!Q("ES5").K(a)))return a.t;a.I=!0,n=ge(t,i),a.I=!1}else n=ge(t,i);return x(n,(function(t,i){a&&function(e,t){return 2===V(e)?e.get(t):e[t]}(a.t,t)===i||B(n,t,e(i))})),3===i?new Set(n):n}(e)}function ge(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return q(e)}var Se,ve,he="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),me="undefined"!=typeof Map,be="undefined"!=typeof Set,Ae="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Te=he?Symbol.for("immer-nothing"):((Se={})["immer-nothing"]=!0,Se),Ee=he?Symbol.for("immer-draftable"):"__$immer_draftable",ke=he?Symbol.for("immer-state"):"__$immer_state",Ie=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),Oe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Pe=Object.getOwnPropertyDescriptors||function(e){var t={};return Oe(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},_e={},Le={get:function(e,t){if(t===ke)return e;var n=H(e);if(!j(n,t))return function(e,t,n){var a,i=de(t,n);return i?"value"in i?i.value:null===(a=i.get)||void 0===a?void 0:a.call(e.k):void 0}(e,n,t);var a=n[t];return e.I||!$(a)?a:a===ce(e.t,t)?(ye(e),e.o[t]=fe(e.A.h,a,e)):a},has:function(e,t){return t in H(e)},ownKeys:function(e){return Reflect.ownKeys(H(e))},set:function(e,t,n){var a=de(H(e),t);if(null==a?void 0:a.set)return a.set.call(e.k,n),!0;if(!e.P){var i=ce(H(e),t),o=null==i?void 0:i[ke];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(W(n,i)&&(void 0!==n||j(e.t,t)))return!0;ye(e),ue(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ce(e.t,t)||t in e.t?(e.D[t]=!1,ye(e),ue(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=H(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:a.enumerable,value:n[t]}:a},defineProperty:function(){F(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){F(12)}},we={};x(Le,(function(e,t){we[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),we.deleteProperty=function(e,t){return we.set.call(this,e,t,void 0)},we.set=function(e,t,n){return Le.set.call(this,e[0],t,n,e[0])};var De=function(){function e(e){var t=this;this.g=Ae,this.F=!0,this.produce=function(e,n,a){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var o=t;return function(e){var t=this;void 0===e&&(e=i);for(var a=arguments.length,r=Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return o.produce(e,(function(e){var a;return(a=n).call.apply(a,[t,e].concat(r))}))}}var r;if("function"!=typeof n&&F(6),void 0!==a&&"function"!=typeof a&&F(7),$(e)){var s=ae(t),l=fe(t,e,void 0),c=!0;try{r=n(l),c=!1}finally{c?te(s):ne(s)}return"undefined"!=typeof Promise&&r instanceof Promise?r.then((function(e){return ee(s,a),oe(e,s)}),(function(e){throw te(s),e})):(ee(s,a),oe(r,s))}if(!e||"object"!=typeof e){if(void 0===(r=n(e))&&(r=e),r===Te&&(r=void 0),t.F&&J(r,!0),a){var d=[],u=[];Q("Patches").M(e,r,d,u),a(d,u)}return r}F(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var a=arguments.length,i=Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var a,i,o=t.produce(e,n,(function(e,t){a=e,i=t}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(e){return[e,a,i]})):[o,a,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){$(e)||F(8),G(e)&&(e=pe(e));var t=ae(this),n=fe(this,e,void 0);return n[ke].C=!0,ne(t),n},t.finishDraft=function(e,t){var n=(e&&e[ke]).A;return ee(n,t),oe(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Ae&&F(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var a=t[n];if(0===a.path.length&&"replace"===a.op){e=a.value;break}}n>-1&&(t=t.slice(n+1));var i=Q("Patches").$;return G(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),Ue=new De,Re=Ue.produce;Ue.produceWithPatches.bind(Ue),Ue.setAutoFreeze.bind(Ue),Ue.setUseProxies.bind(Ue),Ue.applyPatches.bind(Ue),Ue.createDraft.bind(Ue),Ue.finishDraft.bind(Ue);const Ce=Re;function Ne(e,t,n){return(t=_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){Ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ge(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var $e="function"==typeof Symbol&&Symbol.observable||"@@observable",xe=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ve={INIT:"@@redux/INIT"+xe(),REPLACE:"@@redux/REPLACE"+xe(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+xe()}};function je(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Be(e,t,n){var a;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Ge(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Ge(1));return n(Be)(e,t)}if("function"!=typeof e)throw new Error(Ge(2));var i=e,o=t,r=[],s=r,l=!1;function c(){s===r&&(s=r.slice())}function d(){if(l)throw new Error(Ge(3));return o}function u(e){if("function"!=typeof e)throw new Error(Ge(4));if(l)throw new Error(Ge(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(Ge(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),r=null}}}function y(e){if(!je(e))throw new Error(Ge(7));if(void 0===e.type)throw new Error(Ge(8));if(l)throw new Error(Ge(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=r=s,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(Ge(10));i=e,y({type:Ve.REPLACE})}function p(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Ge(11));function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[$e]=function(){return this},e}return y({type:Ve.INIT}),(a={dispatch:y,subscribe:u,getState:d,replaceReducer:f})[$e]=p,a}function We(e){for(var t=Object.keys(e),n={},a=0;a<t.length;a++){var i=t[a];"function"==typeof e[i]&&(n[i]=e[i])}var o,r=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Ve.INIT}))throw new Error(Ge(12));if(void 0===n(void 0,{type:Ve.PROBE_UNKNOWN_ACTION()}))throw new Error(Ge(13))}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var a=!1,i={},s=0;s<r.length;s++){var l=r[s],c=n[l],d=e[l],u=c(d,t);if(void 0===u)throw t&&t.type,new Error(Ge(14));i[l]=u,a=a||u!==d}return(a=a||r.length!==Object.keys(e).length)?i:e}}function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Ke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),a=function(){throw new Error(Ge(15))},i={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return a=ze.apply(void 0,o)(n.dispatch),Fe(Fe({},n),{},{dispatch:a})}}}function He(e){return function(t){var n=t.dispatch,a=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,a,e):t(i)}}}}var qe=He();qe.withExtraArgument=He;const Je=qe;var Ye,Xe=(Ye=function(e,t){return Ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ye(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ye(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Qe=function(e,t){for(var n=0,a=t.length,i=e.length;n<a;n++,i++)e[i]=t[n];return e},Ze=Object.defineProperty,et=(Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols),tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,at=function(e,t,n){return t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},it=function(e,t){for(var n in t||(t={}))tt.call(t,n)&&at(e,n,t[n]);if(et)for(var a=0,i=et(t);a<i.length;a++)n=i[a],nt.call(t,n)&&at(e,n,t[n]);return e},ot="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ze:ze.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var rt=function(e){function t(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Xe(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Qe([void 0],e[0].concat(this)))):new(t.bind.apply(t,Qe([void 0],e.concat(this))))},t}(Array);function st(e){return $(e)?Ce(e,(function(){})):e}function lt(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,a=(e.immutableCheck,e.serializableCheck,new rt);return n&&(function(e){return"boolean"==typeof e}(n)?a.push(Je):a.push(Je.withExtraArgument(n.extraArgument))),a}function ct(e){var t,n=function(e){return lt(e)},a=e||{},i=a.reducer,o=void 0===i?void 0:i,r=a.middleware,s=void 0===r?n():r,l=a.devTools,c=void 0===l||l,d=a.preloadedState,u=void 0===d?void 0:d,y=a.enhancers,f=void 0===y?void 0:y;if("function"==typeof o)t=o;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=We(o)}var p=s;"function"==typeof p&&(p=p(n));var g=Ke.apply(void 0,p),S=ze;c&&(S=ot(it({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=Qe([g],f):"function"==typeof f&&(v=f(v)),Be(t,u,S.apply(void 0,v))}function dt(e,t){function n(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return it(it({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function ut(e){var t,n={},a=[],i={addCase:function(e,t){var a="string"==typeof e?e:e.type;if(a in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[a]=t,i},addMatcher:function(e,t){return a.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,a,t]}function yt(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,a="function"==typeof e.initialState?e.initialState:st(e.initialState),i=e.reducers||{},o=Object.keys(i),r={},s={},l={};function c(){var t="function"==typeof e.extraReducers?ut(e.extraReducers):[e.extraReducers],n=t[0],i=void 0===n?{}:n,o=t[1],r=void 0===o?[]:o,l=t[2],c=void 0===l?void 0:l,d=it(it({},i),s);return function(e,t,n,a){void 0===n&&(n=[]);var i,o="function"==typeof t?ut(t):[t,n,a],r=o[0],s=o[1],l=o[2];if(function(e){return"function"==typeof e}(e))i=function(){return st(e())};else{var c=st(e);i=function(){return c}}function d(e,t){void 0===e&&(e=i());var n=Qe([r[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[l]),n.reduce((function(e,n){if(n){var a;if(G(e))return void 0===(a=n(e,t))?e:a;if($(e))return Ce(e,(function(e){return n(e,t)}));if(void 0===(a=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return a}return e}),e)}return d.getInitialState=i,d}(a,d,r,c)}return o.forEach((function(e){var n,a,o=i[e],c=t+"/"+e;"reducer"in o?(n=o.reducer,a=o.prepare):n=o,r[e]=n,s[c]=n,l[e]=a?dt(c,a):dt(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:l,caseReducers:r,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}Object.assign;var ft="listenerMiddleware";dt(ft+"/add"),dt(ft+"/removeAll"),dt(ft+"/remove"),function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[ke];return Le.get(t,e)},set:function(t){var n=this[ke];Le.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][ke];if(!i.P)switch(i.i){case 5:a(i)&&ue(i);break;case 4:n(i)&&ue(i)}}}function n(e){for(var t=e.t,n=e.k,a=Oe(n),i=a.length-1;i>=0;i--){var o=a[i];if(o!==ke){var r=t[o];if(void 0===r&&!j(t,o))return!0;var s=n[o],l=s&&s[ke];if(l?l.t!==r:!W(s,r))return!0}}var c=!!t[ke];return a.length!==Oe(t).length+(c?0:1)}function a(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var a=0;a<t.length;a++)if(!t.hasOwnProperty(a))return!0;return!1}var i={};!function(e,t){_e[e]||(_e[e]=t)}("ES5",{J:function(t,n){var a=Array.isArray(t),i=function(t,n){if(t){for(var a=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(a,""+i,e(i,!0));return a}var o=Pe(n);delete o[ke];for(var r=Oe(o),s=0;s<r.length;s++){var l=r[s];o[l]=e(l,t||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(a,t),o={i:a?5:4,A:n?n.A:Z(),P:!1,I:!1,D:{},l:n,t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,ke,{value:o,writable:!0}),i},S:function(e,n,i){i?G(n)&&n[ke].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[ke];if(n){var i=n.t,o=n.k,r=n.D,s=n.i;if(4===s)x(o,(function(t){t!==ke&&(void 0!==i[t]||j(i,t)?r[t]||e(o[t]):(r[t]=!0,ue(n)))})),x(i,(function(e){void 0!==o[e]||j(o,e)||(r[e]=!1,ue(n))}));else if(5===s){if(a(n)&&(ue(n),r.length=!0),o.length<i.length)for(var l=o.length;l<i.length;l++)r[l]=!1;else for(var c=i.length;c<o.length;c++)r[c]=!0;for(var d=Math.min(o.length,i.length),u=0;u<d;u++)o.hasOwnProperty(u)||(r[u]=!0),void 0===r[u]&&e(o[u])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):a(e)}})}();const pt=(e,t)=>n=>M({},n,{[e]:t[e]}),gt=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>M({},t,{[e]:M({},t[e],n)})}),St=(e,t)=>({prepare:e=>({payload:e}),reducer:(n,{payload:a})=>{var i;return M({},n,{[e]:M({},n[e],{[t]:M({},null==n||null==(i=n[e])?void 0:i[t],a)})})}}),vt=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>{var a,i;return M({},t,{[e]:M({},t[e],{loaders:M({},null==(a=t[e])?void 0:a.loaders,{[n.key]:null==(i=n.value)||i})})})}}),ht=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>{var a;return M({},t,{[e]:M({},t[e],{errors:M({},t[e].errors,{[n.key]:null==(a=n.value)||a})})})}}),mt=(e,t,n)=>({prepare:e=>({payload:e}),reducer:(a,{payload:i})=>{var o;return M({},a,{[e]:M({},a[e],{[t]:M({},null==a||null==(o=a[e])?void 0:o[t],i,n)})})}}),bt=(e,t,n)=>a=>{var i;return M({},a,{[e]:M({},a[e],{[t]:M({},null==a||null==(i=a[e])?void 0:i[t],n)})})},At=(e=500)=>new Promise((t=>setTimeout(t,e))),Tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Et=new Uint8Array(256);for(let e=0;e<Tt.length;e++)Et[Tt.charCodeAt(e)]=e;const kt=e=>{const t=.75*e.length,n=e.length;let a,i,o,r,s,l=0;const c=new Uint8Array(t);for(a=0;a<n;a+=4)i=Et[e.charCodeAt(a)],o=Et[e.charCodeAt(a+1)],r=Et[e.charCodeAt(a+2)],s=Et[e.charCodeAt(a+3)],c[l++]=i<<2|o>>4,c[l++]=(15&o)<<4|r>>2,c[l++]=(3&r)<<6|63&s;return c.buffer},It=e=>{if(e instanceof Array){const t=[];for(const n of e)t.push(It(n));return t}if(e instanceof ArrayBuffer)return(e=>{const t=new Uint8Array(e),n=t.length;let a,i="";for(a=0;a<n;a+=3)i+=Tt[t[a]>>2],i+=Tt[(3&t[a])<<4|t[a+1]>>4],i+=Tt[(15&t[a+1])<<2|t[a+2]>>6],i+=Tt[63&t[a+2]];return n%3==2?i=i.substring(0,i.length-1):n%3==1&&(i=i.substring(0,i.length-2)),i})(e);if(e instanceof Object){const t={};for(const n in e)t[n]=It(e[n]);return t}return e};let Ot,Pt,_t,Lt;!function(e){e.preLogin="preLogin",e.magicLinkPreLoginSuccess="magicLinkPreLoginSuccess",e.loginWithSmsOtc="loginWithSmsOtc",e.loginWithQuickSmsOtc="loginWithQuickSmsOtc",e.loginWithOtc="loginWithOtc",e.loginWithPassword="loginWithPassword",e.loginWithTwoFactor="loginWithTwoFactor",e.redirectToSSO="redirectToSSO",e.loginWithSSOFailed="loginWithSSOFailed",e.success="success",e.forceTwoFactor="forceTwoFactor",e.recoverTwoFactor="recoverTwoFactor",e.promptPasskeys="promptPasskeys",e.breachedPassword="breachedPassword",e.breachedPasswordSuccess="breachedPasswordSuccess"}(Ot||(Ot={})),function(e){e.Login="login",e.RegisterQuickLogin="registerQuickLogin"}(Pt||(Pt={})),function(e){e.Internal="internal",e.UsbKey="usb-key",e.Android="android",e.Sms="sms"}(_t||(_t={})),function(e){e["social-login"]="social-login",e["custom-social-login"]="custom-social-login",e.direct="direct"}(Lt||(Lt={}));const wt="FRONTEGG_AFTER_AUTH_REDIRECT_URL",Dt="HOSTED_LOGIN_VERIFIER_KEY",Ut="auth",Rt="connectivity",Ct="auditLogs",Nt="vendor",Mt={flow:Pt.Login,step:Ot.preLogin,loading:!1,email:"",tenants:[]},Ft={setLoginState:gt("loginState"),resetLoginState:pt("loginState",{loginState:Mt})},Gt={requestAuthorize:dt("auth/requestAuthorize",((e=!1)=>({payload:e}))),requestAuthorizeSSR:dt("auth/requestAuthorizeSSR",(e=>({payload:e}))),requestHostedLoginAuthorize:dt("auth/requestHostedLoginAuthorize",(e=>({payload:e}))),requestHostedLoginAuthorizeV2:dt("auth/requestHostedLoginAuthorizeV2",(e=>({payload:e}))),handleHostedLoginCallback:dt("auth/handleHostedLoginCallback",(e=>({payload:e}))),afterAuthNavigation:dt("auth/afterAuthNavigation"),preLogin:dt("auth/preLogin",(e=>({payload:e}))),postLogin:dt("auth/postLogin",(e=>({payload:e}))),login:dt("auth/login",(e=>({payload:e}))),loginWithMfa:dt("auth/loginWithMfa",(e=>({payload:e}))),recoverMfa:dt("auth/recoverMfa",(e=>({payload:e}))),logout:dt("auth/logout",(e=>({payload:e}))),silentLogout:dt("auth/silentLogout",(e=>({payload:e}))),checkIfAllowToRememberMfaDevice:dt("auth/checkIfAllowToRememberMfaDevice",(e=>({payload:e}))),changePhoneNumberWithVerification:dt("auth/changePhoneNumberWithVerification",(e=>({payload:e}))),verifyChangePhoneNumber:dt("auth/verifyChangePhoneNumber",(e=>({payload:e}))),quickSmsPasswordlessPreLogin:dt("auth/quickSmsPasswordlessPreLogin",(e=>({payload:e}))),passwordlessPreLogin:dt("auth/passwordlessPreLogin",(e=>({payload:e}))),passwordlessPostLogin:dt("auth/passwordlessPostLogin",(e=>({payload:e}))),verifyInviteToken:dt("auth/verifyInviteToken",(e=>({payload:e}))),webAuthnPrelogin:dt("auth/webAuthnPrelogin",(e=>({payload:e}))),webAuthnPostLogin:dt("auth/webAuthnPostLogin",(e=>({payload:e}))),webAuthnCreateNewDeviceSession:dt("auth/webAuthnCreateNewDeviceSession",(e=>({payload:e}))),webAuthnVerifyNewDeviceSession:dt("auth/webAuthnVerifyNewDeviceSession",(e=>({payload:e}))),getUserIP:dt("auth/getUserIP",(e=>({payload:e}))),preEnrollMFAWebAuthnForLogin:dt("auth/preEnrollWebAuthNForLogin",(e=>({payload:e}))),enrollMFAWebAuthnForLogin:dt("auth/enrollWebAuthNForLogin",(e=>({payload:e}))),enrollMFAAuthenticatorAppForLogin:dt("auth/enrollMFAAuthenticatorAppForLogin",(e=>({payload:e}))),preEnrollMFASMSForLogin:dt("auth/preEnrollMFASMSForLogin",(e=>({payload:e}))),enrollMFASMSForLogin:dt("auth/enrollMFASMSForLogin",(e=>({payload:e}))),preVerifyMFAWebAuthnForLogin:dt("auth/preVerifyMFAWebAuthnForLogin",(e=>({payload:e}))),verifyMFAWebAuthnForLogin:dt("auth/verifyMFAWebAuthnForLogin",(e=>({payload:e}))),preVerifyMFASMSForLogin:dt("auth/preVerifyMFASMSForLogin",(e=>({payload:e}))),verifyMFASMSForLogin:dt("auth/verifyMFASMSForLogin",(e=>({payload:e}))),preVerifyMFAEmailCode:dt("auth/preVerifyMFAEmailCode",(e=>({payload:e}))),verifyMFAEmailCode:dt("auth/verifyMFAEmailCode",(e=>({payload:e}))),resetBreachedPassword:dt("auth/resetBreachedPassword",(e=>({payload:e})))};let $t;!function(e){e.activating="activating",e.success="success",e.resend="resend",e.activatingForm="activatingForm"}($t||($t={}));const xt={step:$t.activating,loading:!1,resentEmail:!1,activationStrategy:{loading:!1}},Vt={setActivateState:gt("activateState"),resetActivateState:pt("activateState",{activateState:xt}),setActivateStrategyState:St("activateState","activationStrategy")},jt={activateAccount:dt("auth/activateAccount",(e=>({payload:e}))),preActivateAccount:dt("auth/preActivateAccount",(e=>({payload:e}))),getActivateAccountStrategy:dt("auth/getActivateAccountStrategy",(e=>({payload:e}))),resendActivationEmail:dt("auth/resendActivationEmail",(e=>({payload:e})))};let Bt;!function(e){e.validate="validate",e.invalid="invalid",e.pending="pending",e.success="success",e.failed="failed"}(Bt||(Bt={}));const Wt={step:Bt.validate},zt={setAcceptInvitationState:gt("acceptInvitationState"),resetAcceptInvitationState:pt("acceptInvitationState",{acceptInvitationState:Wt})},Kt={acceptInvitation:dt("auth/acceptInvitation",(e=>({payload:e})))};let Ht;!function(e){e.forgotPassword="forgotPassword",e.success="success"}(Ht||(Ht={}));const qt={step:Ht.forgotPassword,loading:!1,email:"",passwordConfig:null},Jt={setForgotPasswordState:gt("forgotPasswordState"),resetForgotPasswordState:pt("forgotPasswordState",{forgotPasswordState:qt})},Yt={forgotPassword:dt("auth/forgotPassword",(e=>({payload:e}))),resetPassword:dt("auth/resetPassword",(e=>({payload:e}))),loadPasswordConfig:dt("auth/loadPasswordConfig",(e=>({payload:e})))};let Xt;!function(e){e.ResetPhoneNumber="ResetPhoneNumber",e.VerifyResetPhoneNumber="VerifyResetPhoneNumber",e.ChangePhoneNumber="ChangePhoneNumber"}(Xt||(Xt={}));const Qt={step:Xt.ResetPhoneNumber,loading:!1},Zt={setResetPhoneNumberState:gt("resetPhoneNumberState"),resetResetPhoneNumberState:pt("resetPhoneNumberState",{resetPhoneNumberState:Qt})},en={resetPhoneNumber:dt("auth/resetPhoneNumber",(e=>({payload:e}))),verifyResetPhoneNumber:dt("auth/verifyResetPhoneNumber",(e=>({payload:e}))),changePhoneNumber:dt("auth/changePhoneNumber",(e=>({payload:e})))},tn={firstLoad:!0,loading:!0,saving:!1,errors:{},loaders:{},ssoConfigurations:[]},nn={setSSOLoader:vt("ssoState"),setSSOError:ht("ssoState"),setSSOState:gt("ssoState"),resetSSOState:pt("ssoState",{ssoState:tn})},an={loadSSOConfigurationsV2:dt("auth/loadSSOConfigurationsV2"),saveSSOConfigurationV2:dt("auth/saveSSOConfigurationV2",(e=>({payload:e}))),updateSSOConfiguration:dt("auth/updateSSOConfiguration",(e=>({payload:e}))),deleteSSOConfiguration:dt("auth/deleteSSOConfiguration",(e=>({payload:e}))),saveSSODomain:dt("auth/saveSSODomain",(e=>({payload:e}))),deleteSSODomain:dt("auth/deleteSSODomain",(e=>({payload:e}))),validateSSODomainV2:dt("auth/validateSSODomainV2",(e=>({payload:e}))),setSSODefaultRoles:dt("auth/setSSODefaultRoles",(e=>({payload:e}))),setSSOGroups:dt("auth/setSSOGroups",(e=>({payload:e}))),updateSSOGroups:dt("auth/updateSSOGroups",(e=>({payload:e}))),saveSSOConfigurationByMetadata:dt("auth/saveSSOConfigurationByMetadata",(e=>({payload:e}))),updateSSOConfigurationByMetadata:dt("auth/updateSSOConfigurationByMetadata",(e=>({payload:e}))),loadSSOConfigurations:dt("auth/loadSSOConfigurations"),loadSSOAuthorizationRoles:dt("auth/loadSSOAuthorizationRoles"),saveSSOConfigurations:dt("auth/saveSSOConfigurations",(e=>({payload:e}))),saveSSOConfigurationsFile:dt("auth/saveSSOConfigurationsFile",(e=>({payload:e}))),saveSSOConfigurationByData:dt("auth/saveSSOConfigurationByData",(e=>({payload:e}))),saveSSOConfigurationByUrl:dt("auth/saveSSOConfigurationByUrl",(e=>({payload:e}))),saveSSOConfigurationsFileWithCallback:dt("auth/saveSSOConfigurationsFileWithCallback",(e=>({payload:e}))),validateSSODomain:dt("auth/validateSSODomain",(e=>({payload:e}))),updateSSOAuthorizationRoles:dt("auth/updateSSOAuthorizationRoles",(e=>({payload:e}))),deleteSamlGroup:dt("auth/deleteSamlGroup",(e=>({payload:e}))),createSamlGroup:dt("auth/createSamlGroup",(e=>({payload:e}))),oidcPostlogin:dt("auth/oidcPostlogin",(e=>({payload:e})))},on={loading:!1,error:null},rn={setProfileState:gt("profileState"),resetProfileState:pt("profileState",{profileState:on})},sn={loadProfile:dt("auth/loadProfile"),saveProfile:dt("auth/saveProfile",(e=>({payload:e}))),changePassword:dt("auth/changePassword",(e=>({payload:e})))};let ln;!function(e){e.verify="verify",e.recoveryCode="recoveryCode",e.authenticatorApp="authenticatorApp",e.smsSetPhoneNumber="smsSetPhoneNumber",e.smsVerifyCode="smsVerifyCode",e.emailVerifyCode="emailVerifyCode",e.noMFAEnrolledStepUp="noMFAEnrolledStepUp"}(ln||(ln={}));const cn={step:ln.verify,loading:!1,saving:!1},dn={setMfaState:gt("mfaState"),resetMfaState:pt("mfaState",{mfaState:cn})},un={enrollMfa:dt("auth/enrollMfa"),getMFADevices:dt("auth/getMFADevices"),getMFAStrategies:dt("auth/getMFAStrategies"),verifyMfa:dt("auth/verifyMfa",(e=>({payload:e}))),verifyMfaAfterForce:dt("auth/verifyMfaAfterForce",(e=>({payload:e}))),disableMfa:dt("auth/disableMfa",(e=>({payload:e}))),preDisableMfaSms:dt("auth/preDisableMfaSms",(e=>({payload:e}))),disableMfaSms:dt("auth/disableMfaSms",(e=>({payload:e}))),preEnrollMfaSms:dt("auth/preEnrollMfaSms",(e=>({payload:e}))),enrollMfaSms:dt("auth/enrollMfaSms",(e=>({payload:e}))),preEnrollMfaWebAuthn:dt("auth/preEnrollMfaWebAuthn",(e=>({payload:e}))),enrollMfaWebAuthn:dt("auth/enrollMfaWebAuthn",(e=>({payload:e}))),preDisableMfaWebAuthn:dt("auth/preDisableMfaWebAuthn",(e=>({payload:e}))),disableMfaWebAuthn:dt("auth/disableMfaWebAuthn",(e=>({payload:e})))},yn={loaders:{},pageOffset:0,pageSize:20,errors:{},users:[],allUsers:[],roles:[],permissions:[],totalPages:0,shouldShowSubTenantUsersIfReseller:!1,allUsersQueryParams:{_filter:null,_offset:0,_limit:20,_order:"DESC",_sortBy:"name"},addUserDialogState:{loading:!1,open:!1},deleteUserDialogState:{loading:!1,open:!1},lockUserDialogState:{loading:!1,open:!1}},fn={setTeamLoader:vt("teamState"),setTeamError:ht("teamState"),setTeamState:gt("teamState"),resetTeamState:pt("teamState",{teamState:yn})},pn={loadUsersV2:dt("auth/loadUsersV2",(e=>({payload:e}))),loadUsers:dt("auth/loadUsers",(e=>({payload:e}))),loadAllSubTenantsUsers:dt("auth/loadAllSubTenantsUsers",(e=>({payload:e}))),loadRoles:dt("auth/loadRoles",(e=>({payload:e}))),addUser:dt("auth/addUser",(e=>({payload:e}))),addUsersBulk:dt("auth/addUsersBulk",(e=>({payload:e}))),addUserToSubTenants:dt("auth/addUserToSubTenants",(e=>({payload:e}))),updateUser:dt("auth/updateUser",(e=>({payload:e}))),deleteUser:dt("auth/deleteUser",(e=>({payload:e}))),setUserRolesForSubTenants:dt("auth/setUserRolesForSubTenants",(e=>({payload:e}))),deleteUserFromSubTenants:dt("auth/deleteUserFromSubTenants",(e=>({payload:e}))),lockUser:dt("auth/lockUser",(e=>({payload:e}))),resendActivationLink:dt("auth/resendActivationLink",(e=>({payload:e}))),resendInvitationLink:dt("auth/resendInvitationLink",(e=>({payload:e}))),resendInvitationEmail:dt("auth/resendInvitationEmail",(e=>({payload:e}))),resendInvitationLinkToAllSubTenants:dt("auth/resendInvitationLinkToAllSubTenants",(e=>({payload:e}))),getTemporaryUsersConfig:dt("auth/getTemporaryUsersConfig"),updateUserExpirationTime:dt("auth/updateUserExpirationTime",(e=>({payload:e}))),setUserAsPermanent:dt("auth/setUserAsPermanent",(e=>({payload:e}))),getInvitationLink:dt("auth/getInvitationLink"),createInvitationLink:dt("auth/createInvitationLink",(e=>({payload:e}))),updateInvitationLink:dt("auth/updateInvitationLink",(e=>({payload:e}))),deleteInvitationLink:dt("auth/deleteInvitationLink",(e=>({payload:e}))),openAddUserDialog:dt("auth/openAddUserDialog",(e=>({payload:e}))),closeAddUserDialog:dt("auth/closeAddUserDialog",(e=>({payload:e}))),openDeleteUserDialog:dt("auth/openDeleteUserDialog",(e=>({payload:e}))),closeDeleteUserDialog:dt("auth/closeDeleteUserDialog",(e=>({payload:e}))),openLockUserDialog:dt("auth/openLockUserDialog",(e=>({payload:e}))),closeLockUserDialog:dt("auth/closeLockUserDialog",(e=>({payload:e})))},gn={firstLoad:!0,loading:!1,error:""},Sn={setSocialLoginsState:gt("socialLoginState"),resetSocialLoginsState:pt("socialLoginState",{socialLoginState:gn})},vn={loadSocialLoginsConfiguration:dt("auth/loadSocialLoginsConfiguration"),loadSocialLoginsConfigurationV2:dt("auth/loadSocialLoginsConfigurationV2",(e=>({payload:e}))),loginViaSocialLogin:dt("auth/loginViaSocialLogin",(e=>({payload:e}))),setSocialLoginError:dt("auth/setSocialLoginError",(e=>({payload:e})))};let hn;!function(e){e.SignUp="SignUp",e.SignUpSuccess="SignUpSuccess"}(hn||(hn={}));const mn={loading:!1,allowSignUps:!1,allowNotVerifiedUsersLogin:!1,firstLoad:!0,stage:hn.SignUp},bn={setSignUpState:gt("signUpState"),resetSignUpState:pt("signUpState",{signUpState:mn})},An={signUpUser:dt("auth/signUpUser",(e=>({payload:e}))),resetSignUpStateSoft:dt("auth/resetSignUpStateSoft")},Tn={apiTokenType:null,searchValue:"",showAddTokenDialog:!1,createdByUserIdColumn:"show",deleteTokenDialog:{open:!1,clientId:""},successDialog:{open:!1,secret:"",clientId:""},loaders:{},apiTokensDataTenant:[],apiTokensDataUser:[],roles:[],permissions:[],errors:{}},En={setApiTokensLoader:vt("apiTokensState"),setApiTokensError:ht("apiTokensState"),setApiTokensState:gt("apiTokensState"),resetApiTokensState:pt("apiTokensState",{apiTokensState:Tn})},kn={loadApiTokens:dt("auth/loadApiTokens",(e=>({payload:e}))),loadUserApiTokens:dt("auth/loadUserApiTokens",(e=>({payload:e}))),loadTenantApiTokens:dt("auth/loadTenantApiTokens",(e=>({payload:e}))),initApiTokensData:dt("auth/initApiTokensData",(e=>({payload:e}))),addTenantApiToken:dt("auth/addTenantApiToken",(e=>({payload:e}))),addUserApiToken:dt("auth/addUserApiToken",(e=>({payload:e}))),deleteUserApiToken:dt("auth/deleteUserApiToken",(e=>({payload:e}))),deleteTenantApiToken:dt("auth/deleteTenantApiToken",(e=>({payload:e})))},In={globalPolicy:{loading:!0},publicPolicy:{loading:!1},vendorMfaPolicy:{loading:!0},mfaPolicy:{loading:!0},vendorLockoutPolicy:{loading:!0},lockoutPolicy:{loading:!0},captchaPolicy:{loading:!0},passwordHistoryPolicy:{loading:!0},passwordPolicy:{loading:!0},vendorPasswordHistoryPolicy:{loading:!0},publicAuthStrategyPolicy:{loading:!0}},On={setSecurityPolicyState:gt("securityPolicyState"),setSecurityPolicyGlobalState:St("securityPolicyState","globalPolicy"),setSecurityPolicyPublicState:St("securityPolicyState","publicPolicy"),setSecurityPolicyAuthStrategyPublicState:St("securityPolicyState","publicAuthStrategyPolicy"),setSecurityPolicyMfaState:St("securityPolicyState","mfaPolicy"),setSecurityPolicyVendorMfaState:St("securityPolicyState","vendorMfaPolicy"),setSecurityPolicyVendorLockoutState:St("securityPolicyState","vendorLockoutPolicy"),setSecurityPolicyVendorPasswordHistoryState:St("securityPolicyState","vendorPasswordHistoryPolicy"),setSecurityPolicyLockoutState:St("securityPolicyState","lockoutPolicy"),setSecurityPolicyCaptchaState:St("securityPolicyState","captchaPolicy"),setSecurityPolicyPasswordHistoryState:St("securityPolicyState","passwordHistoryPolicy"),setSecurityPolicyPasswordState:St("securityPolicyState","passwordPolicy"),resetSecurityPolicyState:pt("securityPolicyState",{securityPolicyState:In})},Pn={loadSecurityPolicy:dt("auth/loadSecurityPolicy"),loadPublicSecurityPolicy:dt("auth/loadPublicSecurityPolicy"),loadSecurityPolicyMfa:dt("auth/loadSecurityPolicyMfa"),loadSecurityPolicyVendorMfa:dt("auth/loadSecurityPolicyVendorMfa"),saveSecurityPolicyMfa:dt("auth/saveSecurityPolicyMfa",(e=>({payload:e}))),loadSecurityPolicyLockout:dt("auth/loadSecurityPolicyLockout"),loadSecurityPolicyVendorLockout:dt("auth/loadSecurityPolicyVendorLockout"),saveSecurityPolicyLockout:dt("auth/saveSecurityPolicyLockout",(e=>({payload:e}))),loadSecurityPolicyCaptcha:dt("auth/loadSecurityPolicyCaptcha"),loadSecurityPolicyPasswordHistory:dt("auth/loadSecurityPolicyPasswordHistory"),loadSecurityPolicyVendorPasswordHistory:dt("auth/loadSecurityPolicyVendorPasswordHistory"),saveSecurityPolicyPasswordHistory:dt("auth/saveSecurityPolicyPasswordHistory",(e=>({payload:e}))),loadVendorPasswordConfig:dt("auth/loadVendorPasswordConfig"),loadPublicAuthStrategiesPolicy:dt("auth/loadPublicAuthStrategiesPolicy")},_n={loading:!1},Ln={setAccountSettingsState:gt("accountSettingsState"),resetAccountSettingsState:pt("accountSettingsState",{accountSettingsState:_n})},wn={loadAccountSettings:dt("auth/loadAccountSettings",(e=>({payload:e}))),saveAccountSettings:dt("auth/saveAccountSettings",(e=>({payload:e})))},Dn={tenants:[],subTenants:[],loading:!0,tenantTree:null},Un={setTenantsState:gt("tenantsState"),resetTenantsState:pt("tenantsState",{tenantsState:Dn})},Rn={switchTenant:dt("auth/switchTenant",(e=>({payload:e}))),loadTenants:dt("auth/loadTenants",(e=>({payload:e}))),loadSubTenants:dt("auth/loadSubTenants",(e=>({payload:e}))),loadSubTenantsTree:dt("auth/loadSubTenantsTree",(e=>({payload:e})))},Cn={loaders:{},errors:{},roles:[],permissions:[],permissionCategories:[]},Nn={setRolesState:gt("rolesState"),resetRolesState:pt("rolesState",{rolesState:Cn}),setRolesStateLoader:vt("rolesState"),setRolesStateError:ht("rolesState")},Mn={loadRolesAndPermissions:dt("auth/loadRoles",(e=>({payload:e}))),addRole:dt("auth/addRole",(e=>({payload:e}))),addRoleV2:dt("auth/addRoleV2",(e=>({payload:e}))),updateRole:dt("auth/updateRole",(e=>({payload:e}))),deleteRole:dt("auth/deleteRole",(e=>({payload:e}))),attachPermissionsToRole:dt("auth/attachPermissionsToRole",(e=>({payload:e})))},Fn={loading:!1,sessions:[]},Gn={setSessionsState:gt("sessionsState"),resetSessionsState:pt("sessionsState",{sessionsState:Fn})},$n={loadUserSessions:dt("auth/loadUserSessions"),loadCurrentUserSession:dt("auth/loadCurrentUserSession"),deleteUserSession:dt("auth/deleteUserSession",(e=>({payload:e}))),deleteAllUserSessions:dt("auth/deleteAllUserSessions"),revokeUserSessions:dt("auth/revokeUserSessions",(e=>({payload:e})))},xn={loading:!1,configurations:{}},Vn={setSessionsPolicyState:gt("sessionsPolicyState"),resetSessionsPolicyState:pt("sessionsPolicyState",{sessionsPolicyState:xn})},jn={loadSessionsPolicy:dt("auth/loadSessionsPolicy"),createOrUpdateSessionsPolicy:dt("auth/createOrUpdateSessionsPolicy",(e=>({payload:e})))};let Bn;!function(e){e.ALLOW="ALLOW",e.BLOCK="BLOCK"}(Bn||(Bn={}));const Wn={ipRestrictions:{loading:!1,pagination:{_offset:0,_limit:4,_filter:Bn.ALLOW},totalPages:1,userIpValid:!1},emailDomainRestrictions:{loading:!0}},zn={setRestrictionsState:gt("restrictionsState"),setIpRestrictionsState:St("restrictionsState","ipRestrictions"),setEmailDomainRestrictionsState:St("restrictionsState","emailDomainRestrictions")},Kn={checkIfUserIpValid:dt("auth/checkIfUserIpValid"),addCurrentUserIpAndActivate:dt("auth/addCurrentUserIpAndActivate",(e=>({payload:e}))),loadIpRestrictions:dt("auth/loadIpRestrictions"),saveIpRestriction:dt("auth/saveIpRestriction",(e=>({payload:e}))),saveIpRestrictionsConfig:dt("auth/saveIpRestrictionsConfig",(e=>({payload:e}))),deleteIpRestriction:dt("auth/deleteIpRestriction",(e=>({payload:e}))),loadEmailDomainRestrictions:dt("auth/loadEmailDomainRestrictions"),saveEmailDomainRestriction:dt("auth/saveEmailDomainRestriction",(e=>({payload:e}))),saveEmailDomainRestrictionsConfig:dt("auth/saveEmailDomainRestrictionsConfig",(e=>({payload:e}))),deleteEmailDomainRestriction:dt("auth/deleteEmailDomainRestriction",(e=>({payload:e})))},Hn={loading:!1},qn={setProvisioningState:gt("provisioningState"),resetProvisioningState:pt("provisioningState",{provisioningState:Hn})},Jn={loadProvisionConnections:dt("auth/loadProvisionConnections"),createProvisionConnection:dt("auth/createProvisionConnection",(e=>({payload:e}))),deleteProvisionConnection:dt("auth/deleteProvisionConnection",(e=>({payload:e}))),updateProvisionConnection:dt("auth/updateProvisionConnection",(e=>({payload:e})))},Yn={devices:[],loading:!1,error:null},Xn={setPasskeysState:gt("passkeysState"),resetPasskeysState:pt("passkeysState",{passkeysState:Yn})},Qn={loadWebAuthnDevices:dt("auth/loadWebAuthnDevices"),deleteWebAuthnDevice:dt("auth/deleteWebAuthnDevice",(e=>({payload:e})))},Zn={loaders:{},errors:{},groups:[],groupsConfiguration:{}},ea={setUsersGroupsLoader:vt("groupsState"),setUsersGroupsError:ht("groupsState"),setGroupsState:gt("groupsState"),resetUsersGroupsState:pt("groupsState",{groupsState:Zn})},ta={loadGroups:dt("auth/loadUsersGroups"),getGroupById:dt("auth/getGroupById",(e=>({payload:e}))),createGroup:dt("auth/createGroup",(e=>({payload:e}))),updateGroup:dt("auth/updateGroup",(e=>({payload:e}))),deleteGroup:dt("auth/deleteGroup",(e=>({payload:e}))),addRolesToGroup:dt("auth/addRolesToGroup",(e=>({payload:e}))),deleteRolesFromGroup:dt("auth/deleteRolesFromGroup",(e=>({payload:e}))),addUsersToGroup:dt("auth/addUsersToGroup",(e=>({payload:e}))),deleteUsersFromGroup:dt("auth/deleteUsersFromGroup",(e=>({payload:e}))),getGroupConfiguration:dt("auth/getGroupConfiguration"),updateGroupConfiguration:dt("auth/updateGroupConfiguration",(e=>({payload:e}))),getTeamUsers:dt("auth/getUsers",(e=>({payload:e})))},na={addGroupDialogState:{loading:!1,open:!1},editGroupDialogState:{loading:!1,open:!1},deleteGroupDialogState:{loading:!1,open:!1},addMembersToGroupDialogState:{loading:!1,open:!1,userIds:[]},deleteMemberFromGroupDialogState:{loading:!1,open:!1}},aa={setGroupsDialogsState:gt("groupsDialogsState"),resetGroupsDialogsState:pt("groupsState",{groupsDialogsState:na}),openAddGroupDialog:bt("groupsDialogsState","addGroupDialogState",{open:!0}),closeAddGroupDialog:bt("groupsDialogsState","addGroupDialogState",{open:!1}),openEditGroupDialog:mt("groupsDialogsState","editGroupDialogState",{open:!0}),closeEditGroupDialog:bt("groupsDialogsState","editGroupDialogState",{open:!1,loading:!1,group:void 0}),openDeleteGroupDialog:mt("groupsDialogsState","deleteGroupDialogState",{open:!0}),closeDeleteGroupDialog:bt("groupsDialogsState","deleteGroupDialogState",{open:!1,loading:!1,group:void 0}),openAddMembersToGroupDialog:bt("groupsDialogsState","addMembersToGroupDialogState",{open:!0}),closeAddMembersToGroupDialog:bt("groupsDialogsState","addMembersToGroupDialogState",{open:!1,userIds:[]}),openDeleteMemberFromGroupDialog:mt("groupsDialogsState","deleteMemberFromGroupDialogState",{open:!0}),closeDeleteMemberFromGroupDialog:bt("groupsDialogsState","deleteMemberFromGroupDialogState",{open:!1,userId:void 0})},ia={loading:!0,error:null},oa={setCustomLoginState:gt("customLoginState"),resetCustomLoginState:pt("customLoginState",{customLoginState:ia})},ra={loadTenantMetadata:dt("auth/loadTenantMetadata"),updateTenantMetadata:dt("auth/updateTenantMetadata",(e=>({payload:e})))},sa={frameWork:"x-frontegg-framework",fronteggSdkVersion:"x-frontegg-sdk",contentType:"Content-Type",source:"frontegg-source",scopedTenant:"frontegg-scoped-tenant"};let la,ca,da,ua,ya;!function(e){e.AdminPortal="admin-portal",e.LoginBox="login-box"}(la||(la={})),function(e){e.Nextjs="nextjs",e.React="react",e.Angular="angular",e.Vuejs="vuejs",e.Flutter="flutter",e.Ios="ios",e.Android="android",e.Vanillajs="vanillajs"}(ca||(ca={})),function(e){e.ASC="ASC",e.DESC="DESC"}(da||(da={})),function(e){e.createdAt="createdAt",e.name="name",e.email="email",e.id="id",e.verified="verified",e.isLocked="isLocked",e.provider="provider",e.tenantId="tenantId"}(ua||(ua={})),function(e){e.MFA_UNENROLLED="mfa-unenrolled",e.BREACHED_PASSWORDS="breached-passwords",e.INACTIVE="inactive"}(ya||(ya={}));const fa=["local","saml","google","github","facebook","microsoft","scim2","slack"],pa={loaders:{},errors:{},accounts:{tenantId:"",children:[]},accountsQueryParams:{_limit:50,_offset:0,_filter:"",_subTenantId:""},searchAccountsData:[],rootAccount:{tenantId:""},selectedAccount:{tenantId:"",userJwt:{accessToken:"",expiresIn:0,expires:""},users:[],usersQueryParams:{_offset:0,_limit:10,_order:da.DESC,_sortBy:ua.name},usersPageOffset:0,accountSettings:{}}},ga={setAllAccountsLoader:vt("allAccountsState"),setAllAccountsError:ht("allAccountsState"),setAllAccountsState:gt("allAccountsState"),setSelectedAccountState:St("allAccountsState","selectedAccount"),resetAllAccountsState:pt("allAccountsState",{allAccountsState:pa})},Sa={loadAccounts:dt("auth/loadAccounts",(e=>({payload:e}))),searchAccounts:dt("auth/searchAccounts",(e=>({payload:e}))),updateSubAccountAccessForUser:dt("auth/updateSubAccountAccessForUser",(e=>({payload:e}))),createSubAccount:dt("auth/createSubAccount",(e=>({payload:e}))),updateSubAccount:dt("auth/updateAccount",(e=>({payload:e}))),deleteSubAccount:dt("auth/deleteAccount",(e=>({payload:e}))),updateSubAccountSettings:dt("auth/updateSubAccountSettings",(e=>({payload:e}))),addUsersToAccount:dt("auth/addUsersToAccount",(e=>({payload:e}))),getAccountUsers:dt("auth/getAccountUsers",(e=>({payload:e}))),deleteUsersFromAccount:dt("auth/deleteUsersFromAccount",(e=>({payload:e}))),setUserRolesForSubAccount:dt("auth/setUserRolesForSubAccount",(e=>({payload:e}))),getUserJwtForSubAccount:dt("auth/getUserJwtForSubAccount",(e=>({payload:e}))),setRootAccountData:dt("auth/setRootAccountData"),setSelectedSubAccountData:dt("auth/setSelectedSubAccountData",(e=>({payload:e}))),loadNumberOfUsersForSelectedSubAccount:dt("auth/loadNumberOfUsersForSelectedSubAccount",(e=>({payload:e})))},va={createSubAccountDialog:{loading:!1,open:!1,error:!1,jwt:"",canSelectParentAccount:!1},updateSubAccountDialog:{accountId:"",accountName:"",loading:!1,open:!1,error:!1,jwt:""},deleteSubAccountDialog:{accountId:"",accountName:"",isParentAccount:!1,loading:!1,open:!1,error:!1,jwt:""},addUsersToAccountDialog:{loading:!1,open:!1,accountName:"",accountId:"",permissionToGiveAccessToSubAccounts:!1,jwt:""},deleteUserFromAccountDialog:{userId:"",userName:"",accountId:"",loading:!1,open:!1,jwt:""},editUserRolesDialog:{loading:!1,open:!1,jwt:"",accountId:"",userId:"",userName:"",userRoles:[]}},ha={setAllAccountDialogsState:gt("allAccountsDialogsState"),resetAllAccountDialogsState:pt("allAccountsDialogsState",{allAccountsDialogsState:va}),openCreateSubAccountDialog:mt("allAccountsDialogsState","createSubAccountDialog",{open:!0}),closeCreateSubAccountDialog:bt("allAccountsDialogsState","createSubAccountDialog",va.createSubAccountDialog),openUpdateSubAccountDialog:mt("allAccountsDialogsState","updateSubAccountDialog",{open:!0}),closeUpdateSubAccountDialog:bt("allAccountsDialogsState","updateSubAccountDialog",va.updateSubAccountDialog),openDeleteSubAccountDialog:mt("allAccountsDialogsState","deleteSubAccountDialog",{open:!0}),closeDeleteSubAccountDialog:bt("allAccountsDialogsState","deleteSubAccountDialog",va.deleteSubAccountDialog),openAddUsersToAccountDialog:mt("allAccountsDialogsState","addUsersToAccountDialog",{open:!0}),closeAddUsersToAccountDialog:bt("allAccountsDialogsState","addUsersToAccountDialog",va.addUsersToAccountDialog),openDeleteUserFromAccountDialog:mt("allAccountsDialogsState","deleteUserFromAccountDialog",{open:!0}),closeDeleteUserFromAccountDialog:bt("allAccountsDialogsState","deleteUserFromAccountDialog",va.deleteUserFromAccountDialog),openEditUserRolesDialog:mt("allAccountsDialogsState","editUserRolesDialog",{open:!0}),closeEditUserRolesDialog:bt("allAccountsDialogsState","editUserRolesDialog",va.editUserRolesDialog)},ma={loaders:{},errors:{},recommendations:void 0,insights:void 0,score:0,breachedPasswordUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},unenrolledMfaUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},inactiveUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10,_maxInactiveSeconds:7776e3}}},ba={setSecurityCenterState:gt("securityCenterState"),resetSecurityCenterState:pt("securityCenterState",{securityCenterState:ma}),setSecurityCenterStateLoader:vt("securityCenterState"),setSecurityCenterStateError:ht("securityCenterState")},Aa={loadRecommendations:dt("auth/loadRecommendations"),loadInsights:dt("auth/loadInsights"),sendResetBreachedPasswordEmail:dt("auth/sendResetBreachedPasswordEmail",(e=>({payload:e}))),sendBulkResetBreachedPasswordEmails:dt("auth/sendBulkResetBreachedPasswordEmails",(e=>({payload:e}))),loadBreachedPasswordUsers:dt("auth/loadBreachedPasswordUsers",(e=>({payload:e}))),loadUnenrolledMfaUsers:dt("auth/loadUnenrolledMfaUsers",(e=>({payload:e}))),loadInactiveUsers:dt("auth/loadInactiveUsers",(e=>({payload:e})))};let Ta,Ea,ka;!function(e){e.Microsoft="microsoft",e.Facebook="facebook",e.Google="google",e.Github="github",e.Slack="slack",e.Apple="apple",e.Linkedin="linkedin"}(Ta||(Ta={})),function(e){e.EmailAndPassword="EmailAndPassword",e.MagicLink="MagicLink",e.Code="Code",e.NoLocalAuthentication="NoLocalAuthentication",e.SmsCode="SmsCode"}(Ea||(Ea={})),function(e){e.ClientCredentials="ClientCredentials",e.AccessToken="AccessToken"}(ka||(ka={}));const Ia={[Ea.Code]:Ot.loginWithOtc,[Ea.EmailAndPassword]:Ot.loginWithPassword,[Ea.MagicLink]:Ot.magicLinkPreLoginSuccess,[Ea.SmsCode]:Ot.loginWithSmsOtc},Oa={loading:!1,error:null,phoneNumbers:void 0},Pa={setSmsState:gt("smsState"),resetSmsState:pt("smsState",{smsState:Oa})},_a={loadPhoneNumbers:dt("auth/loadPhoneNumbers"),setUpPhoneNumber:dt("auth/setUpPhoneNumber",(e=>({payload:e}))),verifyPhoneNumber:dt("auth/verifyPhoneNumber",(e=>({payload:e}))),deletePhoneNumber:dt("auth/deletePhoneNumber",(e=>({payload:e}))),verifyDeletePhoneNumber:dt("auth/verifyDeletePhoneNumber",(e=>({payload:e}))),preVerifyPhoneNumber:dt("auth/preVerifyPhoneNumber",(e=>({payload:e})))},La={loading:!1,mfaDevices:void 0,mfaToken:""},wa={setStepUpState:gt("stepUpState"),resetStepUpState:pt("stepUpState",{stepUpState:La})},Da={stepUpHostedLogin:dt("auth/stepUpHostedLogin",(e=>({payload:e}))),generateStepUpSession:dt("auth/generateStepUpSession",(e=>({payload:e}))),stepUpWithAuthenticator:dt("auth/stepUpWithAuthenticator",(e=>({payload:e}))),preVerifyMFASMSForStepUp:dt("auth/preVerifyMFASMSForStepUp",(e=>({payload:e}))),verifyMFASMSForStepUp:dt("auth/verifyMFASMSForStepUp",(e=>({payload:e}))),preVerifyMFAWebAuthnForStepUp:dt("auth/preVerifyMFAWebAuthnForStepUp",(e=>({payload:e}))),verifyMFAWebAuthnForStepUp:dt("auth/verifyMFAWebAuthnForStepUp",(e=>({payload:e}))),preVerifyMFAEmailCodeForStepUp:dt("auth/preVerifyMFAEmailCodeForStepUp",(e=>({payload:e}))),verifyMFAEmailCodeForStepUp:dt("auth/verifyMFAEmailCodeForStepUp",(e=>({payload:e})))},Ua={isAuthenticated:!1,isLoading:!0,isSSOAuth:!1,user:null,signUpState:mn,loginState:Mt,stepUpState:La,activateState:xt,acceptInvitationState:Wt,forgotPasswordState:qt,ssoState:tn,profileState:on,customLoginState:ia,mfaState:cn,teamState:yn,groupsState:Zn,groupsDialogsState:na,socialLoginState:gn,apiTokensState:Tn,securityPolicyState:In,accountSettingsState:_n,tenantsState:Dn,rolesState:Cn,resetPhoneNumberState:Qt,sessionsState:Fn,sessionsPolicyState:xn,restrictionsState:Wn,provisioningState:Hn,passkeysState:Yn,allAccountsState:pa,allAccountsDialogsState:va,securityCenterState:ma,smsState:Oa},Ra=M({routes:{authenticatedUrl:"/",loginUrl:"/account/login",stepUpUrl:"/account/step-up",logoutUrl:"/account/logout",activateUrl:"/account/activate",impersonationUrl:"/account/impersonate",acceptInvitationUrl:"/account/invitation/accept",forgetPasswordUrl:"/account/forget-password",resetPhoneNumberUrl:"/account/reset-phone-number",resetPasswordUrl:"/account/reset-password",socialLoginCallbackUrl:"/account/social/success",signUpUrl:"/account/sign-up",oidcRedirectUrl:"/account/oidc/callback",samlCallbackUrl:"/account/saml/callback",magicLinkCallbackUrl:"/account/login/magic-link",hostedLoginRedirectUrl:"/oauth/callback",openAppUrl:"/account/redirect"},onRedirectTo:()=>{}},Ua);let Ca;!function(e){e.impersonating="impersonating",e.success="success"}(Ca||(Ca={}));const Na={step:Ca.impersonating,loading:!1},Ma={setImpersonateState:gt("impersonateState"),resetImpersonateState:pt("impersonateState",{impersonateState:Na})},Fa={impersonate:dt("impersonation/impersonate",(e=>({payload:e})))},{reducer:Ga,actions:$a}=yt({name:Ut,initialState:Ra,reducers:M({resetState:e=>M({},e,Ua),setState:(e,{payload:t})=>M({},e,t),setUser:("user",(e,{payload:t})=>M({},e,{user:t})),setEntitlements:St("user","entitlements")},Ft,wa,Sn,Vt,Ma,zt,Jt,Zt,bn,rn,oa,nn,dn,fn,ea,aa,En,On,Ln,Un,Nn,Gn,Vn,zn,qn,Xn,ga,ha,ba,Pa)});const xa=M({loadEntitlements:dt("auth/loadEntitlements",(e=>({payload:e})))},$a,Gt,Da,vn,jt,Kt,Yt,en,An,sn,ra,an,un,pn,ta,{},kn,Pn,wn,Rn,Mn,$n,jn,Kn,Jn,Fa,Qn,Sa,Aa,_a);var Va=function(e){return"@@redux-saga/"+e},ja=Va("CANCEL_PROMISE"),Ba=Va("CHANNEL_END"),Wa=Va("IO"),za=Va("MATCH"),Ka=Va("MULTICAST"),Ha=Va("SAGA_ACTION"),qa=Va("SELF_CANCELLATION"),Ja=Va("TASK"),Ya=Va("TASK_CANCEL"),Xa=Va("TERMINATE"),Qa=Va("LOCATION");function Za(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}var ei=function(e){return null==e},ti=function(e){return null!=e},ni=function(e){return"function"==typeof e},ai=function(e){return"string"==typeof e},ii=Array.isArray,oi=function(e){return e&&ni(e.then)},ri=function(e){return e&&ni(e.next)&&ni(e.throw)},si=function e(t){return t&&(ai(t)||di(t)||ni(t)||ii(t)&&t.every(e))},li=function(e){return e&&ni(e.take)&&ni(e.close)},ci=function(e){return ni(e)&&e.hasOwnProperty("toString")},di=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};const ui=function(e,t){var n;void 0===t&&(t=!0);var a=new Promise((function(a){n=setTimeout(a,Math.min(2147483647,e),t)}));return a[ja]=function(){clearTimeout(n)},a};var yi=function(e){return function(){return e}},fi=yi(!0),pi=function(){},gi=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var Si=function(e,t){M(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function vi(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var hi=function(e){throw e},mi=function(e){return{value:e,done:!0}};function bi(e,t,n){void 0===t&&(t=hi),void 0===n&&(n="iterator");var a={meta:{name:n},next:e,throw:t,return:mi,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(a[Symbol.iterator]=function(){return a}),a}function Ai(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var Ti=function(e){return Array.apply(null,new Array(e))},Ei=function(e){return function(t){return e(Object.defineProperty(t,Ha,{value:!0}))}},ki=function(e){return e===Xa},Ii=function(e){return e===Ya},Oi=function(e){return ki(e)||Ii(e)};function Pi(e,t){var n,a=Object.keys(e),i=a.length,o=0,r=ii(e)?Ti(i):{},s={};return a.forEach((function(e){var a=function(a,s){n||(s||Oi(a)?(t.cancel(),t(a,s)):(r[e]=a,++o===i&&(n=!0,t(r))))};a.cancel=pi,s[e]=a})),t.cancel=function(){n||(n=!0,a.forEach((function(e){return s[e].cancel()})))},s}function _i(e){return{name:e.name||"anonymous",location:Li(e)}}function Li(e){return e[Qa]}var wi=function(e){return function(e,t){void 0===e&&(e=10);var n=new Array(e),a=0,i=0,o=0,r=function(t){n[i]=t,i=(i+1)%e,a++},s=function(){if(0!=a){var t=n[o];return n[o]=null,a--,o=(o+1)%e,t}},l=function(){for(var e=[];a;)e.push(s());return e};return{isEmpty:function(){return 0==a},put:function(s){var c;if(a<e)r(s);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[i]=s,o=i=(i+1)%e;break;case 4:c=2*e,n=l(),a=n.length,i=n.length,o=0,n.length=c,e=c,r(s)}},take:s,flush:l}}(e,4)},Di="TAKE",Ui="CALL",Ri="FORK",Ci="SELECT",Ni=function(e,t){var n;return(n={})[Wa]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function Mi(e,t){return void 0===e&&(e="*"),si(e)?(ti(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),Ni(Di,{pattern:e})):li(n=e)&&n[Ka]&&ti(t)&&si(t)?Ni(Di,{channel:e,pattern:t}):li(e)?(ti(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),Ni(Di,{channel:e})):void 0;var n}function Fi(e,t){return ei(t)&&(t=e,e=void 0),Ni("PUT",{channel:e,action:t})}function Gi(e){var t=Ni("ALL",e);return t.combinator=!0,t}function $i(e,t){var n,a=null;return ni(e)?n=e:(ii(e)?(a=e[0],n=e[1]):(a=e.context,n=e.fn),a&&ai(n)&&ni(a[n])&&(n=a[n])),{context:a,fn:n,args:t}}function xi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Ni(Ui,$i(e,n))}function Vi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Ni(Ri,$i(e,n))}function ji(e){return void 0===e&&(e=qa),Ni("CANCEL",e)}function Bi(e){void 0===e&&(e=gi);for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Ni(Ci,{selector:e,args:n})}var Wi=xi.bind(null,ui);const zi=function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e};var Ki=[],Hi=0;function qi(e){try{Xi(),e()}finally{Qi()}}function Ji(e){Ki.push(e),Hi||(Xi(),Zi())}function Yi(e){try{return Xi(),e()}finally{Zi()}}function Xi(){Hi++}function Qi(){Hi--}function Zi(){var e;for(Qi();!Hi&&void 0!==(e=Ki.shift());)qi(e)}var eo=function(e){return function(t){return e.some((function(e){return oo(e)(t)}))}},to=function(e){return function(t){return e(t)}},no=function(e){return function(t){return t.type===String(e)}},ao=function(e){return function(t){return t.type===e}},io=function(){return fi};function oo(e){var t="*"===e?io:ai(e)?no:ii(e)?eo:ci(e)?no:ni(e)?to:di(e)?ao:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var ro={type:Ba},so=function(e){return e&&e.type===Ba};function lo(){var e,t,n,a,i,o,r=(t=!1,a=n=[],i=function(){a===n&&(a=n.slice())},o=function(){t=!0;var e=n=a;a=[],e.forEach((function(e){e(ro)}))},(e={})[Ka]=!0,e.put=function(e){if(!t)if(so(e))o();else for(var i=n=a,r=0,s=i.length;r<s;r++){var l=i[r];l[za](e)&&(l.cancel(),l(e))}},e.take=function(e,n){var o;void 0===n&&(n=io),t?e(ro):(e[za]=n,i(),a.push(e),e.cancel=(o=!1,function(){o||(o=!0,i(),vi(a,e))}))},e.close=o,e),s=r.put;return r.put=function(e){e[Ha]?s(e):Ji((function(){s(e)}))},r}function co(e,t){var n=e[ja];ni(n)&&(t.cancel=n),e.then(t,(function(e){t(e,!0)}))}var uo,yo=0,fo=function(){return++yo};function po(e){e.isRunning()&&e.cancel()}var go=((uo={}).TAKE=function(e,t,n){var a=t.channel,i=void 0===a?e.channel:a,o=t.pattern,r=t.maybe,s=function(e){e instanceof Error?n(e,!0):!so(e)||r?n(e):n(Xa)};try{i.take(s,ti(o)?oo(o):null)}catch(e){return void n(e,!0)}n.cancel=s.cancel},uo.PUT=function(e,t,n){var a=t.channel,i=t.action,o=t.resolve;Ji((function(){var t;try{t=(a?a.put:e.dispatch)(i)}catch(e){return void n(e,!0)}o&&oi(t)?co(t,n):n(t)}))},uo.ALL=function(e,t,n,a){var i=a.digestEffect,o=yo,r=Object.keys(t);if(0!==r.length){var s=Pi(t,n);r.forEach((function(e){i(t[e],o,s[e],e)}))}else n(ii(t)?[]:{})},uo.RACE=function(e,t,n,a){var i=a.digestEffect,o=yo,r=Object.keys(t),s=ii(t)?Ti(r.length):{},l={},c=!1;r.forEach((function(e){var t=function(t,a){c||(a||Oi(t)?(n.cancel(),n(t,a)):(n.cancel(),c=!0,s[e]=t,n(s)))};t.cancel=pi,l[e]=t})),n.cancel=function(){c||(c=!0,r.forEach((function(e){return l[e].cancel()})))},r.forEach((function(e){c||i(t[e],o,l[e],e)}))},uo.CALL=function(e,t,n,a){var i=t.context,o=t.fn,r=t.args,s=a.task;try{var l=o.apply(i,r);if(oi(l))return void co(l,n);if(ri(l))return void Io(e,l,s.context,yo,_i(o),!1,n);n(l)}catch(e){n(e,!0)}},uo.CPS=function(e,t,n){var a=t.context,i=t.fn,o=t.args;try{var r=function(e,t){ei(e)?n(t):n(e,!0)};i.apply(a,o.concat(r)),r.cancel&&(n.cancel=r.cancel)}catch(e){n(e,!0)}},uo.FORK=function(e,t,n,a){var i=t.context,o=t.fn,r=t.args,s=t.detached,l=a.task,c=function(e){var t=e.context,n=e.fn,a=e.args;try{var i=n.apply(t,a);if(ri(i))return i;var o=!1;return bi((function(e){return o?{value:e,done:!0}:(o=!0,{value:i,done:!oi(i)})}))}catch(e){return bi((function(){throw e}))}}({context:i,fn:o,args:r}),d=function(e,t){return e.isSagaIterator?{name:e.meta.name}:_i(t)}(c,o);Yi((function(){var t=Io(e,c,l.context,yo,d,s,void 0);s?n(t):t.isRunning()?(l.queue.addTask(t),n(t)):t.isAborted()?l.queue.abort(t.error()):n(t)}))},uo.JOIN=function(e,t,n,a){var i=a.task,o=function(e,t){if(e.isRunning()){var n={task:i,cb:t};t.cancel=function(){e.isRunning()&&vi(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(ii(t)){if(0===t.length)return void n([]);var r=Pi(t,n);t.forEach((function(e,t){o(e,r[t])}))}else o(t,n)},uo.CANCEL=function(e,t,n,a){var i=a.task;t===qa?po(i):ii(t)?t.forEach(po):po(t),n()},uo.SELECT=function(e,t,n){var a=t.selector,i=t.args;try{n(a.apply(void 0,[e.getState()].concat(i)))}catch(e){n(e,!0)}},uo.ACTION_CHANNEL=function(e,t,n){var a=t.pattern,i=function(e){void 0===e&&(e=wi());var t=!1,n=[];return{take:function(a){t&&e.isEmpty()?a(ro):e.isEmpty()?(n.push(a),a.cancel=function(){vi(n,a)}):a(e.take())},put:function(a){if(!t){if(0===n.length)return e.put(a);n.shift()(a)}},flush:function(n){t&&e.isEmpty()?n(ro):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var a=0,i=e.length;a<i;a++)(0,e[a])(ro)}}}}(t.buffer),o=oo(a),r=function t(n){so(n)||e.channel.take(t,o),i.put(n)},s=i.close;i.close=function(){r.cancel(),s()},e.channel.take(r,o),n(i)},uo.CANCELLED=function(e,t,n,a){n(a.task.isCancelled())},uo.FLUSH=function(e,t,n){t.flush(n)},uo.GET_CONTEXT=function(e,t,n,a){n(a.task.context[t])},uo.SET_CONTEXT=function(e,t,n,a){var i=a.task;Si(i.context,t),n()},uo);function So(e,t){return e+"?"+t}function vo(e){var t=e.name,n=e.location;return n?t+" "+So(n.fileName,n.lineNumber):t}function ho(e){var t,n,a,i=(t=function(e){return e.cancelledTasks},n=e,(a=[]).concat.apply(a,n.map(t)));return i.length?["Tasks cancelled due to error:"].concat(i).join("\n"):""}var mo=null,bo=[],Ao=function(e){e.crashedEffect=mo,bo.push(e)},To=function(){mo=null,bo.length=0},Eo=function(){var e,t,n=bo[0],a=bo.slice(1),i=n.crashedEffect?(e=n.crashedEffect,(t=Li(e))?t.code+" "+So(t.fileName,t.lineNumber):""):null;return["The above error occurred in task "+vo(n.meta)+(i?" \n when executing effect "+i:"")].concat(a.map((function(e){return" created by "+vo(e.meta)})),[ho(bo)]).join("\n")};function ko(e,t,n,a,i,o,r){var s;void 0===r&&(r=pi);var l,c,d=0,u=null,y=[],f=Object.create(n),p=function(e,t,n){var a,i=[],o=!1;function r(e){y.push.apply(y,p.getTasks().map((function(e){return e.meta.name}))),l(),n(e,!0)}function s(t){i.push(t),t.cont=function(s,l){o||(vi(i,t),t.cont=pi,l?r(s):(t===e&&(a=s),i.length||(o=!0,n(a))))}}function l(){o||(o=!0,i.forEach((function(e){e.cont=pi,e.cancel()})),i=[])}return s(e),{addTask:s,cancelAll:l,abort:r,getTasks:function(){return i}}}(t,0,g);function g(t,n){if(n){if(d=2,Ao({meta:i,cancelledTasks:y}),S.isRoot){var a=Eo();To(),e.onError(t,{sagaStack:a})}c=t,u&&u.reject(t)}else t===Ya?d=1:1!==d&&(d=3),l=t,u&&u.resolve(t);S.cont(t,n),S.joiners.forEach((function(e){e.cb(t,n)})),S.joiners=null}var S=((s={})[Ja]=!0,s.id=a,s.meta=i,s.isRoot=o,s.context=f,s.joiners=[],s.queue=p,s.cancel=function(){0===d&&(d=1,p.cancelAll(),g(Ya,!1))},s.cont=r,s.end=g,s.setContext=function(e){Si(f,e)},s.toPromise=function(){return u||(u=zi(),2===d?u.reject(c):0!==d&&u.resolve(l)),u.promise},s.isRunning=function(){return 0===d},s.isCancelled=function(){return 1===d||0===d&&1===t.status},s.isAborted=function(){return 2===d},s.result=function(){return l},s.error=function(){return c},s);return S}function Io(e,t,n,a,i,o,r){var s=e.finalizeRunEffect((function(t,n,a){oi(t)?co(t,a):ri(t)?Io(e,t,c.context,n,i,!1,a):t&&t[Wa]?(0,go[t.type])(e,t.payload,a,d):a(t)}));u.cancel=pi;var l={meta:i,cancel:function(){0===l.status&&(l.status=1,u(Ya))},status:0},c=ko(e,l,n,a,i,o,r),d={task:c,digestEffect:y};return r&&(r.cancel=c.cancel),u(),c;function u(e,n){try{var i;n?(i=t.throw(e),To()):Ii(e)?(l.status=1,u.cancel(),i=ni(t.return)?t.return(Ya):{done:!0,value:Ya}):i=ki(e)?ni(t.return)?t.return():{done:!0}:t.next(e),i.done?(1!==l.status&&(l.status=3),l.cont(i.value)):y(i.value,a,u)}catch(e){if(1===l.status)throw e;l.status=2,l.cont(e,!0)}}function y(t,n,a,i){void 0===i&&(i="");var o,r=fo();function l(n,i){o||(o=!0,a.cancel=pi,e.sagaMonitor&&(i?e.sagaMonitor.effectRejected(r,n):e.sagaMonitor.effectResolved(r,n)),i&&function(e){mo=e}(t),a(n,i))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:r,parentEffectId:n,label:i,effect:t}),l.cancel=pi,a.cancel=function(){o||(o=!0,l.cancel(),l.cancel=pi,e.sagaMonitor&&e.sagaMonitor.effectCancelled(r))},s(t,r,l)}}function Oo(e,t){for(var n=e.channel,a=void 0===n?lo():n,i=e.dispatch,o=e.getState,r=e.context,s=void 0===r?{}:r,l=e.sagaMonitor,c=e.effectMiddlewares,d=e.onError,u=void 0===d?Ai:d,y=arguments.length,f=new Array(y>2?y-2:0),p=2;p<y;p++)f[p-2]=arguments[p];var g,S=t.apply(void 0,f),v=fo();if(l&&(l.rootSagaStarted=l.rootSagaStarted||pi,l.effectTriggered=l.effectTriggered||pi,l.effectResolved=l.effectResolved||pi,l.effectRejected=l.effectRejected||pi,l.effectCancelled=l.effectCancelled||pi,l.actionDispatched=l.actionDispatched||pi,l.rootSagaStarted({effectId:v,saga:t,args:f})),c){var h=ze.apply(void 0,c);g=function(e){return function(t,n,a){return h((function(t){return e(t,n,a)}))(t)}}}else g=gi;var m={channel:a,dispatch:Ei(i),getState:o,sagaMonitor:l,onError:u,finalizeRunEffect:g};return Yi((function(){var e=Io(m,S,s,v,_i(t),!0,void 0);return l&&l.effectResolved(v,e),e}))}const Po=function(e){var t,n=void 0===e?{}:e,a=n.context,i=void 0===a?{}:a,o=n.channel,r=void 0===o?lo():o,s=n.sagaMonitor,l=Za(n,["context","channel","sagaMonitor"]);function c(e){var n=e.getState,a=e.dispatch;return t=Oo.bind(null,M({},l,{context:i,channel:r,dispatch:a,getState:n,sagaMonitor:s})),function(e){return function(t){s&&s.actionDispatched&&s.actionDispatched(t);var n=e(t);return r.put(t),n}}}return c.run=function(){return t.apply(void 0,arguments)},c.setContext=function(e){Si(i,e)},c};var _o=function(e){return{done:!0,value:e}},Lo={};function wo(e){return li(e)?"channel":ci(e)?String(e):ni(e)?e.name:String(e)}function Do(e,t,n){var a,i,o,r=t;function s(t,n){if(r===Lo)return _o(t);if(n&&!i)throw r=Lo,n;a&&a(t);var s=n?e[i](n):e[r]();return r=s.nextState,o=s.effect,a=s.stateUpdater,i=s.errorState,r===Lo?_o(t):o}return bi(s,(function(e){return s(null,e)}),n)}function Uo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r={done:!1,value:Mi(e)},s=function(e){return{done:!1,value:Vi.apply(void 0,[t].concat(a,[e]))}},l=function(e){return o=e};return Do({q1:function(){return{nextState:"q2",effect:r,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:s(o)}}},"q1","takeEvery("+wo(e)+", "+t.name+")")}function Ro(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r,s={done:!1,value:Mi(e)},l=function(e){return{done:!1,value:Vi.apply(void 0,[t].concat(a,[e]))}},c=function(e){return{done:!1,value:ji(e)}},d=function(e){return o=e},u=function(e){return r=e};return Do({q1:function(){return{nextState:"q2",effect:s,stateUpdater:u}},q2:function(){return o?{nextState:"q3",effect:c(o)}:{nextState:"q1",effect:l(r),stateUpdater:d}},q3:function(){return{nextState:"q1",effect:l(r),stateUpdater:d}}},"q1","takeLatest("+wo(e)+", "+t.name+")")}function Co(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r={done:!1,value:Mi(e)},s=function(e){return{done:!1,value:xi.apply(void 0,[t].concat(a,[e]))}},l=function(e){return o=e};return Do({q1:function(){return{nextState:"q2",effect:r,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:s(o)}}},"q1","takeLeading("+wo(e)+", "+t.name+")")}function No(e,t,n){for(var a=e,i=arguments.length,o=new Array(i>3?i-3:0),r=3;r<i;r++)o[r-3]=arguments[r];var s={done:!1,value:xi.apply(void 0,[n].concat(o))},l={done:!1,value:Wi(t)};return Do({q1:function(){return{nextState:"q2",effect:s,errorState:"q10"}},q2:function(){return{nextState:Lo}},q10:function(e){if((a-=1)<=0)throw e;return{nextState:"q1",effect:l}}},"q1","retry("+n.name+")")}function Mo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Vi.apply(void 0,[Uo,e,t].concat(a))}function Fo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Vi.apply(void 0,[Ro,e,t].concat(a))}function Go(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Vi.apply(void 0,[Co,e,t].concat(a))}class $o{constructor(){this.context=null,this.accessToken=null,this.user=null,this.requestSource=null,this.onRedirectTo=e=>window.location.href=e,this.logout=()=>window.location.href="/account/logout",this.entitlementsOptions=null,this.appName=null,this.sessionContext=void 0}static getInstance(){return $o.instance||($o.instance=new $o),$o.instance}static setContext(e){$o.getInstance().context=e}static setAccessToken(e){$o.getInstance().accessToken=e}static setUser(e){$o.getInstance().user=e}static setRequestSource(e){$o.getInstance().requestSource=e}static setOnRedirectTo(e){$o.getInstance().onRedirectTo=e}static setLogout(e,t){$o.getInstance().logout=n=>{n?e(n):$o.onRedirectTo(t)}}static setEntitlementsOptions(e){$o.getInstance().entitlementsOptions=e}static setSessionContext(e){$o.getInstance().sessionContext=e}static setAppName(e){$o.getInstance().appName=e}static getContext(){var e;return null!=(e=$o.getInstance().context)?e:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}}static getAccessToken(){return $o.getInstance().accessToken}static getRequestSource(){return $o.getInstance().requestSource}static getUser(){return $o.getInstance().user}static onRedirectTo(e,t){return $o.getInstance().onRedirectTo(e,t)}static logout(e){return $o.getInstance().logout(e)}static shouldLoadEntitlements(){var e;return(null==(e=$o.getInstance().entitlementsOptions)?void 0:e.enabled)||!1}static isSessionPerTenantEnabled(){var e;return(null==(e=$o.getInstance().sessionContext)?void 0:e.enableSessionPerTenant)||!1}static getAppName(){return $o.getInstance().appName}}$o.instance=void 0;const xo={getContext:()=>$o.getContext(),getAccessToken:()=>$o.getAccessToken(),getUser:()=>$o.getUser(),onRedirectTo:(e,t)=>$o.onRedirectTo(e,t),logout:e=>$o.logout(e)};class Vo extends Error{constructor(e,t){super(e),this._statusCode=void 0,this._statusCode=t}get statusCode(){return this._statusCode}}const jo={v1:"/identity/resources/users/webauthn/v1/devices"},Bo={v1:"/identity/resources/auth/v1",v2:"/identity/resources/auth/v2"},Wo={v1:"/identity/resources/users/v1",v2:"/identity/resources/users/v2",v3:"/identity/resources/users/v3",roles:{v3:"/identity/resources/users/v3/roles"},groups:{v3:"/identity/resources/users/v3/groups"},tenants:{me:{v1:"/identity/resources/users/v1/me/tenants",v3:"/identity/resources/users/v3/me/tenants"}},apiTokens:{v1:"/identity/resources/users/api-tokens/v1"},accessTokens:{v1:"/identity/resources/users/access-tokens/v1"},sessions:{v1:"/identity/resources/users/sessions/v1",currentUser:{v1:"/identity/resources/users/sessions/v1/me"},configurations:{v1:"/identity/resources/configurations/sessions/v1"}},invitation:{resendAll:{v1:"/identity/resources/users/v1/invitation/reset/all"}},passwords:{resetBreachedPasswords:{v1:"/identity/resources/users/v1/passwords/breached/reset/bulk"}},authorization:{v1:"/identity/resources/users/v1/me/authorization"},temporary:{v1:"/identity/resources/users/temporary/v1",configuration:{v1:"/identity/resources/users/temporary/v1/configuration"}}},zo={v1:"/identity/resources/configurations/v1"},Ko={emailDomain:{v1:"/identity/resources/configurations/restrictions/v1/email-domain"},ip:{v1:"/identity/resources/configurations/v1/restrictions/ip"}},Ho={v1:"/identity/resources/sso/v1",v2:"/identity/resources/sso/v2",custom:{v1:"/identity/resources/sso/custom/v1"}},qo={v1:"/identity/resources/permissions/v1"},Jo={apiTokens:{v1:"/identity/resources/tenants/api-tokens/v1",v2:"/identity/resources/tenants/api-tokens/v2"},accessTokens:{v1:"/identity/resources/tenants/access-tokens/v1"},invites:{user:{v1:"/identity/resources/tenants/invites/v1/user"},verify:{v1:"/identity/resources/tenants/invites/v1/verify"},configuration:{v1:"/identity/resources/tenants/invites/v1/configuration"}},users:{v1:"/identity/resources/tenants/users/v1"}},Yo={v1:"/identity/resources/roles/v1",v2:"/identity/resources/roles/v2"},Xo={v1:"/identity/resources/sub-tenants/users/v1",v2:"/identity/resources/sub-tenants/users/v2"},Qo={v1:"/identity/resources/impersonation/v1"},Zo={v1:"/identity/resources/groups/v1",configurations:{v1:"/identity/resources/groups/v1/config"},getByIds:{v1:"/identity/resources/groups/v1/bulkGet"}},er={v1:"/identity/resources/users/phone-numbers/v1"},tr={v1:"/team/resources/sso/v1",v2:"/team/resources/sso/v2"},nr={v1:"/team/resources/members/v1"},ar={v1:"/team/resources/roles/v1"},ir={v1:"/team/resources/stats/v1"},or={v1:"/team/resources/profile"},rr={v1:"/tenants/resources/account-settings/v1"},sr={v1:"/tenants/resources/hierarchy/v1",tree:{v1:"/tenants/resources/hierarchy/v1/tree"},parents:{v1:"/tenants/resources/hierarchy/v1/parents"},v2:"/tenants/resources/hierarchy/v2",metadata:{v2:"/tenants/resources/hierarchy/v2/metadata"}},lr={v1:"/tenants/resources/sub-tenants/v1"},cr={v1:"/integrations/resources/configurations/v1",v2:"/integrations/resources/configurations/v2"},dr={subscriptions:{v1:"/subscriptions/resources/billing/subscriptions/v1"},plans:{v1:"/subscriptions/resources/billing/plans/v1"},invoices:{v1:"/subscriptions/resources/billing/invoices/v1"},paymentMethods:{v1:"/subscriptions/resources/billing/payment-methods/v1"},summaries:{v1:"/subscriptions/resources/billing/summaries/v1"},tenantConfiguration:{v1:"/subscriptions/resources/billing/tenant-configurations/v1"},configurations:{vendorPublicConfigurations:{v1:"/subscriptions/resources/billing/configurations/vendor-public-configurations/v1"}},paymentProviders:{stripe:{customers:{v1:"/subscriptions/resources/billing/payment-providers/stripe/customers/v1"},publicConfigurations:{v1:"/subscriptions/resources/billing/payment-providers/stripe/public-configurations/v1"},subscriptions:{v1:"/subscriptions/resources/billing/payment-providers/stripe/subscriptions/v1"},setupIntents:{v1:"/subscriptions/resources/billing/payment-providers/stripe/setup-intents/v1"}}}},ur={v1:"/subscriptions/resources/payment-providers/v1"},yr={v1:"/subscriptions/resources/subscriptions/v1"},fr={v1:"/reports/resources/reports/v1",v2:"/reports/resources/reports/v2"},pr={v1:"/reports/engine/resources/triggers/v1"},gr="/notification",Sr="/audits",vr={v1:"/event/resources/configurations/v1"},hr="/webhook",mr="/oauth",br="/flags",Ar="/directory/resources/v1/configurations/scim2",Tr="/directory/resources/scim/temp",Er="/entitlements/api/v1/user-entitlements",kr="/entitlements/api/v2/user-entitlements",Ir={v1:"/security-center/resources/recommendations/v1"},Or={v1:"/security-center/resources/insights/v1"};function Pr(e,t,n=!0){let a;a="function"==typeof e.baseUrl?e.baseUrl(t):e.baseUrl;const i=e.urlPrefix||"frontegg",o="frontegg"===i&&!n;return a.endsWith("/")||(a+="/"),a.endsWith(i)||o||(a+=i),a}function _r(e){var t,n;const a={};return null!=e&&null!=(t=e.metadataHeaders)&&t.fronteggSdkVersion&&(a[sa.fronteggSdkVersion]=e.metadataHeaders.fronteggSdkVersion),null!=e&&null!=(n=e.metadataHeaders)&&n.framework&&(a[sa.frameWork]=e.metadataHeaders.framework),a}function Lr(){return new URLSearchParams(window.location.search).get("tenantId")||null}const wr=async e=>{var t,n,a;const i=$o.getContext(),o=await async function(e,t){var n;const a=_r(e),i=await(null!=(n=null==e?void 0:e.tokenResolver)?n:$o.getAccessToken)(),o=$o.getRequestSource(),r=Lr();t&&(a[sa.contentType]=t),o&&(a[sa.source]=o),i&&(a.Authorization=`Bearer ${i}`),r&&(a[sa.scopedTenant]=r);for(const t of await async function(e){let t=[];if(e.additionalHeadersResolver&&(t=await e.additionalHeadersResolver()),e.tenantResolver){const n=await e.tenantResolver();null!=n&&n.tenant&&t.push({key:"frontegg-login-alias",value:n.tenant})}return t}(e))a[`${t.key}`]=`${t.value}`;return a}(i,e.contentType),r=await async function(e,t,n){const a=Pr(e,t),i=await async function(e,t){t||(t={});const n=await async function(e){let t=[];return e.additionalQueryParamsResolver&&(t=await e.additionalQueryParamsResolver()),t}(e);for(const e of n)t[e.key]=e.value;const a=Object.keys(t);for(const e of a){const n=t[e];t[e]="object"==typeof n?JSON.stringify(n):n}return t}(e,n);let o=t.startsWith("http")?t:`${a}${t}`;const r=Object.keys(i).length>0;return i&&r&&(o+=`?${new URLSearchParams(i)}`),o}(i,e.url,e.params),s=await fetch(r,{body:e.body?"application/json"===e.contentType?JSON.stringify(e.body):e.body:null,method:null!=(t=e.method)?t:"GET",headers:M({},o,e.headers),credentials:null!=(n=null!=(a=e.credentials)?a:i.requestCredentials)?n:"same-origin"});if(302===s.status)return window.location.href=await s.text(),new Promise((()=>{}));if(!s.ok){var l,c;if(413===s.status)throw new Vo("Error request is too large",s.status);let e,t=!0;try{e=await s.text(),e=JSON.parse(e)}catch(e){t=!1}throw e.errors?e=e.errors.join(", "):"string"!=typeof e&&(e=`Error ${s.status} - ${s.statusText}`),s.status>=400&&s.status<500&&["warn"].includes(null!=(l=i.logLevel)?l:"")?console.warn(e):500===s.status&&["warn","error"].includes(null!=(c=i.logLevel)?c:"")&&console.error(e),new Vo(t?e:"We're facing some difficulties, Please try again",s.status)}if(e.responseType&&"json"!==e.responseType){if("blob"===e.responseType){const{outputFileName:t}=e.params;return await s.blob().then((e=>URL.createObjectURL(e))).then((e=>{const n=document.createElement("a");n.href=e,n.setAttribute("download",t||"output"),n.click()}))}return await s.text()}try{return await s.json()}catch(e){return{}}},Dr=async(e,t,n)=>wr(M({url:e,method:"GET",contentType:"application/json",params:t},n)),Ur=async(e,t,n)=>wr(M({url:e,method:"POST",contentType:"application/json",body:t},n)),Rr=async(e,t,n)=>wr(M({url:e,method:"PATCH",contentType:"application/json",body:t},n)),Cr=async(e,t,n)=>wr(M({url:e,method:"PUT",contentType:"application/json",body:t},n)),Nr=async(e,t,n)=>wr(M({url:e,method:"DELETE",contentType:"application/json",body:t},n)),Mr=async(e,t,n,a)=>wr(M({url:e,method:"POST",contentType:"application/json",responseType:"blob",body:t,params:n},a)),Fr=(e={})=>M({},e.jwt?{Authorization:e.jwt}:{}),Gr="FRONTEGG_SEPARATE_TABS_BY_TENANT",$r="admin_portal_use_entitlements_v2_endpoint",xr={flags:{}};class Vr{constructor(){var e;this._flags={},this._flags=null!=(e=xr.flags)?e:{}}static getInstance(e="default"){return this._instances[e]}static set(e,t="default"){const n=new Vr;return n.set(e),Vr._instances[t]=n,n}static getFeatureFlags(e,t){const n=this.getInstance(t);return e.map((e=>"on"===(null==n?void 0:n._flags[e])))}get flags(){var e;return null!=(e=this.flags)?e:{}}set(e){var t;this._flags=M({},null!=(t=null==xr?void 0:xr.flags)?t:{},null!=e?e:{})}}async function jr(){return Dr(br)}async function Br(e){return Ur(`${Wo.v3}/me/token`,e)}async function Wr(e,t){return Dr(Wo.v2,e,{headers:Fr(t)})}async function zr(e,t){return Dr(Wo.v3,e,{headers:Fr(t)})}async function Kr(e,t){return Dr(Wo.roles.v3,M({},e,{ids:e.ids.join(",")}),{headers:Fr(t)})}async function Hr(e,t){return Dr(Wo.groups.v3,M({},e,{ids:e.ids.join(",")}),{headers:Fr(t)})}async function qr(e){return Dr(Wo.tenants.me.v3,void 0,{headers:Fr(e)})}async function Jr(e){return Dr(Wo.tenants.me.v1,void 0,{headers:Fr(e)})}async function Yr(){return Ur(Wo.passwords.resetBreachedPasswords.v1)}async function Xr(e){return Cr(`${Wo.v2}/me`,e)}function Qr(e){e&&sessionStorage.setItem(Gr,e)}function Zr(){sessionStorage.removeItem(Gr)}function es(){return $o.isSessionPerTenantEnabled()?sessionStorage.getItem(Gr):null}function ts(){const[e]=Vr.getFeatureFlags(["admin_portal_use_current_user_tenants_v1_endpoint"],$o.getAppName()||"");return $o.isSessionPerTenantEnabled()||e?Jr:qr}async function ns(e){return $o.isSessionPerTenantEnabled()&&Qr(e.tenantId),Cr(`${Wo.v1}/tenant`,e)}async function as(){return Dr(`${Wo.v2}/me/tenants`)}async function is(e){return Dr(sr.v1,void 0,{headers:Fr(e)})}async function os(e){return Dr(sr.tree.v1,void 0,{headers:Fr(e)})}async function rs(e){return Dr(sr.parents.v1,void 0,{headers:Fr(e)})}async function ss(e,t){return Dr(`${sr.parents.v1}/${e}`,void 0,{headers:Fr(t)})}async function ls(e,t){return Ur(`${Jo.users.v1}/count`,e,{headers:Fr(t)})}async function cs(e,t){return Dr(sr.v2,e,{headers:Fr(t)})}async function ds(e,t){return Dr(sr.metadata.v2,M({},e,{_tenantIds:e._tenantIds.join(",")}),{headers:Fr(t)})}async function us(){return Dr(zo.v1)}async function ys(){return Dr(`${zo.v1}/mfa-policy`)}async function fs(){return Dr(`${zo.v1}/mfa-policy/vendor`)}async function ps(e){return e.id?Rr(`${zo.v1}/mfa-policy`,e):Ur(`${zo.v1}/mfa-policy`,e)}async function gs(){return Dr(`${zo.v1}/lockout-policy`)}async function Ss(){return Dr(`${zo.v1}/lockout-policy/vendor`)}async function vs(e){return e.id?Rr(`${zo.v1}/lockout-policy`,e):Ur(`${zo.v1}/lockout-policy`,e)}async function hs(){try{return await Dr(`${zo.v1}/captcha-policy/public`)}catch{return null}}async function ms(){return Dr(`${zo.v1}/password-history-policy`)}async function bs(){return Dr(`${zo.v1}/password-history-policy/vendor`)}async function As(e){return e.id?Rr(`${zo.v1}/password-history-policy`,e):Ur(`${zo.v1}/password-history-policy`,e)}async function Ts(){return Dr(`${zo.v1}/password`)}async function Es(){return Dr(`${Ko.emailDomain.v1}`)}async function ks(){return Dr(`${Ko.emailDomain.v1}/config`)}async function Is(e){return Ur(`${Ko.emailDomain.v1}`,e)}async function Os(e){return Ur(`${Ko.emailDomain.v1}/config`,e)}async function Ps(e){return Nr(`${Ko.emailDomain.v1}/${e}`)}async function _s(e){return Dr(`${Ko.ip.v1}`,e)}async function Ls(){return Dr(`${Ko.ip.v1}/config`)}async function ws(e){return Ur(`${Ko.ip.v1}`,e)}async function Ds(e){return Ur(`${Ko.ip.v1}/bulk`,e)}async function Us(e){return Ur(`${Ko.ip.v1}/config`,e)}async function Rs(e){return Nr(`${Ko.ip.v1}/${e}`)}async function Cs(){return Ur(`${Ko.ip.v1}/verify`)}async function Ns(){return Ur(`${Ko.ip.v1}/verify/allow`)}Vr._instances={};class Ms extends Error{constructor(e){super(e)}}const Fs="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){const t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Ms("'atob' failed: The string to be decoded is not correctly encoded.");let n="";for(let e,a,i=0,o=0;a=t.charAt(o++);~a&&(e=i%4?64*e+a:a,i++%4)?n+=String.fromCharCode(255&e>>(-2*i&6)):0)a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a);return n};class Gs extends Error{constructor(e){super(e)}}const $s=(e,t={})=>{const n=t.header?0:1;try{return JSON.parse((e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent(Fs(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return Fs(t)}})(e.split(".")[n]))}catch(e){throw new Gs("Invalid token specified: "+e.message)}};let xs,Vs,js;!function(e){e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SmsCode="SmsCode",e.SmsCodeV2="SmsCodeV2",e.Passkeys="Passkeys"}(xs||(xs={})),function(e){e.Platform="Platform",e.CrossPlatform="CrossPlatform"}(Vs||(Vs={})),function(e){e.AuthenticatorApp="AuthenticatorApp",e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SMS="SMS",e.EmailCode="EmailCode"}(js||(js={}));const Bs="admin_portal_should_load_authorization";async function Ws(){return Dr(Er)}async function zs(){return Dr(kr)}let Ks;!function(e){e.MISSING_PERMISSION="MISSING_PERMISSION",e.MISSING_FEATURE="MISSING_FEATURE",e.BUNDLE_EXPIRED="BUNDLE_EXPIRED"}(Ks||(Ks={}));const Hs="admin_portal_entitlements",qs=["type"],Js=["type"],Ys=["type"];async function Xs(e){if(!e.accessToken)return e;$o.setAccessToken(e.accessToken);const t=await $d(),n=M({},e,e.accessToken?$s(e.accessToken):{},t);return $o.setUser(n),n}async function Qs(e){if(!e.accessToken)return{user:e};$o.setAccessToken(e.accessToken);const[t,n]=await Promise.all([$d(),as()]),a=M({},e,e.accessToken?$s(e.accessToken):{},t);return $o.setUser(a),{user:a,tenants:n}}function Zs(){if(!$o.shouldLoadEntitlements())return!1;const[e]=Vr.getFeatureFlags([Hs],$o.getAppName()||"");return e}function el(){const[e]=Vr.getFeatureFlags([Bs],$o.getAppName()||"");return e}async function tl(e){const{accessToken:t}=e;if(!t)return{user:e};$o.setAccessToken(t);const[n,a]=await Promise.all([$d(),ts()()]),i=M({},e,t?$s(t):{},n);return $o.isSessionPerTenantEnabled()&&Qr(i.tenantId),$o.setUser(i),{user:i,tenants:a.tenants,activeTenant:a.activeTenant}}async function nl(e){$o.setAccessToken(e.id_token);const t=await $d(),n=e.id_token?$s(e.id_token):{},a=M({mfaRequired:!1,accessToken:e.id_token,refreshToken:e.refresh_token},n,t,{expiresIn:e.expires_in||300});return $o.setUser(a),a}async function al(e){$o.setAccessToken(e.id_token);const[t,n]=await Promise.all([$d(),ts()()]),a=e.id_token?$s(e.id_token):{},i=M({mfaRequired:!1,accessToken:e.id_token,refreshToken:e.refresh_token},a,t,{expiresIn:e.expires_in||300});return $o.isSessionPerTenantEnabled()&&Qr(i.tenantId),$o.setUser(i),{user:i,tenants:n.tenants,activeTenant:n.activeTenant}}async function il(e){try{const{address:t}=await Ur(`${Bo.v1}/user/saml/prelogin`,e);return t}catch{return null}}async function ol(e){return Ur(`${Bo.v1}/user/saml/prelogin`,e)}async function rl(e){return Xs(await Ur(`${Bo.v1}/user/saml/postlogin`,e))}async function sl(e){return Xs(await Ur(`${Bo.v1}/user/oidc/postlogin`,e))}async function ll(e){return Xs(await Ur(`${Bo.v1}/user`,e))}async function cl(e){return tl(await Ur(`${Bo.v1}/user`,e))}async function dl(e){return Xs(await Ur(`${Bo.v1}/user/mfa/verify`,e))}async function ul(e){return tl(await Ur(`${Bo.v1}/user/mfa/verify`,e))}async function yl(e){return Ur(`${Wo.v1}/activate`,e)}async function fl(e){return tl(await Ur(`${Wo.v1}/activate`,e))}async function pl(e){return Dr(`${Wo.v1}/activate/strategy`,e)}async function gl(e){return Ur(`${Wo.v1}/activate/reset`,e)}async function Sl(e){return Ur(`${Wo.v1}/invitation/reset`,e)}async function vl(e){return Ur(`${Wo.v1}/invitation/accept`,e)}async function hl(){const e=es();return Xs(await Ur(`${Bo.v1}/user/token/refresh`,{tenantId:e}))}async function ml(){const e=es();return Qs(await Ur(`${Bo.v1}/user/token/refresh`,{tenantId:e}))}async function bl(){const e=es();return tl(await Ur(`${Bo.v1}/user/token/refresh`,{tenantId:e}))}async function Al(){return Ur(`${Bo.v1}/logout`)}async function Tl(e){return Dr(`${mr}/logout`,e)}async function El(e){return Ur(`${Wo.v1}/passwords/reset`,e)}async function kl(e){return Ur(`${Wo.v1}/passwords/reset/verify`,e)}async function Il(e){return Dr(`${Wo.v1}/passwords/config`,e)}async function Ol(e){return Ur(`${Bo.v1}/user/mfa/recover`,e)}async function Pl(){return Ur(`${Wo.v1}/mfa/enroll`)}async function _l(){return Ur(`${Wo.v1}/mfa/authenticator/enroll`)}async function Ll(e){return Ur(`${Wo.v1}/mfa/authenticator/enroll/verify`,e)}async function wl(e){return Ur(`${Wo.v1}/mfa/sms/enroll`,e)}async function Dl(e){return Ur(`${Wo.v1}/mfa/sms/enroll/verify`,e)}async function Ul(){return Ur(`${Wo.v1}/mfa/webauthn/enroll`)}async function Rl(e){return Ur(`${Wo.v1}/mfa/webauthn/enroll/verify`,e)}async function Cl(e){return Ur(`${Wo.v1}/mfa/enroll/verify`,e)}async function Nl(e){return Ur(`${Wo.v1}/mfa/disable`,e)}async function Ml(e,t){return Ur(`${Wo.v1}/mfa/authenticator/${e}/disable/verify`,t)}async function Fl(e){return Ur(`${Wo.v1}/mfa/sms/${e}/disable`)}async function Gl(e,t){return Ur(`${Wo.v1}/mfa/sms/${e}/disable/verify`,t)}async function $l(e){return Ur(`${Wo.v1}/mfa/webauthn/${e}/disable`)}async function xl(e,t){return Ur(`${Wo.v1}/mfa/webauthn/${e}/disable/verify`,t)}async function Vl(){return Dr(`${Wo.v1}/mfa/devices`)}async function jl(e){return Ur(`${Bo.v1}/user/mfa/authenticator/enroll`,e)}async function Bl(e){return Ur(`${Bo.v1}/user/mfa/authenticator/enroll/verify`,e)}async function Wl(e){return tl(await Ur(`${Bo.v1}/user/mfa/authenticator/enroll/verify`,e))}async function zl(e,t){return Ur(`${Bo.v1}/user/mfa/authenticator/${e}/verify`,t)}async function Kl(e){return Ur(`${Bo.v1}/user/mfa/emailcode`,e)}async function Hl(e){return Ur(`${Bo.v1}/user/mfa/emailcode/verify`,e)}async function ql(e){return tl(await Ur(`${Bo.v1}/user/mfa/emailcode/verify`,e))}async function Jl(e){return Ur(`${Bo.v1}/user/mfa/sms/enroll`,e)}async function Yl(e){return Ur(`${Bo.v1}/user/mfa/sms/enroll/verify`,e)}async function Xl(e){return tl(await Ur(`${Bo.v1}/user/mfa/sms/enroll/verify`,e))}async function Ql(e,t){return Ur(`${Bo.v1}/user/mfa/sms/${e}`,t)}async function Zl(e,t){return Ur(`${Bo.v1}/user/mfa/sms/${e}/verify`,t)}async function ec(e,t){return tl(await Ur(`${Bo.v1}/user/mfa/sms/${e}/verify`,t))}async function tc(e){return Ur(`${Bo.v1}/user/mfa/webauthn/enroll`,e)}async function nc(e){return Ur(`${Bo.v1}/user/mfa/webauthn/enroll/verify`,e)}async function ac(e){return tl(await Ur(`${Bo.v1}/user/mfa/webauthn/enroll/verify`,e))}async function ic(e,t){return Ur(`${Bo.v1}/user/mfa/webauthn/${e}`,t)}async function oc(e,t){return Ur(`${Bo.v1}/user/mfa/webauthn/${e}/verify`,t)}async function rc(e,t){return tl(await Ur(`${Bo.v1}/user/mfa/webauthn/${e}/verify`,t))}async function sc(){return Dr(`${tr.v1}/saml/configurations`)}async function lc(e){return Ur(`${tr.v1}/saml/configurations`,e)}async function cc(){return Dr(`${tr.v1}/saml/configurations/vendor-config`)}async function dc(e){return Cr(`${tr.v1}/saml/configurations/metadata`,e)}async function uc(){return Cr(`${tr.v1}/saml/validations/domain`)}async function yc(){return Dr(`${tr.v1}/saml/configurations/roles/default`)}async function fc(){return Dr(`${tr.v2}/saml/configurations/groups`)}async function pc({roleIds:e}){return Ur(`${tr.v1}/saml/configurations/roles/default`,{roleIds:e})}async function gc({roleIds:e,group:t}){return Ur(`${tr.v2}/saml/configurations/groups`,{group:t,roleIds:e})}async function Sc({roleIds:e,group:t,id:n}){return Rr(`${tr.v2}/saml/configurations/groups/${n}`,{group:t,roleIds:e})}async function vc({id:e}){return Nr(`${tr.v2}/saml/configurations/groups/${e}`)}async function hc(){return Dr(`${tr.v1}/oidc/configurations`)}async function mc(){return Dr(`${tr.v2}/configurations/public`)}async function bc(){return Dr(Ho.v1)}async function Ac(){return Dr(Ho.v2)}async function Tc(){return Dr(`${Ho.v2}/authenticated`)}async function Ec(){return Dr(Ho.custom.v1)}async function kc({provider:e,code:t,idToken:n,redirectUri:a,codeVerifier:i,metadata:o,invitationToken:r,state:s}){const l={};return t&&(l.code=t),n&&(l.id_token=n),a&&(l.redirectUri=a),i&&(l.code_verifier=i),s&&(l.state=s),Ur(`${Bo.v1}/user/sso/${e}/postlogin`,{metadata:o,invitationToken:r},{params:l})}async function Ic(){return Dr(`${zo.v1}/public`)}async function Oc(e){const{shouldActivate:t,authResponse:n,userId:a,tenantId:i}=await Ur(`${Wo.v1}/signUp`,e),o={shouldActivate:t,userId:a,tenantId:i};if(!t&&n){const{user:e,tenants:t,activeTenant:a}=await tl(n);return M({},o,{user:e,tenants:t,activeTenant:a})}return o}async function Pc(){return Dr(Wo.sessions.currentUser.v1)}async function _c(){return Dr(`${Wo.sessions.currentUser.v1}/current`)}async function Lc(e){return Ur(`${Wo.sessions.v1}/revoke`,{userId:e})}async function wc(){return Dr(Wo.sessions.configurations.v1)}async function Dc(e){await Ur(Wo.sessions.configurations.v1,e)}async function Uc(e){await Nr(`${Wo.sessions.currentUser.v1}/${e}`)}async function Rc(){await Nr(`${Wo.sessions.currentUser.v1}/all`)}async function Cc(){return Dr(Wo.accessTokens.v1)}async function Nc(){return Dr(Jo.accessTokens.v1)}async function Mc({id:e}){return Nr(`${Jo.accessTokens.v1}/${e}`)}async function Fc({id:e}){return Nr(`${Wo.accessTokens.v1}/${e}`)}async function Gc(e){return Ur(Wo.accessTokens.v1,e)}async function $c(e){return Ur(Jo.accessTokens.v1,e)}async function xc(){return Dr(Wo.apiTokens.v1)}async function Vc(){return Dr(Jo.apiTokens.v1)}async function jc(e){return Ur(Wo.apiTokens.v1,e)}async function Bc(e){return Ur(Jo.apiTokens.v2,e)}async function Wc({tokenId:e}){return Nr(`${Jo.apiTokens.v1}/${e}`)}async function zc({tokenId:e}){return Nr(`${Wo.apiTokens.v1}/${e}`)}async function Kc({userId:e}){return Dr(`${Wo.v1}/${e}`)}async function Hc(e){return Dr(`${zo.v1}/mfa-policy/allow-remember-device`,{mfaToken:e})}async function qc(e){let{type:t}=e,n=Za(e,qs);return Ur(`${Bo.v1}/passwordless/${t.toLocaleLowerCase()}/prelogin`,n)}async function Jc(e){let{type:t}=e,n=Za(e,Js);return tl(await Ur(`${Bo.v1}/passwordless/${t.toLocaleLowerCase()}/postlogin`,n))}async function Yc(e){let{type:t}=e,n=Za(e,Ys);return Ur(`${Bo.v1}/passwordless/${t.toLocaleLowerCase()}/postlogin`,n)}async function Xc({token:e}){return Ur(Jo.invites.verify.v1,{token:e})}async function Qc(){return Dr(`${tr.v1}/configurations`)}async function Zc(e){return Ur(`${tr.v1}/configurations`,e)}async function ed(e,t){return Rr(`${tr.v1}/configurations/${e}`,t)}async function td(e){return Nr(`${tr.v1}/configurations/${e}`)}async function nd(e){return Ur(`${tr.v1}/configurations/metadata`,e)}async function ad(e,t){return Cr(`${tr.v1}/configurations/${e}/metadata`,t)}async function id(e){return Ur(`${tr.v1}/configurations/metadata-url`,e)}async function od(e,t){return Cr(`${tr.v1}/configurations/${e}/metadata-url`,t)}async function rd(e,t){return Ur(`${tr.v1}/configurations/${e}/domains`,t)}async function sd(e,t){return Nr(`${tr.v1}/configurations/${e}/domains/${t}`)}async function ld(e,t){return Cr(`${tr.v1}/configurations/${e}/domains/${t}/validate`)}async function cd(e){return Dr(`${tr.v1}/configurations/${e}/roles`)}async function dd(e,t){return Cr(`${tr.v1}/configurations/${e}/roles`,t)}async function ud(e,t){return Ur(`${tr.v1}/configurations/${e}/groups`,t)}async function yd(e,{roleIds:t,group:n,id:a}){return Rr(`${tr.v1}/configurations/${e}/groups/${a}`,{group:n,roleIds:t})}async function fd(e,t){return Nr(`${tr.v1}/configurations/${e}/groups/${t}`)}async function pd(e){return Dr(`${tr.v1}/configurations/${e}/groups`)}async function gd(e){return Ur(`${Bo.v2}/user/sso/prelogin`,e)}async function Sd(e){return Xs(await Ur(`${Bo.v2}/user/oidc/postlogin`,e))}async function vd(e){return al(await Ur(`${mr}/token`,e))}async function hd(){const e=es();return al(await Ur(`${mr}/authorize/silent`,{tenantId:e}))}async function md(e){return nl(await Ur(`${mr}/token`,e))}async function bd(){const e=es();return nl(await Ur(`${mr}/authorize/silent`,{tenantId:e}))}async function Ad(e){return Ur(`${Wo.v1}/phone/reset`,e)}async function Td(e){return Ur(`${Wo.v1}/phone/reset/verify`,e)}async function Ed(e){return Ur(`${Wo.v1}/phone`,e)}async function kd(e){return Ur(`${Wo.v1}/phone/verify`,e)}async function Id(e){return Cr(`${Wo.v1}/phone/change`,e)}async function Od(e){return Ur(`${Bo.v1}/webauthn/prelogin`,e)}async function Pd(e){return Ur(`${Bo.v1}/webauthn/postlogin`,e)}async function _d(e){return tl(await Ur(`${Bo.v1}/webauthn/postlogin`,e))}async function Ld(){return Ur(jo.v1)}async function wd(){return Dr(jo.v1)}async function Dd(e){return Nr(`${jo.v1}/${e}`)}async function Ud(e){return Ur(`${jo.v1}/verify`,e)}async function Rd(){return Dr(`${zo.v1}/auth/strategies/public`)}async function Cd(){return Dr(`${zo.v1}/auth/strategies`)}async function Nd(){return Dr(`${zo.v1}/mfa/strategies`)}async function Md(){return Dr(`${Wo.authorization.v1}`)}async function Fd(){return Dr(`${Wo.v2}/me`)}const Gd=async()=>{try{return await zs()}catch(e){}};async function $d(){const[e]=Vr.getFeatureFlags([$r],$o.getAppName()||""),t=[{action:Fd,shouldLoad:!0},{action:e?Gd:Ws,shouldLoad:Zs()},{action:Md,shouldLoad:el()}].map((e=>async function({shouldLoad:e,action:t}){if(e)return await t()}(e))),[n,a,i]=await Promise.all(t),o=es();return o&&(n.tenantId=o),M({},n,null!=i?i:{},{entitlements:a})}async function xd(e){const t=await Ur(`${Bo.v1}/user/step-up/generate`,e);return t.accessToken?tl(t):t}async function Vd(e){return Dr(`${Wo.v2}/me`,null!=e?e:{addRoles:!0})}async function jd(e){return Cr(`${Wo.v2}/me`,e)}async function Bd(e){return Cr(`${or.v1}/me/image/v1`,e,{responseType:"plain",contentType:void 0})}async function Wd(e){return Ur(`${Wo.v1}/passwords/change`,e)}async function zd(e){var t,n,a,i,o,r;const s=(e.filter||[]).reduce(((e,t)=>M({},e,{[t.id]:t.value})),{}),l=null!=(t=e.sort)&&t.length?{sortBy:null!=(n=null==(a=e.sort)||null==(i=a[0])?void 0:i.id)?n:"name",sortDirection:null!=(o=e.sort)&&null!=(r=o[0])&&r.desc?"desc":"asc"}:null;return Dr(nr.v1,M({pageOffset:e.pageOffset,pageSize:e.pageSize},s,l))}async function Kd(e){return Ur(Wo.v2,M({},e,{provider:"local"}))}async function Hd(e){return Nr(`${nr.v1}/${e.userId}`)}async function qd(e){return Cr(nr.v1,e)}async function Jd(e){const{userId:t,expirationInSeconds:n}=e;return Cr(`${Wo.temporary.v1}/${t}`,{expirationInSeconds:n})}async function Yd(e){return Nr(`${Wo.temporary.v1}/${e}`)}async function Xd(){return Dr(Wo.temporary.configuration.v1)}async function Qd(e){return Ur(Jo.invites.user.v1,M({},e))}async function Zd(e){return Rr(Jo.invites.user.v1,M({},e))}async function eu(){return Nr(Jo.invites.user.v1)}async function tu(){return Dr(Jo.invites.user.v1)}async function nu(){return Dr(Jo.invites.configuration.v1)}async function au(){return Dr(ar.v1)}async function iu(){return Dr(qo.v1)}async function ou(){return Dr(`${ir.v1}/members`)}async function ru(e){return Ur(`${nr.v1}/${e.userId}/resendActivationEmail`,{})}async function su(e){return Ur(Wo.v2,M({},e,{provider:"local"}))}async function lu(e){return Ur(Wo.invitation.resendAll.v1,M({},e))}async function cu(e){var t,n;const a=await Dr("/metadata",e);if(null!=a&&null!=(t=a.rows)&&t[0])return null==a||null==(n=a.rows)?void 0:n[0];throw new Error(`metadata not found: ${e.entityName}`)}async function du(){return Dr("/metadata/admin-box")}async function uu(e){return Ur("/metadata/admin-box",e)}async function yu(){const e=await Dr("/metadata/ipme");if(e)return e;throw new Error("ip metadata not found")}const fu=async()=>cu({entityName:"notifications"}),pu=async()=>cu({entityName:"saml"}),gu=async()=>cu({entityName:"audits"}),Su=async e=>async function(e){const t=await Dr(`/metadata/ip/${e}`);if(t)return t;throw new Error("ip metadata not found")}(e),vu=["dataFilters"],hu=["templateId","dataFilters"],mu=["dataFilters"];async function bu(e){return Dr(`${fr.v2}/tenant-reports`,e)}async function Au(e){return Dr(`${fr.v2}/${e.id}/tenant-reports`)}async function Tu(e){let{dataFilters:t}=e,n=Za(e,vu);return{html:await Dr(`${pr.v1}/preview-report`,M({},n,{dataFilters:btoa(JSON.stringify(t||{})),responseType:"html"}),{responseType:"plain"})}}async function Eu(e){let{templateId:t,dataFilters:n}=e,a=Za(e,hu);return Ur(`${fr.v2}/${t}/tenant-reports`,M({},a,{dataFilters:btoa(JSON.stringify(n||{}))}))}async function ku(e){let{dataFilters:t}=e,n=Za(e,mu);const a=await Dr(`${pr.v1}/preview-report`,M({},n,{dataFilters:btoa(JSON.stringify(t||{}))}),{responseType:"blob"});let i="text/html",o="html";"pdf"===n.responseType?(i="application/pdf",o="pdf"):"image"===n.responseType&&(i="image/jpeg",o="jpg");const r=new Blob([a],{type:i}),s=URL.createObjectURL(r),l=document.createElement("a");l.href=s,l.setAttribute("download",`report_${n.name||""}.${o}`),l.click(),setTimeout(l.remove.bind(l))}async function Iu(e){return Ur(`${pr.v1}/tenant-reports`,e)}async function Ou(e){return Dr(gr,{params:e})}async function Pu(e){return Cr(`${gr}/status`,{params:e})}async function _u(e){const{notificationId:t,pinStatus:n}=e;return Cr(`${gr}/${n}`,{notificationId:t})}async function Lu(){return Ur(`${gr}/status/mark-all-read`)}const wu=["endpoint","headerProps"];async function Du(e){return Dr(Sr,e)}async function Uu(e){return Dr(`${Sr}/stats`,e)}async function Ru(e){const{endpoint:t,headerProps:n}=e,a=Za(e,wu);return Mr(`${Sr}/export/${t}`,{properties:n},a)}const Cu=["eventKey"],Nu=["eventKey"],Mu=()=>Dr(`${cr.v1}/slack`),Fu=()=>Dr(`${cr.v1}/slack/applications`),Gu=()=>Dr(`${cr.v1}/slack/channels`),$u=e=>e.id?Rr(`${cr.v1}/slack/subscription/${e.id}`,e):Ur(`${cr.v1}/slack/subscriptions`,e),xu=e=>Nr(`${cr.v1}/slack/subscriptions/${e.id}`),Vu=e=>Ur(`${cr.v1}/slack/applications/registrations`,{code:e}),ju=()=>Dr(`${cr.v1}/emails`),Bu=e=>{let{eventKey:t}=e,n=Za(e,Cu);return Ur(`${cr.v1}/emails/${t}`,n)},Wu=({eventKey:e,enabled:t})=>Rr(`${cr.v1}/emails/${e}`,{enabled:t}),zu=(e,t)=>Nr(`${cr.v1}/emails/${e}/subscriptions/${t}`),Ku=(e,t,n)=>Cr(`${cr.v1}/emails/${t}/subscriptions/${e}`,n),Hu=e=>Nr(`${cr.v1}/emails/${e}`),qu=()=>Dr(`${cr.v2}/sms`),Ju=e=>{let{eventKey:t}=e,n=Za(e,Nu);return Ur(`${cr.v2}/sms/${t}`,n)},Yu=({eventKey:e,enabled:t})=>Rr(`${cr.v2}/sms/${e}`,{enabled:t}),Xu=(e,t)=>Nr(`${cr.v2}/sms/${e}/subscriptions/${t}`),Qu=(e,t,n)=>Cr(`${cr.v2}/sms/${t}/subscriptions/${e}`,n),Zu=e=>Nr(`${cr.v2}/sms/${e}`),ey=()=>Dr(hr),ty=e=>e._id?Rr(`${hr}/${e._id}`,e):Ur(`${hr}/custom`,e),ny=e=>Nr(`${hr}/${e}`),ay=(e,t=0,n=10)=>{const a=new URLSearchParams({id:e,offset:`${t}`,limit:`${n}`});return Dr(`${hr}/logs/?${a.toString()}`)},iy=e=>Ur(`${hr}/test`,e),oy=e=>Ur(`${hr}/logs/${e}/retries`),ry=()=>Dr(`${vr.v1}/categories`),sy=e=>Dr(vr.v1,{channels:e});async function ly(e,t){return Cr(rr.v1,e,{headers:Fr(t)})}async function cy(e){return Dr(rr.v1,void 0,{headers:Fr(e)})}async function dy(){return Dr(`${rr.v1}/public`)}const uy=["roleId"],yy=["roleId"],fy=["permissionId"];async function py(){return Dr(Yo.v1)}async function gy(e){return Ur(Yo.v1,e)}async function Sy({roleId:e}){return Nr(`${Yo.v1}/${e}`)}async function vy(e){let{roleId:t}=e,n=Za(e,uy);return Rr(`${Yo.v1}/${t}`,n)}async function hy(e){let{roleId:t}=e,n=Za(e,yy);return Cr(`${Yo.v1}/${t}/permissions`,n)}async function my(){return Dr(qo.v1)}async function by(e){let{permissionId:t}=e,n=Za(e,fy);return Cr(`${qo.v1}/${t}/roles`,n)}async function Ay(){return Dr(`${qo.v1}/categories`)}async function Ty(e){return Ur(Yo.v2,e)}async function Ey(){return Dr(dr.subscriptions.v1)}async function ky(e){return Dr(`${dr.subscriptions.v1}/${e}`)}async function Iy(e){return Cr(`${dr.subscriptions.v1}/${e}/cancellations/`,{})}async function Oy(e){return Cr(`${dr.subscriptions.v1}/${e}/renewals/`,{})}async function Py(e,{paymentMethodId:t,planId:n}){return Cr(`${dr.subscriptions.v1}/${e}`,{paymentMethodId:t,planId:n})}async function _y(e){return Dr(`${yr.v1}/${e}`)}async function Ly(){return Dr(`${yr.v1}`)}async function wy(e){return Cr(`${yr.v1}/${e}/cancellations/`,{})}async function Dy(e){return Cr(`${yr.v1}/${e}/renewals/`,{})}async function Uy(e,{paymentMethodId:t,planId:n}){return Cr(`${yr.v1}/${e}`,{paymentMethodId:t,planId:n})}async function Ry(){return Dr(dr.plans.v1)}async function Cy(e){return Dr(`${dr.plans.v1}/${e}`)}async function Ny(){return Dr(dr.invoices.v1)}async function My(e){return Dr(`${dr.invoices.v1}/${e}`)}async function Fy(e,t){return Dr(`${dr.invoices.v1}/${e}/pdf`,{outputFileName:t},{responseType:"blob"})}const Gy=["email"];async function $y(){return Dr(dr.paymentMethods.v1)}async function xy(e){return Dr(`${dr.paymentMethods.v1}/${e}`)}async function Vy(e,t){let{email:n}=t,a=Za(t,Gy);return Rr(`${dr.paymentMethods.v1}/${e}/billing-details`,{email:n,address:a})}async function jy(e){return Ur(dr.paymentProviders.stripe.subscriptions.v1,e)}async function By(e){return Dr(`${dr.paymentProviders.stripe.customers.v1}/${e}`)}async function Wy(e){return Ur(`${dr.paymentProviders.stripe.customers.v1}`,e)}async function zy(){return Dr(`${dr.paymentProviders.stripe.publicConfigurations.v1}`)}async function Ky(e){return Ur(`${dr.paymentProviders.stripe.setupIntents.v1}`,e)}async function Hy(e){return Dr(`${dr.summaries.v1}/${e}`)}async function qy(e){return Dr(`${dr.tenantConfiguration.v1}/${e}`)}async function Jy(e){return Ur(`${dr.tenantConfiguration.v1}`,e)}async function Yy(){return Dr(ur.v1)}async function Xy(){return Dr(`${dr.configurations.vendorPublicConfigurations.v1}`)}let Qy,Zy,ef,tf,nf,af;async function of(){return Dr("/vendors/public")}async function rf(e){return Dr(Xo.v1,e)}async function sf(e){return Ur(Xo.v1,e)}async function lf(e,t){return Nr(Xo.v1,e,{headers:Fr(t)})}async function cf(e,t,n){return Ur(`${Xo.v1}/${e}/roles`,t,{headers:Fr(n)})}async function df(e,t,n){return Nr(`${Xo.v1}/${e}/roles`,t,{headers:Fr(n)})}async function uf(e,t,n){return Rr(`${Xo.v1}/${e}/roles`,t,{headers:Fr(n)})}async function yf(e,t){return Ur(lr.v1,e,{headers:Fr(t)})}async function ff(e,t){return Nr(`${lr.v1}/${e}`,void 0,{headers:Fr(t)})}async function pf({tenantId:e},t,n){return Rr(`${lr.v1}/${e}`,t,{headers:Fr(n)})}async function gf(e,t,n){return Cr(`${Xo.v1}/${e}/access`,t,{headers:Fr(n)})}async function Sf(e,t){return Ur(`${Xo.v2}/`,e,{headers:Fr(t)})}async function vf(){return Dr(`${Ar}`)}async function hf(e,t){return Rr(`${Ar}/${e}`,t)}async function mf(e){return Ur(`${Ar}`,e)}async function bf(e){return Nr(`${Ar}/${e}`)}async function Af(e){return Dr(`${Tr}/${e}/Users/count`)}async function Tf(e){return Ur(`${Qo.v1}`,e)}!function(e){e.ACTIVE="active",e.CANCELED="canceled",e.INCOMPLETE="incomplete",e.EXPIRED="expired",e.TRIALING="trialing",e.TRIAL_ENDED="trialEnded"}(Qy||(Qy={})),function(e){e.UNKNWON="unknown",e.CARD="card"}(Zy||(Zy={})),function(e){e.AT_PERIOD_END="atPeriodEnd"}(ef||(ef={})),(tf||(tf={})).Stripe="Stripe",function(e){e.CHANGE_TO_DEFAULT="change_to_default",e.RETAIN_TRIAL="retain_trial"}(nf||(nf={})),function(e){e.CREATE="create_customer"}(af||(af={}));const Ef=["groupId"];async function kf({groupId:e},t){return Dr(`${Zo.v1}/${e}`,M({},t))}async function If(e){return Dr(`${Zo.v1}`,M({},e))}async function Of(e,t){return Ur(`${Zo.getByIds.v1}`,e,{params:t})}async function Pf(e){return Ur(`${Zo.v1}`,e)}async function _f(e){let{groupId:t}=e,n=Za(e,Ef);return Rr(`${Zo.v1}/${t}`,n)}async function Lf(e){return Nr(`${Zo.v1}/${e}`)}async function wf(e,t){return Ur(`${Zo.v1}/${e}/roles`,t)}async function Df(e,t){return Nr(`${Zo.v1}/${e}/roles`,t)}async function Uf(e,t){return Ur(`${Zo.v1}/${e}/users`,t)}async function Rf(e,t){return Nr(`${Zo.v1}/${e}/users`,t)}async function Cf(){return Dr(`${Zo.configurations.v1}`)}async function Nf(e){return Ur(`${Zo.configurations.v1}`,e)}async function Mf(){return Dr(Ir.v1)}async function Ff(){return Dr(Or.v1)}async function Gf(e){return Dr(`${er.v1}`,e)}async function $f(e){return Ur(`${er.v1}`,e)}async function xf(e){return Nr(`${er.v1}/${e}`)}async function Vf(e){return Ur(`${er.v1}/preverify`,e)}async function jf(e){return Ur(`${er.v1}/verify`,e)}async function Bf(e,t){return Ur(`${er.v1}/${e}/delete/verify`,t)}let Wf,zf,Kf,Hf;!function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"}(Wf||(Wf={})),function(e){e.createdAt="createdAt",e.name="name",e.tenantId="tenantId"}(zf||(zf={})),function(e){e.CUSTOMER="customer",e.SPAM="spam",e.TEST="test",e.RESELLER="reseller",e.HEADQUARTER="headquarter"}(Kf||(Kf={})),function(e){e.NEVER="NEVER",e.ALWAYS="ALWAYS",e.ASSIGNABLE="ASSIGNABLE"}(Hf||(Hf={}));const qf=[/^(.*)\/logout$/g,"/logout",/^\/identity\/resources\/auth\/v[0-9]*\/user\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/passwordless\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/webauthn\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/token\/refresh$/g,/^\/identity\/resources\/users\/v[0-9]*$/g,/^\/identity\/resources\/users\/v[0-9]*\/signUp$/g,/^\/identity\/resources\/users\/v[0-9]*\/activate$/g,/^\/identity\/resources\/users\/v[0-9]*\/invitation\/accept$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/verify$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/[^\/]*\/[^\/]*\/verify$/g,/^\/oauth\/token$/g,/^\/oauth\/authorize\/silent$/g],Jf=`${Bo.v1}/user/token/refresh`,Yf=`${mr}/authorize/silent`,Xf=`${Wo.v2}/me`,Qf=`${Wo.v2}/me/tenants`,Zf=`${Wo.v3}/me/tenants`;let ep,tp,np,ap,ip,op,rp,sp;!function(e){e.FRONTEGG="frontegg",e.OKTA="okta",e.AZURE_AD="azure-ad",e.OTHER="other"}(ep||(ep={})),function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"}(tp||(tp={})),function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"}(np||(np={})),function(e){e.FORCE_MFA="FORCE_MFA",e.BREACHED_PASSWORDS_EXIST="BREACHED_PASSWORDS_EXIST",e.ENABLE_USER_LOCKOUT="ENABLE_USER_LOCKOUT",e.STRENGTHEN_USER_LOCKOUT="STRENGTHEN_USER_LOCKOUT",e.ENABLE_PASSWORD_HISTORY="ENABLE_PASSWORD_HISTORY",e.STRENGTHEN_PASSWORD_HISTORY="STRENGTHEN_PASSWORD_HISTORY",e.ENABLE_FORCE_RELOGIN="ENABLE_FORCE_RELOGIN",e.SET_FORCE_RELOGIN="SET_FORCE_RELOGIN",e.ENABLE_SESSION_CONCURRENCY="ENABLE_SESSION_CONCURRENCY",e.SET_SESSION_CONCURRENCY="SET_SESSION_CONCURRENCY",e.ENABLE_IDLE_SESSION="ENABLE_IDLE_SESSION",e.SET_IDLE_SESSION="SET_IDLE_SESSION",e.ENABLE_IP_RESTRICTIONS="ENABLE_IP_RESTRICTIONS",e.CHANGE_IP_TO_ALLOWLIST="CHANGE_IP_TO_ALLOWLIST",e.ENABLE_DOMAIN_RESTRICTIONS="ENABLE_DOMAIN_RESTRICTIONS",e.CHANGE_DOMAIN_TO_ALLOWLIST="CHANGE_DOMAIN_TO_ALLOWLIST",e.CONFIGURE_SSO="CONFIGURE_SSO"}(ap||(ap={})),function(e){e.MFA_FORCED="MFA_FORCED",e.PARTIALLY_FORCED_MFA="PARTIALLY_FORCED_MFA",e.PARTIAL_MFA_USAGE="PARTIAL_MFA_USAGE",e.FULL_MFA_USAGE="FULL_MFA_USAGE",e.BREACHED_PASSWORD_USERS_EXIST="BREACHED_PASSWORD_USERS_EXIST",e.IMPROVE_LOCKOUT_POLICY="IMPROVE_LOCKOUT_POLICY",e.IMPROVE_PASSWORD_HISTORY_POLICY="IMPROVE_PASSWORD_HISTORY_POLICY",e.NO_SESSION_SETTINGS="NO_SESSION_SETTINGS",e.PARTIAL_SESSION_SETTINGS="PARTIAL_SESSION_SETTINGS",e.FULL_SESSION_SETTINGS="FULL_SESSION_SETTINGS",e.NO_IP_RESTRICTIONS="NO_IP_RESTRICTIONS",e.IP_ALLOWLIST="IP_ALLOWLIST",e.IP_DENYLIST="IP_DENYLIST",e.NO_DOMAIN_RESTRICTIONS="NO_DOMAIN_RESTRICTIONS",e.DOMAIN_ALLOWLIST="DOMAIN_ALLOWLIST",e.DOMAIN_DENYLIST="DOMAIN_DENYLIST",e.FULL_PASSWORD_SETTINGS="FULL_PASSWORD_SETTINGS"}(ip||(ip={})),function(e){e.SEND_RESET_BREACHED_PASSWORD_EMAIL="SEND_RESET_BREACHED_PASSWORD_EMAIL",e.ADJUST_FORCE_RELOGIN="ADJUST_FORCE_RELOGIN",e.ADJUST_MAX_CONCURRENT_SESSIONS="ADJUST_MAX_CONCURRENT_SESSIONS",e.ADJUST_IDLE_TIMEOUT="ADJUST_IDLE_TIMEOUT"}(op||(op={})),function(e){e.SEVERE="SEVERE",e.WARNING="WARNING",e.INFO="INFO"}(rp||(rp={})),function(e){e.MFA="MFA",e.SESSIONS="SESSIONS",e.PASSWORD="PASSWORD",e.INACTIVITY="INACTIVITY",e.IP="IP",e.DOMAIN="DOMAIN",e.SSO="SSO"}(sp||(sp={}));const lp={auth:s,teams:l,metadata:c,reports:d,connectivity:f,notifications:u,audits:y,tenants:o,accountSettings:p,roles:g,subscriptions:S,vendor:v,subTenants:h,featureFlags:t,directory:m,impersonate:b,groups:A,users:i,entitlements:r,securityCenter:T,userPhoneNumbers:E},cp={fetch:e,ContextHolder:$o,FronteggContext:xo,api:lp,FronteggApiError:Vo,AuthStrategyEnum:Ea,MachineToMachineAuthStrategy:ka,SocialLoginProviders:Ta,ISubscriptionCancellationPolicy:ef,ISubscriptionStatus:Qy,PaymentMethodType:Zy,ProviderType:tf};let dp,up;!function(e){e.LOAD_SSO_CONFIGURATIONS="LOAD_SSO_CONFIGURATIONS",e.SAVE_SSO_CONFIGURATION="SAVE_SSO_CONFIGURATION",e.UPDATE_SSO_CONFIGURATION="UPDATE_SSO_CONFIGURATION",e.SAVE_SSO_CONFIGURATION_BY_METADATA="SAVE_SSO_CONFIGURATION_BY_METADATA",e.UPDATE_SSO_CONFIGURATION_BY_METADATA="UPDATE_SSO_CONFIGURATION",e.DELETE_SSO_CONFIGURATION="DELETE_SSO_CONFIGURATION",e.SAVE_SSO_DOMAIN="SAVE_SSO_DOMAIN",e.DELETE_SSO_DOMAIN="DELETE_SSO_DOMAIN",e.VALIDATE_SSO_DOMAIN="VALIDATE_SSO_DOMAIN",e.UPDATE_SSO_DEFAULT_ROLES="UPDATE_SSO_DEFAULT_ROLES",e.DELETE_SSO_GROUPS="DELETE_SSO_GROUPS",e.SAVE_SSO_GROUPS="SAVE_SSO_GROUPS",e.GET_SSO_AUTHORIZATION_ROLES="GET_SSO_AUTHORIZATION_ROLES"}(dp||(dp={})),function(e){e.Saml="saml",e.Okta="okta",e.Azure="azure",e.Google="google",e.Oidc="oidc"}(up||(up={}));const yp="input is invalid type",fp="undefined"!=typeof ArrayBuffer,pp="0123456789abcdef".split(""),gp=[-2147483648,8388608,32768,128],Sp=[24,16,8,0],vp=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],hp=["hex","array","digest","arrayBuffer"],mp=[];Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),fp&&!ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});const bp=function(e){return function(t){const n=new Tp(!0).update(t);return null==n?void 0:n[e]()}},Ap=function(e){return function(t,n){const a=new Ep(t,!0).update(n);return null==a?void 0:a[e]()}};class Tp{constructor(e=!1){this.blocks=void 0,this.h0=void 0,this.h1=void 0,this.h2=void 0,this.h3=void 0,this.h4=void 0,this.h5=void 0,this.h6=void 0,this.h7=void 0,this.block=void 0,this.start=void 0,this.bytes=void 0,this.hBytes=void 0,this.finalized=void 0,this.hashed=void 0,this.first=void 0,this.lastByteIndex=void 0,this.sharedMemory=!1,this.toString=()=>this.hex(),this.array=()=>Tp.prototype.digest(),e?(mp[0]=mp[16]=mp[1]=mp[2]=mp[3]=mp[4]=mp[5]=mp[6]=mp[7]=mp[8]=mp[9]=mp[10]=mp[11]=mp[12]=mp[13]=mp[14]=mp[15]=0,this.blocks=mp):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.sharedMemory=e}update(e){if(this.finalized)return;let t;const n=typeof e;if("string"!==n){if("object"!==n)throw new Error(yp);if(null===e)throw new Error(yp);if(fp&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||fp&&ArrayBuffer.isView(e)))throw new Error(yp);t=!0}let a,i,o=0;const r=e.length,s=this.blocks;for(;o<r;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)for(i=this.start;o<r&&i<64;++o)s[i>>2]|=e[o]<<Sp[3&i++];else for(i=this.start;o<r&&i<64;++o)a=e.charCodeAt(o),a<128?s[i>>2]|=a<<Sp[3&i++]:a<2048?(s[i>>2]|=(192|a>>6)<<Sp[3&i++],s[i>>2]|=(128|63&a)<<Sp[3&i++]):a<55296||a>=57344?(s[i>>2]|=(224|a>>12)<<Sp[3&i++],s[i>>2]|=(128|a>>6&63)<<Sp[3&i++],s[i>>2]|=(128|63&a)<<Sp[3&i++]):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),s[i>>2]|=(240|a>>18)<<Sp[3&i++],s[i>>2]|=(128|a>>12&63)<<Sp[3&i++],s[i>>2]|=(128|a>>6&63)<<Sp[3&i++],s[i>>2]|=(128|63&a)<<Sp[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}finalize(){if(this.finalized)return;this.finalized=!0;const e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=gp[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}hash(){let e,t,n,a,i,o,r,s,l,c,d,u=this.h0,y=this.h1,f=this.h2,p=this.h3,g=this.h4,S=this.h5,v=this.h6,h=this.h7;const m=this.blocks;for(e=16;e<64;++e)i=m[e-15],t=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,i=m[e-2],n=(i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[e]=m[e-16]+t+m[e-7]+n<<0;for(d=y&f,e=0;e<64;e+=4)this.first?(s=704751109,i=m[0]-210244248,h=i-1521486534<<0,p=i+143694565<<0,this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=u&y,a=s^u&f^d,r=g&S^~g&v,i=h+n+r+vp[e]+m[e],o=t+a,h=p+i<<0,p=i+o<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),l=p&u,a=l^p&y^s,r=h&g^~h&S,i=v+n+r+vp[e+1]+m[e+1],o=t+a,v=f+i<<0,f=i+o<<0,t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),c=f&p,a=c^f&u^l,r=v&h^~v&g,i=S+n+r+vp[e+2]+m[e+2],o=t+a,S=y+i<<0,y=i+o<<0,t=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),n=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7),d=y&f,a=d^y&p^c,r=S&v^~S&h,i=g+n+r+vp[e+3]+m[e+3],o=t+a,g=u+i<<0,u=i+o<<0;this.h0=this.h0+u<<0,this.h1=this.h1+y<<0,this.h2=this.h2+f<<0,this.h3=this.h3+p<<0,this.h4=this.h4+g<<0,this.h5=this.h5+S<<0,this.h6=this.h6+v<<0,this.h7=this.h7+h<<0}hex(){this.finalize();const e=this.h0,t=this.h1,n=this.h2,a=this.h3,i=this.h4,o=this.h5,r=this.h6,s=this.h7;let l=pp[e>>28&15]+pp[e>>24&15]+pp[e>>20&15]+pp[e>>16&15]+pp[e>>12&15]+pp[e>>8&15]+pp[e>>4&15]+pp[15&e]+pp[t>>28&15]+pp[t>>24&15]+pp[t>>20&15]+pp[t>>16&15]+pp[t>>12&15]+pp[t>>8&15]+pp[t>>4&15]+pp[15&t]+pp[n>>28&15]+pp[n>>24&15]+pp[n>>20&15]+pp[n>>16&15]+pp[n>>12&15]+pp[n>>8&15]+pp[n>>4&15]+pp[15&n]+pp[a>>28&15]+pp[a>>24&15]+pp[a>>20&15]+pp[a>>16&15]+pp[a>>12&15]+pp[a>>8&15]+pp[a>>4&15]+pp[15&a]+pp[i>>28&15]+pp[i>>24&15]+pp[i>>20&15]+pp[i>>16&15]+pp[i>>12&15]+pp[i>>8&15]+pp[i>>4&15]+pp[15&i]+pp[o>>28&15]+pp[o>>24&15]+pp[o>>20&15]+pp[o>>16&15]+pp[o>>12&15]+pp[o>>8&15]+pp[o>>4&15]+pp[15&o]+pp[r>>28&15]+pp[r>>24&15]+pp[r>>20&15]+pp[r>>16&15]+pp[r>>12&15]+pp[r>>8&15]+pp[r>>4&15]+pp[15&r];return l+=pp[s>>28&15]+pp[s>>24&15]+pp[s>>20&15]+pp[s>>16&15]+pp[s>>12&15]+pp[s>>8&15]+pp[s>>4&15]+pp[15&s],l}digest(){this.finalize();const e=this.h0,t=this.h1,n=this.h2,a=this.h3,i=this.h4,o=this.h5,r=this.h6,s=this.h7,l=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,r>>24&255,r>>16&255,r>>8&255,255&r];return l.push(s>>24&255,s>>16&255,s>>8&255,255&s),l}arrayBuffer(){this.finalize();const e=new ArrayBuffer(32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),t.setUint32(28,this.h7),e}}class Ep extends Tp{constructor(e,t=!1){let n;super(t),this.inner=void 0,this.oKeyPad=void 0;const a=typeof e;if("string"===a){const t=[],a=e.length;let i,o=0;for(n=0;n<a;++n)i=e.charCodeAt(n),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>6,t[o++]=128|63&i):i<55296||i>=57344?(t[o++]=224|i>>12,t[o++]=128|i>>6&63,t[o++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),t[o++]=240|i>>18,t[o++]=128|i>>12&63,t[o++]=128|i>>6&63,t[o++]=128|63&i);e=t}else{if("object"!==a)throw new Error(yp);if(null===e)throw new Error(yp);if(fp&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||fp&&ArrayBuffer.isView(e)))throw new Error(yp)}var i;e.length>64&&(e=null==(i=new Tp(!0).update(e))?void 0:i.array());const o=[],r=[];for(n=0;n<64;++n){const t=e[n]||0;o[n]=92^t,r[n]=54^t}Tp.call(this,t),this.update(r),this.oKeyPad=o,this.inner=!0,this.sharedMemory=t}finalize(){if(super.finalize(),this.inner){this.inner=!1;const e=this.array();Tp.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Tp.prototype.finalize.call(this)}}}const kp=function(){const e=bp("hex");e.create=function(){return new Tp},e.update=function(t){return e.create().update(t)};for(let t=0;t<hp.length;++t){const n=hp[t];e[n]=bp(n)}return e}();function Ip(e,t){const n=M({},e);return t.forEach((e=>{delete n[e]})),n}async function Op(e){var t,n;return null!=(t=window.crypto)&&null!=(n=t.subtle)&&n.digest?async function(e){const t=await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}(e):(console.warn("Generating CodeChallenge in non-secure domain:",window.location.origin),async function(e){const t=kp.digest((new TextEncoder).encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}(e))}function Pp(e=16){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let a=0;a<e;a++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}!function(){const e=Ap("hex");e.create=function(e){return new Ep(e)},e.update=function(t,n){return e.create(t).update(n)};for(let t=0;t<hp.length;++t){const n=hp[t];e[n]=Ap(n)}}();const _p=e=>new Promise(((t,n)=>{const a=new FileReader;a.readAsText(e),a.onload=()=>t(a.result),a.onerror=n}));function*Lp(e){const t=yield Bi((e=>e.root.appName));return Vr.getFeatureFlags(e,t)}const wp={clientId:"CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e",secret:"SECRET_16806d3d-8fc3-4450-be97-abdaf66b723e",createdAt:"createdAt",description:"Demo API Token (preview only)"},Dp=M({},wp,{roleIds:[],tenantId:"my-tenant-id",createdByUserId:"createdByUserId"}),Up=[{id:"a040dcf6-b907-4e83-9970-6bd23c88fd40",key:"ReadOnly",name:"Read Only",description:null,isDefault:!1,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],vendorId:"vendorId"},{id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0",key:"Admin",name:"Admin",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","16647407-ed6f-4ca6-83a0-86225d921959","f403c6b9-1abe-4ec7-9971-aa032255fc25","a43e059d-d731-44b1-94bb-fb6b16c62210"],vendorId:"vendorId"},{id:"1234",key:"Support",name:"Support",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","f26b00f8-ffe0-4739-b15c-7db15c27ea26","a9c803b0-ebfa-49b9-9607-f0d3a390ee61"],tenantId:"tenantId",vendorId:"vendorId"}],Rp={sub:"",tenants:[],id:"testId",name:"Demo User Name",email:"demo-user@frontegg.com",mfaEnrolled:!0,profilePictureUrl:"https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434",roles:[{id:"roleId",key:"admin",isDefault:!1,name:"Admin",description:null,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],tenantId:"tenantId",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date}],permissions:[{id:"8d71b676-754c-4600-afe7-ca5add1e6809",key:"fe.*",name:"General Admin",description:"description",categoryId:"category",fePermission:!0,createdAt:new Date,updatedAt:new Date,roleIds:[]}],tenantId:"my-tenant-id",tenantIds:["my-tenant-id"],activatedForTenant:!0,metadata:JSON.stringify({phoneNumber:"+972-54123456",jobTitle:"Developer",address:{city:"Tel Aviv",country:"Israel"}}),verified:!1},Cp=M({},Rp,{accessToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1MTY5YmY0Zi02YmI5LTQ5NGMtOGNkZS05MDc4NDQ0NWY4MDciLCJuYW1lIjoiRHVtbXkgVXNlciIsImVtYWlsIjoiZHVtbXlAZnJvbnRlZ2cuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsIm1ldGFkYXRhIjp7fSwicm9sZXMiOlsiYWRtaW4iXSwicGVybWlzc2lvbnMiOlsiZmUuKiJdLCJ0ZW5hbnRJZCI6Im15LXRlbmFudC1pZCIsInRlbmFudElkcyI6WyJteS10ZW5hbnQtaWQiXSwicHJvZmlsZVBpY3R1cmVVcmwiOiJodHRwczovL3d3dy5ncmF2YXRhci5jb20vYXZhdGFyLzQyYjJhZDJiYWQ2ZmM5YjlkYjUwODZkZmNmODA3MmFjP2Q9aHR0cHM6Ly91aS1hdmF0YXJzLmNvbS9hcGkvZmUvMTI4L3JhbmRvbT90PTE2MTcyNjE4OTA4NzU_dD0xNjE3MjYxOTE3NDM0IiwidHlwZSI6InVzZXJUb2tlbiIsImlhdCI6MTYxNzkwNjMyNCwiZXhwIjoxNjE3OTkyNzI0LCJpc3MiOiJmcm9udGVnZyJ9.paaXLkpWEWbQmUtoK2P8IwXCxK4WJp7XhXonvzF8g1I",expiresIn:86400,mfaRequired:!1,refreshToken:"refresh-token-dummy-de39dc9c-9d22-4852-b7f5-c3c0aa613b58",type:"userToken",iat:1617906324,exp:1617992724,iss:"frontegg",email_verified:!0}),Np={loading:!1,error:void 0,saving:!0,profile:Rp},Mp={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date,allowOverrideEnforcePasswordHistory:!0,allowOverridePasswordComplexity:!1,allowOverridePasswordExpiration:!1,allowSignups:!0,apiTokensEnabled:!0,cookieSameSite:"cookieSameSite",defaultRefreshTokenExpiration:0,defaultTokenExpiration:1,publicKey:"publicKey"},Fp={allowSignups:!0,allowNotVerifiedUsersLogin:!1,apiTokensEnabled:!0,forcePermissions:!1,authStrategy:Ea.EmailAndPassword,machineToMachineAuthStrategy:ka.ClientCredentials},Gp={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date},$p={id:"id",enabled:!0,maxAttempts:1,createdAt:new Date,updatedAt:new Date},xp={id:"id",enabled:!0,historySize:1,createdAt:new Date,updatedAt:new Date},Vp={enabled:!0,domain:"domain",validated:!0,generatedVerification:"generatedVerification",ssoEndpoint:"ssoEndpoint",publicCertificate:"publicCertificate",signRequest:!0,createdAt:new Date,updatedAt:new Date,acsUrl:void 0,spEntityId:void 0,oidcClientId:void 0,oidcSecret:void 0,type:void 0},jp={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",properties:[],vendorId:"vendorId",entityName:"saml",isActive:!0,configuration:{acsUrl:"acsUrl",spEntityId:"spEntityId"}},Bp=[{id:"id",description:"description",key:"key",name:"name",permissions:[],permissionLevel:1}],Wp={firstLoad:!1,loading:!1,error:void 0,saving:!1,samlConfiguration:Vp,roles:Bp,authorizationRoles:[],errors:{},loaders:{},ssoConfigurations:[]},zp=[{description:"string",fePermission:!0,id:"id",key:"key",name:"name",roleIds:[],createdAt:new Date,updatedAt:new Date,categoryId:"categoryId"}],Kp={id:"id2",email:"demo-user2@frontegg.com",name:"Demo User Name2",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,verified:!1,createdAt:(new Date).toISOString(),customData:void 0,lastLogin:void 0,mfaEnabled:void 0,roles:[Up[0]],groups:[{id:"id2",name:"Developers",color:"#03A9F4",roles:[Up[0]],managedBy:np.FRONTEGG}]},Hp={id:Kp.id,email:Kp.email,name:Kp.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[Up[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},qp={id:"id",email:"demo-user@frontegg.com",name:"Demo User Name",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,createdAt:new Date(2022,4,1).toISOString(),verified:!0,customData:void 0,lastLogin:new Date(2022,5,25).toISOString(),mfaEnabled:void 0,roles:[Up[1]],groups:[{id:"id1",name:"Designers",color:"#E1F5E2",roles:[Up[0]],managedBy:np.FRONTEGG}]},Jp={id:qp.id,email:qp.email,name:qp.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[Up[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},Yp={metadata:"",mfaEnrolled:!1,provider:"",sub:"",tenantIds:[],tenants:[],verified:!1,id:"id",email:"email",name:"name",tenantId:"tenantId",createdAt:new Date},Xp=[qp,Kp],Qp=[Jp,Hp],Zp=[Yp],eg=[{id:"my-tenant-id",isReseller:!1,name:"Frontegg demo",deletedAt:null,metadata:void 0,tenantId:"my-tenant-id",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date,address:void 0,timezone:void 0,dateFormat:void 0,timeFormat:void 0,currency:void 0,logo:void 0}],tg=[{id:"laptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date,ipAddress:"190.194.88.251",current:!0},{id:"iphone",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",createdAt:new Date(Date.now()-1e4),ipAddress:"191.49.203.21"},{id:"tablet",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",createdAt:new Date(Date.now()-3e4),ipAddress:"130.19.196.136"},{id:"anotherlaptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date(Date.now()-1002232300),ipAddress:"2.228.163.92"}],ng={sessionConcurrentConfiguration:{isActive:!0,maxSessions:10},sessionIdleTimeoutConfiguration:{isActive:!0,timeout:3600},sessionTimeoutConfiguration:{isActive:!0,timeout:7776e3}},ag={isActive:!0,strategy:Bn.ALLOW},ig=[{updatedAt:new Date,createdAt:new Date,id:"1",ip:"255.255.255.255",isActive:!0,strategy:Bn.ALLOW,description:"My IP"},{updatedAt:new Date,createdAt:new Date,id:"2",ip:"255.255.255.254",isActive:!0,strategy:Bn.ALLOW,description:"IP 2"},{updatedAt:new Date,createdAt:new Date,id:"3",ip:"255.255.255.253",isActive:!0,strategy:Bn.BLOCK,description:"IP 3"},{updatedAt:new Date,createdAt:new Date,id:"4",ip:"255.255.255.253",isActive:!0,strategy:Bn.BLOCK,description:"IP 4"}],og=e=>{const t=[];return Array.from({length:e}).forEach(((e,n)=>{t.push(M({},qp,{name:"Demo User",id:`id${n}`,profilePictureUrl:null,createdAt:new Date}))})),t},rg=e=>({id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0"+e,key:e,name:e,description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:[],tenantId:"tenantId",vendorId:"vendorId"}),sg=[{id:"id1",name:"Designers",color:"#E1F5E2",description:"The whole design team",users:og(6),roles:[rg("Editor")],metadata:'{"lastTermsCheck":"2022-08-16T10:31:11.270Z"}',managedBy:np.FRONTEGG},{id:"id2",name:"Developers",color:"#03A9F4",description:"All frontend and backend developers",users:og(44),roles:[rg("Editor")],managedBy:np.FRONTEGG},{id:"id3",name:"Product",color:"#E1583E",description:"PMs and team leads",users:og(8),roles:[rg("Viewer")],managedBy:np.FRONTEGG},{id:"id4",name:"Management",color:"#9AE0FF",description:"Executives",users:og(5),roles:[rg("Admin")],managedBy:np.FRONTEGG},{id:"id5",name:"Sales",color:"#ED8E7C",users:og(21),description:"BDR, AE, and inside sales",roles:[rg("Viewer")],managedBy:np.FRONTEGG},{id:"id6",name:"Support",color:"#A79D7B",users:og(23),description:"Dev success and customer success",roles:[rg("Admin")],managedBy:np.FRONTEGG},{id:"id7",name:"Marketing",color:"#2CA744",users:og(10),description:"The marketing department",roles:[rg("Viewer")],managedBy:np.FRONTEGG},{id:"id8",name:"HR",color:"#EAE1C2",users:og(4),description:"Human resources",roles:[rg("Viewer")],managedBy:np.FRONTEGG},{id:"id9",name:"Finance",color:"#5587C0",users:og(3),roles:[rg("Viewer")],managedBy:np.FRONTEGG},{id:"id10",name:"Operations",color:"#B1CAE7",users:og(8),roles:[rg("Editor")],managedBy:np.FRONTEGG},{id:"id11",name:"Legal",color:"#2CA744",users:og(4),roles:[rg("Viewer")],managedBy:np.FRONTEGG}],lg={scoring:{score:79},recommendations:{items:[{code:ap.FORCE_MFA,severity:rp.WARNING,category:sp.MFA},{code:ap.ENABLE_FORCE_RELOGIN,severity:rp.WARNING,category:sp.SESSIONS}]}},cg={insights:{items:[{category:sp.MFA,code:ip.PARTIALLY_FORCED_MFA,metadata:{totalUsers:2,mfa:{enrolledUsersCount:1}}},{category:sp.SESSIONS,code:ip.PARTIAL_SESSION_SETTINGS,metadata:{totalUsers:2,sessions:{idleTimeoutRecommendation:1800}}},{category:sp.PASSWORD,code:ip.IMPROVE_PASSWORD_HISTORY_POLICY,metadata:{password:{userLockoutRecommendation:5,historyRecommendations:5}}},{category:sp.DOMAIN,code:ip.NO_IP_RESTRICTIONS,metadata:{restrictions:{ipsCount:1,domainsCount:1}}}]}},dg={users:Qp,totalUsersItems:2,totalUsersPages:1,usersPageOffset:0},ug={users:[Qp[0]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0,queryParams:{_maxInactiveSeconds:7776e3}},yg={users:[Qp[1]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0},fg=[{id:"8d71b676-754c-4600-afe7-ca5add1e6809",key:"fe.secure.*",name:"Secure write",description:"all secure access permissions",categoryId:"77154759-0a04-4669-b6b4-0858d3c1190e",fePermission:!0,assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date},{id:"85e1fd7b-2bb7-498f-8521-5f8e5774c01e",key:"fe.account-hierarchy.write.subAccountAccess",name:"Give access to sub accounts",description:"Give a user access to sub account",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"a1807695-54a2-4f95-95de-a9b246488aae",key:"fe.account-hierarchy.read.subAccount",name:"Read sub accounts",description:"Read sub accounts",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"04dbcc11-61db-40a9-9577-9b73e50d1d03",key:"fe.secure.read.*",name:"Secure read",description:"all secure access read permissions",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"77154759-0a04-4669-b6b4-0858d3c1190e",fePermission:!0},{id:"a1807695-54a2-4f95-95de-a9b246488aae",key:"fe.account-hierarchy.read.subAccount",name:"Read sub accounts",description:"Read sub accounts",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"85e1fd7b-2bb7-498f-8521-5f8e5774c01e",key:"fe.account-hierarchy.write.subAccountAccess",name:"Give access to sub accounts",description:"Give a user access to sub account",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"a9c803b0-ebfa-49b9-9607-f0d3a390ee61",key:"fe.account-settings.delete.account",name:"Delete Account",description:"Delete my account",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"42aaebe1-893d-4da5-99d7-375a4537b7a4",fePermission:!0},{id:"f26b00f8-ffe0-4739-b15c-7db15c27ea26",key:"fe.account-settings.write.custom-login-box",name:"Edit custom login settings",description:"Write account's custom login box styling",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"42aaebe1-893d-4da5-99d7-375a4537b7a4",fePermission:!0},{id:"a43e059d-d731-44b1-94bb-fb6b16c62210",key:"fe.connectivity.delete.*",name:"Connectivity delete",description:"all connectivity delete permissions",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",fePermission:!0},{id:"f403c6b9-1abe-4ec7-9971-aa032255fc25",key:"fe.connectivity.delete.slackAppRegistration",name:"Delete slack application registration",description:"allow user to delete slack app registration",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"e8c0e727-f562-449a-82c5-f7691defde02",key:"fe.connectivity.read.*",name:"Connectivity read",description:"all connectivity read permissions",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",fePermission:!0},{id:"2a5dcd6d-57a3-45c4-815f-c265609cc1f7",key:"fe.connectivity.read.emailConfig",name:"Read email configuration",description:"read email integration configuration",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"2d7b4be7-8269-4ff4-81d6-0c92e95790d5",fePermission:!0},{id:"4fee0eb0-5b17-450b-bea4-b9b908230bda",key:"fe.connectivity.read.eventCategories",name:"Read events categories",description:"view connectivity events categories",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"31c7a260-55d6-43d5-a872-4f9e22982ff5",fePermission:!0},{id:"750a96a5-8abf-4340-b91a-723c7bb8bcfd",key:"fe.connectivity.read.events",name:"Read events",description:"view connectivity events",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"31c7a260-55d6-43d5-a872-4f9e22982ff5",fePermission:!0},{id:"ef2a5f1a-74c5-431f-b1a6-d4fb5026e374",key:"fe.connectivity.read.slackApp",name:"Read slack application",description:"get slack application configuration in order to register",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"9fc1fa37-a8b9-4931-b2b5-5de55df25289",key:"fe.connectivity.read.slackChannels",name:"Read slack channels",description:"view registered slack workspace channels",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"87c3df9d-0ab2-4e97-bfc8-777a68ba2543",key:"fe.connectivity.read.slackSubscriptions",name:"Read slack subscriptions",description:"view slack events subscriptions",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"7826470b-151f-4bab-b2c0-785e09878616",key:"fe.connectivity.read.slackUsers",name:"Read slack users",description:"view registered slack workspace users",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"ee779734-a7e3-47b3-ace9-944f9bee8ad8",key:"fe.connectivity.read.smsConfig",name:"Read SMS configuration",description:"read SMS integration configuration",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"5743fccc-b4ea-4907-bdca-7446ea088974",fePermission:!0},{id:"54583a96-c731-4a84-9abc-1b8b827f06ae",key:"fe.connectivity.read.userBellNotifications",name:"Read bell notifications",description:"view user bell notifications",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"18d2584b-7f03-4038-ab93-bc2b0f4511be",fePermission:!0},{id:"2dfde8ef-7df2-4426-bb8d-33615e399a4d",key:"fe.connectivity.read.webhookLogs",name:"Read webhooks logs",description:"view webhooks logs",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"e74e5390-396b-429c-9544-62417912d018",fePermission:!0},{id:"16647407-ed6f-4ca6-83a0-86225d921959",key:"fe.connectivity.read.webhooks",name:"Read webhooks",description:"view webhooks configuration",assignmentType:Hf.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"e74e5390-396b-429c-9544-62417912d018",fePermission:!0}],pg=[{id:"d9b4dbd0-476c-4708-b079-d9e6e4758971",name:"test",description:"",createdAt:new Date,updatedAt:new Date,permissionIds:[],feCategory:!1},{id:"2b3f1746-1135-4b8d-aff3-5697cffc4482",name:"SAML",description:"Secure access SAML",createdAt:new Date,updatedAt:new Date,permissionIds:["8ea45a49-c403-4551-9da9-77f5da44f130","8d94c261-1f7d-46bd-88a8-511e9f39273b","7391ac41-b076-4386-8a14-7c2d798d3335","6d8f5a1f-b3cd-421a-ba85-7784bdd97dc2","3c989065-35e1-4198-8c9c-c94084222794"],feCategory:!0},{id:"2c2281da-cf81-4943-9605-42969677e9fe",name:"Security Policies",description:"Secure access security policies",createdAt:new Date,updatedAt:new Date,permissionIds:["e5642338-b265-4ce5-94e4-8c21490033ad","daddb9e9-a836-4901-b175-2d1182dab6f5","bd4242ce-e84f-4387-9c41-c90e7d1fc6fa","ba33b4c1-47f0-4aa2-9e3a-fcf96229d355","ade4558f-5438-4383-b42b-728e8a745cc8","ad064258-2178-48f8-845c-ac1ce0217be8","acefb7fd-11c7-4a43-9544-b4fb461db94c","909b6a0a-4efc-4464-90ac-b8b9a8f22fc2","8a03c1e7-3991-4cca-8726-88c339766144","860eb891-b9eb-44ba-94c1-51cfc2be9dd9","719e09ae-5513-4cc3-bce1-97503a0a7658","6fcd99e7-2206-4c45-86aa-411a87b7fcac","235592cc-47c7-49cc-82e4-129f5333cc45","2214404d-3140-44bf-9c9d-438fa56b5a50"],feCategory:!0},{id:"2d7b4be7-8269-4ff4-81d6-0c92e95790d5",name:"Email integration",description:"Connectivity email integration",createdAt:new Date,updatedAt:new Date,permissionIds:["9a0bb3db-8bdb-4278-8f18-9c484bcd2f8c","440f5616-ad85-43d1-b25d-1fd7930c6d26","2a5dcd6d-57a3-45c4-815f-c265609cc1f7"],feCategory:!0},{id:"31c7a260-55d6-43d5-a872-4f9e22982ff5",name:"Events",description:"Connectivity Events",createdAt:new Date,updatedAt:new Date,permissionIds:["85c90d0f-3bb0-40c0-914a-640c7ca9eea5","750a96a5-8abf-4340-b91a-723c7bb8bcfd","4fee0eb0-5b17-450b-bea4-b9b908230bda"],feCategory:!0},{id:"42aaebe1-893d-4da5-99d7-375a4537b7a4",name:"Account settings",description:"Account profile settings",createdAt:new Date,updatedAt:new Date,permissionIds:["f26b00f8-ffe0-4739-b15c-7db15c27ea26","eb11313d-c7bb-43c0-a85d-c79bedab46b1","a9c803b0-ebfa-49b9-9607-f0d3a390ee61","634d3fab-b470-4a92-a25b-245459ddd6db"],feCategory:!0},{id:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",name:"Slack integration",description:"Connectivity Slack integration",createdAt:new Date,updatedAt:new Date,permissionIds:["f403c6b9-1abe-4ec7-9971-aa032255fc25","ef2a5f1a-74c5-431f-b1a6-d4fb5026e374","e3231a61-e425-4ac1-aa87-654ab995af5c","9fc1fa37-a8b9-4931-b2b5-5de55df25289","87c3df9d-0ab2-4e97-bfc8-777a68ba2543","7993a558-0af5-4d77-b9fc-8e8114f0ce0b","7826470b-151f-4bab-b2c0-785e09878616","5b0323d1-a0a0-4d4f-9bb8-b1634d9afa94","4245736e-13b0-48fd-9a08-bc93809dcdaf","2fccccb1-36f5-4c5c-8d93-73ab15d0b2d9"],feCategory:!0},{id:"6b925df5-8b09-470a-9fcc-dae0beae1af4",name:"Audits",description:"Audit Logs",createdAt:new Date,updatedAt:new Date,permissionIds:["97085bb5-bec7-49eb-9744-4d35bbb83ad3"],feCategory:!0},{id:"77154759-0a04-4669-b6b4-0858d3c1190e",name:"Secure access",description:"Secure access general",createdAt:new Date,updatedAt:new Date,permissionIds:["925e0c16-aead-41e6-b62f-8ddb2ea4ed06","8d71b676-754c-4600-afe7-ca5add1e6809","1c81d4ca-47a2-4564-b9d9-9d346b8cdbe7","04dbcc11-61db-40a9-9577-9b73e50d1d03"],feCategory:!0},{id:"916d6db5-489e-4109-95cf-57dee7802c57",name:"Webpush integration",description:"Webpush notifications integration",createdAt:new Date,updatedAt:new Date,permissionIds:["e5a7bbd3-f76b-4559-979d-885c5c75f72f","cb47ea6f-0a59-4694-97d0-9c32f6732e85"],feCategory:!0},{id:"9707ef7f-afd3-4d1f-962e-68c0d876db53",name:"Subscriptions",description:"Subscriptions access general",createdAt:new Date,updatedAt:new Date,permissionIds:["ce03de78-a7f4-4498-acce-df4aae30ed0d","ae81dd56-2f94-4da8-9c16-b6c781b0dcb7","72e55675-ea98-4f1a-85f0-09319cdcbcbf"],feCategory:!0},{id:"a71e2e14-0cdb-42df-b297-d00af2d4e62e",name:"Users management",description:"Secure access users management",createdAt:new Date,updatedAt:new Date,permissionIds:["e7263c99-874f-4e17-8d63-25ae3d9f5739","db957d5f-4048-4011-bcb4-5d21af0560e4","c52b0a96-dcff-4fba-aa8e-ce3a7336bde2","bc754ce1-ebbe-446a-bb84-4f287be0651c","998756c3-773a-4771-b7a5-510e795fb5f4","88565631-dc77-472c-b1d9-18674483c24b","6b84ddeb-a242-48c5-bf2a-62105315518a","61874f64-2204-4eec-8f02-0d38bd5a66b8","4c47caae-d384-48bb-99bc-554aafa2888f","43695880-d40e-412d-b342-434d58c5c8ca","4003ac5b-326c-4dc2-afb1-8900e16ee443","007c612d-5184-4f04-846e-d49c6591de0c"],feCategory:!0},{id:"c058e114-917c-4ad1-940e-11e9cc40b638",name:"Roles and permissions",description:"Secure access roles and permissions",createdAt:new Date,updatedAt:new Date,permissionIds:["c89960c8-6d67-44fa-a3aa-1a6826f45b0d","93be3a9a-98a2-48b8-a146-a223e457c904","80e49f9a-7628-4efc-913b-5f80ca92f106","7f2576d6-cbbb-4c7b-bb70-d75a88d9ce47","6a337814-34e5-4c24-a56f-d462c1db218b"],feCategory:!0},{id:"c38e9f59-ff65-4f9f-a31d-0bbfc44df347",name:"Groups",description:"Secure access groups",createdAt:new Date,updatedAt:new Date,permissionIds:["e1907e68-877d-4f2d-a266-d54e143c3c0c","7a17405a-6c4b-4053-9843-f9d5e3af9e00","5ee7bb2d-aad4-497f-94d2-9e255c470882","4c406972-c815-46a9-8f47-9708adc334b8","399bff45-aa24-49ae-9357-5f05a5eef3a5","0037b3ad-5f77-4157-aa33-33c92b5fe057"],feCategory:!0},{id:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",name:"Connectivity",description:"Connectivity general",createdAt:new Date,updatedAt:new Date,permissionIds:["e8c0e727-f562-449a-82c5-f7691defde02","c88bf74a-66a4-48c2-bc1b-2e2aa057858d","a43e059d-d731-44b1-94bb-fb6b16c62210","3f118e4c-badd-45d1-8056-3f3428be92ca"],feCategory:!0},{id:"d24db1e3-002b-421d-951d-09a967dd7cd5",name:"Account Hierarchy",description:"Account hierarchy",createdAt:new Date,updatedAt:new Date,permissionIds:["b6e66e0f-c6d2-4113-865a-57d08b1dec45","a1807695-54a2-4f95-95de-a9b246488aae","85e1fd7b-2bb7-498f-8521-5f8e5774c01e","60cfedb4-64ca-40d1-8b3a-4288bcde1209"],feCategory:!0},{id:"e74e5390-396b-429c-9544-62417912d018",name:"Webhooks integration",description:"Connectivity webhooks integration",createdAt:new Date,updatedAt:new Date,permissionIds:["996e42ed-b1d8-4e36-aa76-58091c56bdf7","8e7014d4-13fa-439a-a313-a2b9141f8b47","2dfde8ef-7df2-4426-bb8d-33615e399a4d","16647407-ed6f-4ca6-83a0-86225d921959"],feCategory:!0},{id:"e8af2833-1bbf-4ccf-8658-f6e0c60621b9",name:"API tokens",description:"Secure access API tokens",createdAt:new Date,updatedAt:new Date,permissionIds:["f03dc571-0769-4bcf-9c51-776b81582a14","c395932b-c732-41ad-bec6-ced7602bf79e","94351961-e9c8-4c63-8818-ae8481ceab22","5a744287-d01e-4a7a-8a37-2ce212ce5ff5","0cf97f9f-84dc-4dfc-bf41-2ad4b6c072e9","0c8cdac0-b364-4ab6-9737-7aa43f944013"],feCategory:!0}];let gg,Sg,vg;!function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORDLESS="PASSWORDLESS",e.ACTIVATION_LINK="ACTIVATION_LINK"}(gg||(gg={})),function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORD="PASSWORD"}(Sg||(Sg={})),function(e){e.profile="profile",e.privacy="privacy",e.personalApiTokens="personalApiTokens",e.account="account",e.users="users",e.groups="groups",e.security="security",e.sso="sso",e.audits="audits",e.webhooks="webhooks",e.apiTokens="apiTokens",e.roles="roles",e.subscriptions="subscription",e.allAccounts="allAccounts"}(vg||(vg={})),vg.profile,vg.privacy,vg.personalApiTokens,vg.account,vg.users,vg.groups,vg.security,vg.sso,vg.audits,vg.webhooks,vg.apiTokens,vg.roles,vg.subscriptions,vg.allAccounts;const hg=e=>{try{return new URL(e),!0}catch(e){return!1}},mg=e=>{const{searchParams:t}=new URL(e),n=t.toString();if(n)return`?${n}`},bg=e=>{const t=new URLSearchParams(window.location.search).get(e);return null!=t?t:void 0},Ag="tenantId",Tg=e=>e.mfaRequired&&e.mfaToken?($o.setAccessToken(null),$o.setUser(null),!0):($o.setAccessToken(e.accessToken),$o.setUser(e),!1),Eg=e=>{const{numberOfPhoneDevices:t,numberOfAuthenticators:n,numberOfEmails:a,totalDevices:i}=(e=>{const t=+Boolean(e.webauthn.length),n=+Boolean(e.phones.length),a=+Boolean(e.authenticators.length),i=+Boolean(e.emails.length);return{numberOfWebAuthnDevices:t,numberOfPhoneDevices:n,numberOfAuthenticators:a,numberOfEmails:i,totalDevices:t+n+a+i}})(e);if(1===i){if(n)return ln.authenticatorApp;if(t)return ln.smsVerifyCode;if(a)return ln.emailVerifyCode}return ln.verify},kg=e=>{if(1===e.length){const[t]=e;if(t===js.AuthenticatorApp)return ln.authenticatorApp;if(t===js.SMS)return ln.smsSetPhoneNumber;if(t===js.EmailCode)return ln.emailVerifyCode}return ln.verify};function*Ig(e){let t=Ot.loginWithTwoFactor,n={};const{loginState:a}=yield Bi((e=>e.auth)),{isAllowedToRemember:i,mfaDeviceExpiration:o}=yield xi(lp.auth.checkIfAllowToRememberMfaDevice,e.mfaToken);!e.hasOwnProperty("mfaEnrolled")||e.mfaEnrolled?n={mfaDevices:e.mfaDevices,step:Eg(e.mfaDevices)}:(n={step:kg(e.mfaStrategies),qrCode:e.qrCode,recoveryCode:e.recoveryCode,loading:!1,mfaToken:e.mfaToken,mfaStrategies:e.mfaStrategies},t=Ot.forceTwoFactor);let r={};const s=localStorage.getItem("register-quick-login");return s&&(r={quickLoginToRegister:s,flow:Pt.RegisterQuickLogin}),{user:void 0,isAuthenticated:!1,mfaState:n,loginState:M({},a,r,{mfaToken:e.mfaToken,mfaRequired:e.mfaRequired,loading:!1,error:void 0,step:t,tenantsLoading:!0,email:e.userEmail,tenants:[],allowRememberMfaDevice:i,mfaDeviceExpiration:o,isBreachedPassword:e.isBreachedPassword})}}const Og=(e,t)=>e?(e=>Boolean(null==e?void 0:e.statusCode))(e)?e.message:((e=>e instanceof Error||(null==e?void 0:e.message)&&(null==e?void 0:e.stack)&&"Error"===(null==e?void 0:e.name))(e)?console.error(e.message):"string"==typeof e&&console.error(e),null!=t?t:"We're facing some difficulties, Please try again"):t;let Pg;function _g(e,t){var n,a;null==(n=(a=window).onFronteggEvent)||n.call(a,e,t)}!function(e){e.SIGNUP_COMPLETED="signup_completed",e.USER_VERIFIED="user_verified"}(Pg||(Pg={}));const Lg=(e,t=[])=>Object.entries(e).reduce(((e,[n,a])=>"object"==typeof a?[...e,...Lg(a,[...t,n])]:[...e,{type:[...t,n].join("/"),payload:a}]),[]),wg=["callback"];function*Dg(){yield Fi(xa.setCustomLoginState({loading:!0}));try{const e=yield xi(lp.metadata.getAdminBoxMetadata);yield Fi(xa.setCustomLoginState({tenantMetadata:e,loading:!1}))}catch(e){yield Fi(xa.setCustomLoginState({loading:!1,error:Og(e)}))}}function*Ug(e){let{payload:{callback:t}}=e,n=Za(e.payload,wg);try{yield Fi(xa.setCustomLoginState({error:null,saving:!0}));const e=Lg(n);if(0===e.length)throw new Error("No changes to update");yield xi(lp.metadata.updateAdminBoxMetadata,{actions:e});const a=yield xi(lp.metadata.getAdminBoxMetadata);yield Fi(xa.setCustomLoginState({tenantMetadata:a,saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setCustomLoginState({error:Og(e,"No changes to update"),saving:!1})),null==t||t(null,e)}}function*Rg(){return!!(yield xi(Cg))}function*Cg(){const e=$o.getContext();if(null==e||!e.tenantResolver)return;const t=yield e.tenantResolver();if(null!=t&&t.tenant)return t.tenant;const{customLoginAlias:n,hasCustomLogin:a}=yield Bi((e=>{var t,n;const a=null==(t=e.auth)||null==(n=t.tenantsState)?void 0:n.activeTenant;return{customLoginAlias:null==a?void 0:a.alias,hasCustomLogin:null==a?void 0:a.hasCustomLogin}}));return a?n:void 0}function*Ng(){try{var e;if(!(yield xi(Rg)))return;const t=yield Bi((e=>e.auth.isAuthenticated)),{getSettings:n,getPublicSettings:a}=lp.accountSettings,{applicationUrl:i}=yield xi(t?n:a);if(!i)return;const{routes:o}=yield Bi((e=>e.auth)),r=null!=(e=mg(i))?e:"";yield Fi(xa.setState({routes:M({},o,{customLoginAuthenticatedUrl:i,customLoginUrl:o.loginUrl+r})})),yield Fi(xa.setCustomLoginState({customLoginSearchParams:null!=r?r:void 0}))}catch{}}function*Mg(){yield Go(xa.loadTenantMetadata,Dg),yield Go(xa.updateTenantMetadata,Ug)}let Fg;!function(e){e.RECOMMENDATIONS="recommendations",e.INSIGHTS="insights",e.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS="sendBulkResetBreachedPasswordEmails",e.SEND_BREACHED_PASSWORD_EMAIL="sendBreachedPasswordEmail",e.BREACHED_PASSWORD_USERS_TABLE="breachedPasswordUsersTable",e.UNENROLLED_MFA_USERS_TABLE="unenrolledMfaUsersTable",e.INACTIVE_USERS_TABLE="inactiveUsersTable"}(Fg||(Fg={}));const Gg=["callback"];function $g(e){return function*(t){const[n]=yield xi(Lp,["security-center-admin-portal-major-version"]);yield e(t),n&&(yield xg(),yield Vg())}}function*xg(){const e=Fg.RECOMMENDATIONS;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0}));try{var t;const{recommendations:n,scoring:a}=yield xi(lp.securityCenter.getRecommendations);yield Fi(xa.setSecurityCenterState({recommendations:n.items,score:null!=(t=null==a?void 0:a.score)?t:0}))}catch(t){yield Fi(xa.setSecurityCenterStateError({key:e,value:Og(t)}))}finally{yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}}function*Vg(){const e=Fg.INSIGHTS;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0}));try{const{insights:t}=yield xi(lp.securityCenter.getInsights);yield Fi(xa.setSecurityCenterState({insights:t.items}))}catch(t){yield Fi(xa.setSecurityCenterStateError({key:e,value:Og(t)}))}finally{yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}}function*jg(e){let{payload:{callback:t}}=e,n=Za(e.payload,Gg);const a=Fg.SEND_BREACHED_PASSWORD_EMAIL;yield Fi(xa.setSecurityCenterStateError({key:a,value:!1})),yield Fi(xa.setSecurityCenterStateLoader({key:a,value:!0}));try{yield xi(lp.auth.forgotPassword,n),null==t||t(!0)}catch(e){yield Fi(xa.setSecurityCenterStateError({key:a,value:Og(e)})),null==t||t(!1,e)}finally{yield Fi(xa.setSecurityCenterStateLoader({key:a,value:!1}))}}function*Bg({payload:{callback:e}}){const t=Fg.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS;yield Fi(xa.setSecurityCenterStateError({key:t,value:!1})),yield Fi(xa.setSecurityCenterStateLoader({key:t,value:!0}));try{yield xi(lp.users.sendResetBreachedPasswordEmails),null==e||e(!0)}catch(n){yield Fi(xa.setSecurityCenterStateError({key:t,value:Og(n)})),null==e||e(!1)}finally{yield Fi(xa.setSecurityCenterStateLoader({key:t,value:!1}))}}function*Wg({key:e,tableState:t,updateStateKey:n,_offset:a,_limit:i,_preset:o,_email:r,_maxInactiveSeconds:s}){var l,c,d,u;yield Fi(xa.setSecurityCenterStateError({key:e,value:!1})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0}));const y=null!=(l=null!=a?a:null==t||null==(c=t.queryParams)?void 0:c._offset)?l:0,f=null!=(d=null!=i?i:null==t||null==(u=t.queryParams)?void 0:u._limit)?d:10,p=M({_offset:y,_limit:f,_includeSubTenants:!1,_preset:o,_maxInactiveSeconds:s},!!r&&{_email:r});try{const{items:t,_metadata:{totalItems:a,totalPages:i}}=yield xi(lp.users.getUsersV3,p),o={totalUsersItems:a,totalUsersPages:i,usersPageOffset:y,queryParams:M({_offset:y,_limit:f,_maxInactiveSeconds:s},!!r&&{_email:r})};if(t.length){const e=yield function*(e){const t=e.map((e=>e.id)),n=yield xi(lp.roles.getRoles),a=yield xi(lp.users.getUsersRoles,{ids:t});return e.map((e=>{var t,i;const o=null==a||null==(t=a.find((t=>t.userId===e.id)))?void 0:t.roleIds;return M({},e,{roles:null!=(i=null==o?void 0:o.map((e=>{var t;return null!=(t=null==n?void 0:n.find((t=>t.id===e)))?t:[]})))?i:[]})}))}(t);yield Fi(xa.setSecurityCenterState({[n]:M({users:e},o)}))}else yield Fi(xa.setSecurityCenterState({[n]:M({users:[]},o)}))}catch(t){yield Fi(xa.setSecurityCenterStateError({key:e,value:Og(t)}))}finally{yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}}function*zg({payload:e}){var t;const n=Fg.BREACHED_PASSWORD_USERS_TABLE,a=yield null!=(t=Bi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.breachedPasswordUsersTable})))?t:{};yield Wg(M({key:n,updateStateKey:"breachedPasswordUsersTable",_preset:ya.BREACHED_PASSWORDS,tableState:a},e))}function*Kg({payload:e}){var t;const n=Fg.UNENROLLED_MFA_USERS_TABLE,a=yield null!=(t=Bi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.unenrolledMfaUsersTable})))?t:{};yield Wg(M({key:n,updateStateKey:"unenrolledMfaUsersTable",_preset:ya.MFA_UNENROLLED,tableState:a},e))}function*Hg({payload:e}){var t;const n=Fg.INACTIVE_USERS_TABLE,a=yield null!=(t=Bi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.inactiveUsersTable})))?t:{};yield Wg(M({key:n,updateStateKey:"inactiveUsersTable",_preset:ya.INACTIVE,tableState:a},e))}function*qg(){yield Mo(xa.loadRecommendations,xg),yield Mo(xa.loadInsights,Vg),yield Mo(xa.sendResetBreachedPasswordEmail,jg),yield Mo(xa.sendBulkResetBreachedPasswordEmails,Bg),yield Mo(xa.loadBreachedPasswordUsers,zg),yield Mo(xa.loadUnenrolledMfaUsers,Kg),yield Mo(xa.loadInactiveUsers,Hg)}function*Jg(){const e=Fg.RECOMMENDATIONS;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0})),yield Wi(500),yield Fi(xa.setSecurityCenterState({recommendations:lg.recommendations.items,score:lg.scoring.score})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}function*Yg(){const e=Fg.INSIGHTS;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0})),yield Wi(500),yield Fi(xa.setSecurityCenterState({insights:cg.insights.items})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}function*Xg(){const e=Fg.BREACHED_PASSWORD_USERS_TABLE;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0})),yield Wi(500),yield Fi(xa.setSecurityCenterState({breachedPasswordUsersTable:dg})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}function*Qg(){const e=Fg.UNENROLLED_MFA_USERS_TABLE;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0})),yield Wi(500),yield Fi(xa.setSecurityCenterState({unenrolledMfaUsersTable:yg})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}function*Zg(){const e=Fg.INACTIVE_USERS_TABLE;yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!0})),yield Wi(500),yield Fi(xa.setSecurityCenterState({inactiveUsersTable:ug})),yield Fi(xa.setSecurityCenterStateLoader({key:e,value:!1}))}function*eS({payload:{callback:e}}){const t=Fg.SEND_BREACHED_PASSWORD_EMAIL;yield Fi(xa.setSecurityCenterStateLoader({key:t,value:!0})),yield Wi(500),null==e||e(!0),yield Fi(xa.setSecurityCenterStateLoader({key:t,value:!1}))}function*tS(){yield Mo(xa.loadRecommendations,Jg),yield Mo(xa.loadInsights,Yg),yield Mo(xa.loadBreachedPasswordUsers,Xg),yield Mo(xa.loadUnenrolledMfaUsers,Qg),yield Mo(xa.loadInactiveUsers,Zg),yield Mo(xa.sendResetBreachedPasswordEmail,eS)}const nS=["callback"],aS=["callback"],iS=["callback"],oS=["callback"],rS=["callback"],sS=["callback"];function*lS(){yield Fi(xa.setSecurityPolicyGlobalState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getGlobalSecurityPolicy);yield Fi(xa.setSecurityPolicyGlobalState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyGlobalState({error:Og(e),loading:!1}))}yield Fi(xa.loadSecurityPolicyMfa()),yield Fi(xa.loadSecurityPolicyVendorMfa()),yield Fi(xa.loadSecurityPolicyLockout()),yield Fi(xa.loadSecurityPolicyVendorLockout()),yield Fi(xa.loadSecurityPolicyVendorPasswordHistory()),yield Fi(xa.loadSecurityPolicyCaptcha()),yield Fi(xa.loadPublicAuthStrategiesPolicy())}function*cS(e){var t,n;if(!(yield xi(Rg)))return e;const a=yield xi(uS);return null!=a&&null!=(t=a.mainAuthStrategies)&&null!=(n=t[0])&&n.strategy?M({},e,{authStrategy:a.mainAuthStrategies[0].strategy}):e}function*dS(){yield Fi(xa.setSecurityPolicyPublicState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getVendorConfig),t=yield cS(e);yield Fi(xa.setSecurityPolicyPublicState({policy:t,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyPublicState({error:Og(e),loading:!1}))}}function*uS(){const e=yield Bi((({auth:e})=>e.isAuthenticated));let t;return t=e?yield xi(lp.auth.getPublicAuthStrategiesConfigForAuthenticatedUser):yield xi(lp.auth.getVendorPublicAuthStrategiesConfig),t}function*yS(){yield Fi(xa.setSecurityPolicyAuthStrategyPublicState({loading:!0,error:null}));try{var e,t;const n=yield xi(uS);yield function*(e){const t=yield xi(Rg);if(!e||!t)return;const{policy:n}=yield Bi((({auth:e})=>{var t;return null==(t=e.securityPolicyState)?void 0:t.publicPolicy}));yield Fi(xa.setSecurityPolicyPublicState({policy:M({},n,{authStrategy:e}),loading:!1}))}(null==n||null==(e=n.mainAuthStrategies)||null==(t=e[0])?void 0:t.strategy),yield Fi(xa.setSecurityPolicyAuthStrategyPublicState({policy:n,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyAuthStrategyPublicState({error:Og(e),loading:!1}))}}function*fS(){yield Fi(xa.setSecurityPolicyMfaState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getMfaPolicy);yield Fi(xa.setSecurityPolicyMfaState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyMfaState({error:Og(e),loading:!1}))}}function*pS(){yield Fi(xa.setSecurityPolicyMfaState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getVendorMfaPolicy);yield Fi(xa.setSecurityPolicyVendorMfaState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyVendorMfaState({error:Og(e),loading:!1}))}}function*gS(e){let{payload:{callback:t}}=e,n=Za(e.payload,nS);yield Fi(xa.setSecurityPolicyMfaState({saving:!0,error:null}));try{const e=yield xi(lp.auth.saveMfaPolicy,n);yield Fi(xa.setSecurityPolicyMfaState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Fi(xa.setSecurityPolicyMfaState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*SS(){yield Fi(xa.setSecurityPolicyLockoutState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getLockoutPolicy);yield Fi(xa.setSecurityPolicyLockoutState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyLockoutState({error:Og(e),loading:!1}))}}function*vS(e){let{payload:{callback:t}}=e,n=Za(e.payload,aS);yield Fi(xa.setSecurityPolicyLockoutState({saving:!0,error:null}));try{const e=yield xi(lp.auth.saveLockoutPolicy,n);yield Fi(xa.setSecurityPolicyLockoutState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Fi(xa.setSecurityPolicyLockoutState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*hS(){yield Fi(xa.setSecurityPolicyVendorLockoutState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getVendorLockoutPolicy);yield Fi(xa.setSecurityPolicyVendorLockoutState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyVendorLockoutState({error:Og(e),loading:!1}))}}function*mS(){yield Fi(xa.setSecurityPolicyLockoutState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getCaptchaPolicy);yield Fi(xa.setSecurityPolicyCaptchaState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyCaptchaState({error:Og(e),loading:!1}))}}function*bS(){yield Fi(xa.setSecurityPolicyPasswordHistoryState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getPasswordHistoryPolicy);yield Fi(xa.setSecurityPolicyPasswordHistoryState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyPasswordHistoryState({error:Og(e),loading:!1}))}}function*AS(){yield Fi(xa.setSecurityPolicyVendorPasswordHistoryState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getVendorPasswordHistoryPolicy);yield Fi(xa.setSecurityPolicyVendorPasswordHistoryState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyVendorPasswordHistoryState({error:Og(e),loading:!1}))}}function*TS(e){let{payload:{callback:t}}=e,n=Za(e.payload,iS);yield Fi(xa.setSecurityPolicyPasswordHistoryState({saving:!0,error:null}));try{const e=yield xi(lp.auth.savePasswordHistoryPolicy,n);yield Fi(xa.setSecurityPolicyPasswordHistoryState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Fi(xa.setSecurityPolicyPasswordHistoryState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*ES(){yield Fi(xa.setSecurityPolicyPasswordState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getPasswordConfigPolicy);yield Fi(xa.setSecurityPolicyPasswordState({policy:e,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyPasswordState({error:Og(e),loading:!1}))}}function*kS(){yield Go(xa.loadSecurityPolicy,lS),yield Mo(xa.saveSecurityPolicyMfa,$g(gS)),yield Mo(xa.loadSecurityPolicyMfa,fS),yield Mo(xa.loadSecurityPolicyVendorMfa,pS),yield Mo(xa.saveSecurityPolicyLockout,$g(vS)),yield Mo(xa.loadSecurityPolicyLockout,SS),yield Mo(xa.loadSecurityPolicyVendorLockout,hS),yield Mo(xa.loadSecurityPolicyCaptcha,mS),yield Mo(xa.saveSecurityPolicyPasswordHistory,$g(TS)),yield Mo(xa.loadSecurityPolicyPasswordHistory,bS),yield Mo(xa.loadSecurityPolicyVendorPasswordHistory,AS),yield Mo(xa.loadVendorPasswordConfig,ES),yield Mo(xa.loadPublicSecurityPolicy,dS),yield Mo(xa.loadPublicAuthStrategiesPolicy,yS)}function*IS(){yield Fi(xa.setSecurityPolicyPublicState({loading:!0,error:null}));try{yield Fi(xa.setSecurityPolicyPublicState({policy:Fp,loading:!1}))}catch(e){yield Fi(xa.setSecurityPolicyPublicState({error:Og(e),loading:!1}))}}function*OS(){yield Fi(xa.setSecurityPolicyGlobalState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyGlobalState({policy:Mp,loading:!1})),yield Fi(xa.loadSecurityPolicyMfa()),yield Fi(xa.loadSecurityPolicyVendorMfa()),yield Fi(xa.loadSecurityPolicyLockout()),yield Fi(xa.loadSecurityPolicyVendorLockout()),yield Fi(xa.loadSecurityPolicyPasswordHistory()),yield Fi(xa.loadSecurityPolicyVendorPasswordHistory()),yield Fi(xa.loadSecurityPolicyCaptcha())}function*PS(){yield Fi(xa.setSecurityPolicyMfaState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyMfaState({policy:Gp,loading:!1}))}function*_S(){yield Fi(xa.setSecurityPolicyVendorMfaState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyVendorMfaState({policy:Gp,loading:!1}))}function*LS(e){var t;let{payload:{callback:n}}=e,a=Za(e.payload,oS);yield Fi(xa.setSecurityPolicyMfaState({saving:!0,error:null}));const i=M({},$p,{id:null!=(t=a.id)?t:$p.id,enforceMFAType:a.enforceMFAType});yield At(),yield Fi(xa.setSecurityPolicyMfaState({policy:i,saving:!1})),null==n||n(i)}function*wS(){yield Fi(xa.setSecurityPolicyLockoutState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyLockoutState({policy:$p,loading:!1}))}function*DS(){yield Fi(xa.setSecurityPolicyVendorLockoutState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyVendorLockoutState({policy:$p,loading:!1}))}function*US(e){let{payload:{callback:t}}=e,n=Za(e.payload,rS);yield Fi(xa.setSecurityPolicyLockoutState({saving:!0,error:null})),yield At();const a=M({},$p,n,{id:n.id?n.id:$p.id});null==t||t(a),yield Fi(xa.setSecurityPolicyLockoutState({policy:a,saving:!1}))}function*RS(){yield Fi(xa.setSecurityPolicyLockoutState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyLockoutState({policy:$p,loading:!1}))}function*CS(){yield Fi(xa.setSecurityPolicyPasswordHistoryState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyPasswordHistoryState({policy:xp,loading:!1}))}function*NS(){yield Fi(xa.setSecurityPolicyVendorPasswordHistoryState({loading:!0,error:null})),yield At(),yield Fi(xa.setSecurityPolicyVendorPasswordHistoryState({policy:xp,loading:!1}))}function*MS(e){let{payload:{callback:t}}=e,n=Za(e.payload,sS);yield Fi(xa.setSecurityPolicyPasswordHistoryState({saving:!0,error:null})),yield At();const a=M({},xp,n,{id:n.id?n.id:xp.id});null==t||t(a),yield Fi(xa.setSecurityPolicyPasswordHistoryState({policy:a,saving:!1}))}function*FS(){yield Go(xa.loadSecurityPolicy,OS),yield Mo(xa.loadPublicSecurityPolicy,IS),yield Mo(xa.saveSecurityPolicyMfa,LS),yield Mo(xa.loadSecurityPolicyMfa,PS),yield Mo(xa.loadSecurityPolicyVendorMfa,_S),yield Mo(xa.saveSecurityPolicyLockout,US),yield Mo(xa.loadSecurityPolicyLockout,wS),yield Mo(xa.loadSecurityPolicyVendorLockout,DS),yield Mo(xa.loadSecurityPolicyCaptcha,RS),yield Mo(xa.saveSecurityPolicyPasswordHistory,MS),yield Mo(xa.loadSecurityPolicyPasswordHistory,CS),yield Mo(xa.loadSecurityPolicyVendorPasswordHistory,NS)}const GS=["phoneNumber"],$S=["events","url"];function*xS(){yield Fi(xa.setSignUpState({loading:!0}));try{const e=yield xi(lp.auth.getVendorConfig),t=yield cS(e),{allowSignups:n,allowNotVerifiedUsersLogin:a}=e;yield Fi(xa.setSignUpState({loading:!1,allowSignUps:n,allowNotVerifiedUsersLogin:a,firstLoad:!1})),yield Fi(xa.setSecurityPolicyPublicState({policy:t,loading:!1}))}catch(e){yield Fi(xa.setSignUpState({loading:!1,error:Og(e),firstLoad:!1}))}}function*VS(e){let{payload:{events:t,url:n}}=e,a=Za(e.payload,$S);yield Fi(xa.setSignUpState({loading:!0}));try{const{routes:e,onRedirectTo:r}=yield Bi((e=>e.auth)),{shouldActivate:s,user:l,tenantId:c,userId:d,tenants:u=[],activeTenant:y}=yield xi(lp.auth.signUpUser,(o=a,Za(o,GS)));if(!a.invitationToken){var i;const{email:e,name:o,companyName:r,phoneNumber:s}=a,l={email:e,name:o,companyName:r,url:n,phoneNumber:s||void 0,authenticationType:Sg.PASSWORD,id:d,tenantId:c,createdAt:new Date};null==t||null==(i=t.signUpComplete)||i.call(t,l),_g(Pg.SIGNUP_COMPLETED,l)}if(!s&&l&&Tg(l)){const t=yield Ig(l);yield Fi(xa.setState(t)),r(e.loginUrl)}else{const{tenantsState:e}=yield Bi((e=>e.auth));yield Fi(xa.setSignUpState({loading:!1,shouldActivate:s,stage:hn.SignUpSuccess})),yield Fi(xa.setState({user:l,isAuthenticated:!(null==l||!l.accessToken),tenantsState:M({},e,{tenants:u,activeTenant:y})}))}}catch(e){$o.setAccessToken(null),$o.setUser(null),yield Fi(xa.setSignUpState({loading:!1,error:Og(e)}))}var o;yield Fi(xa.setSignUpState({loading:!1}))}function*jS(){const{allowSignUps:e,allowNotVerifiedUsersLogin:t}=yield Bi((e=>e.auth.signUpState));yield Fi(xa.resetSignUpState()),yield Fi(xa.setSignUpState({allowSignUps:e,allowNotVerifiedUsersLogin:t}))}function*BS(){yield Go(xa.signUpUser,VS),yield Go(xa.resetSignUpStateSoft,jS)}const WS={setVendorState:(e,{payload:t})=>M({},e,t)},zS={loadVendorPublicInfo:dt("vendor/loadVendorPublicInfo")},KS={loading:!1},{reducer:HS,actions:qS}=yt({name:Nt,initialState:KS,reducers:M({},WS)}),JS=M({},qS,zS);function*YS(){yield Fi(JS.setVendorState({loading:!0}));try{const{whiteLabelMode:e=!1}=yield lp.vendor.getVendorPublicInfo();yield Fi(JS.setVendorState({whiteLabelMode:e,loading:!1}))}catch(e){yield Fi(JS.setVendorState({loading:!1})),console.error("failed to getVendorPublicInfo - ",e)}}var XS=n(9378),QS=n.n(XS);function ZS(e,t){return QS()(e,t)}function*ev({payload:e}){const t=null==e?void 0:e.callback;try{const e=yield xi(lp.entitlements.loadEntitlementsV2);yield function*(e){ZS(yield Bi((e=>{var t;return null==(t=e.auth.user)?void 0:t.entitlements})),e)||(yield Fi(xa.setEntitlements(e)))}(e),null==t||t(!0)}catch(e){null==t||t(!1)}}function*tv(){yield Go(xa.loadEntitlements,ev)}const nv=new class{constructor(){this.loginWithSSO=e=>{if(this.isWebkitAvailable()){var t,n,a;null==(t=window.webkit)||null==(n=t.messageHandlers)||null==(a=n.FronteggNativeBridge)||a.postMessage(JSON.stringify({action:"loginWithSSO",payload:e}))}else{if(!this.isJsInterfaceAvailable())throw new Error("FronteggNativeBridge is not available");var i;null==(i=window.FronteggNativeBridge)||i.loginWithSSO(e)}},this.loginWithSocialLogin=e=>{if(this.isWebkitAvailable()){var t,n,a;null==(t=window.webkit)||null==(n=t.messageHandlers)||null==(a=n.FronteggNativeBridge)||a.postMessage(JSON.stringify({action:"loginWithSocialLogin",payload:e}))}else{if(!this.isJsInterfaceAvailable())throw new Error("FronteggNativeBridge is not available");var i;null==(i=window.FronteggNativeBridge)||i.loginWithSocialLogin(e)}},this.promptSocialLoginConsent=()=>{var e,t;return null!=(e=null==(t=window.FronteggNativeBridgeFunctions)?void 0:t.shouldPromptSocialLoginConsent)&&e}}isWebkitAvailable(){var e,t;return null!=(null==(e=window.webkit)||null==(t=e.messageHandlers)?void 0:t.FronteggNativeBridge)}isJsInterfaceAvailable(){return null!=window.FronteggNativeBridge}isSocialLoginAvailable(){return this.isAvailable("loginWithSocialLogin")}isLoginWithSSOAvailable(){return this.isAvailable("loginWithSSO")}isAvailable(e){var t,n;return!(!this.isWebkitAvailable()&&!this.isJsInterfaceAvailable())&&null!=(t=null==(n=window.FronteggNativeBridgeFunctions)?void 0:n[e])&&t}};function*av(){const{publicAuthStrategyPolicy:e}=yield Bi((e=>e.auth.securityPolicyState)),{policy:t}=e,n=(e=>{var t;return!(null==e||null==(t=e.secondaryAuthStrategies)||!t.some((({isActive:e,strategy:t})=>e&&t===xs.Passkeys)))})(t),a="Passkeys"===localStorage.getItem("preferred-login-method"),i="true"===localStorage.getItem("dont-show-again-prompt-passkeys"),[o]=yield xi(Lp,["show-passkeys-new"]);if(!o||!n||a||i)return!1;{const{devices:e}=yield xi(lp.auth.getWebAuthnDevices);return yield Fi(xa.setPasskeysState({devices:null!=e?e:[]})),0===(null!=e&&e.length?e.length:0)}}function*iv({user:e,tenants:t=[],activeTenant:n},a={}){const{tenantsState:i}=yield Bi((e=>e.auth));yield Fi(xa.setState(M({user:e,tenantsState:M({},i,{tenants:t,activeTenant:n,loading:!1})},a)))}const ov="http://schemas.openid.net/pape/policies/2007/06/multi-factor",rv=["otp","sms","hwk"],sv="SHOULD_STEP_UP",lv=(e,{maxAge:t}={})=>{if(!e)return!1;const{amr:n=[],acr:a="",auth_time:i}=e;if(t&&i&&!(Date.now()/1e3-i<=t))return!1;const o=a===ov,r=-1!==n.indexOf("mfa"),s=void 0!==rv.find((e=>n.indexOf(e)));return o&&r&&s};function cv(){const e=window.location.pathname+window.location.search;window.localStorage.setItem(wt,e)}function*dv(e){const{routes:t,includeQueryParam:n,enforceRedirectToSameSite:a=!1,allowedRedirectOrigins:i=[]}=yield Bi((e=>e.auth));if(e)return(e=>{const{pathname:t}=new URL(e),n=mg(e);return n?t+n:t})(e);const{authenticatedUrl:o,loginUrl:r,logoutUrl:s,socialLoginCallbackUrl:l,activateUrl:c}=t;let d=window.localStorage.getItem(wt);d&&![r,s,l,c].includes(d)||(d=o);const u=(({authenticatedUrl:e,enforceRedirectToSameSite:t,allowedRedirectOrigins:n,includeQueryParam:a})=>{let i=e;const o=new URL(window.location.href).searchParams.get("redirectUrl");return o?t&&hg(o)?((e,t)=>{const n=new URL(window.location.href),a=new URL(e),i=a.origin===n.origin;return t.includes(a.origin)||i})(o,n)?i=o:console.warn("The redirect url param is not valid, the origin is a different site"):i=o:a&&(i+=window.location.search),i})({authenticatedUrl:d,includeQueryParam:n,enforceRedirectToSameSite:a,allowedRedirectOrigins:i});return(y=u).startsWith(null==(f=window)?void 0:f.location.origin)?y.replace(null==(p=window)?void 0:p.location.origin,""):y;var y,f,p}function*uv(e,{customLoginAuthenticatedUrl:t,forceStepUpUrl:n,shouldStepUpDuringLogin:a}={}){const i=$o.onRedirectTo;let o;if(n)o=n;else{var r;if(a){const e=window.localStorage.getItem(wt);e&&!hg(e)&&(o=e)}o||(o=yield xi(dv,t)),null==(r=window)||r.localStorage.removeItem(wt)}yield Wi(200),Fi(e()),i(o,{refresh:o.startsWith("http")})}function*yv(){var e;const{routes:{customLoginAuthenticatedUrl:t,stepUpUrl:n}}=yield Bi((e=>e.auth)),a=null==(e=window)?void 0:e.localStorage.getItem(sv),i=yield Bi((({auth:e})=>e.user));var o;if(a&&(null==(o=window)||o.localStorage.removeItem(sv)),n&&a&&!lv(i))return void(yield xi(uv,xa.resetLoginState,{forceStepUpUrl:n}));let r=t;t||(yield xi(Ng),r=yield Bi((e=>{var t;return null==(t=e.auth.routes)?void 0:t.customLoginAuthenticatedUrl}))),yield xi(uv,xa.resetLoginState,{customLoginAuthenticatedUrl:r,shouldStepUpDuringLogin:!!a})}function*fv(){yield xi(uv,xa.resetStepUpState)}const pv=["callback"];function*gv(e,t,n){const{loginState:a}=yield Bi((e=>e.auth));let i={};if(!n){const t=a.flow===Pt.Login?Ot.success:a.step;i={loginState:{flow:a.flow,quickLoginToRegister:a.quickLoginToRegister,loading:!1,step:t,error:void 0,tenants:e}}}return M({},i,{isAuthenticated:t})}function*Sv(e,t){const{loginState:n}=yield Bi((e=>e.auth));if(n.flow!==Pt.Login)return;const[a]=yield xi(Lp,["security-center-show-login-flows"]);a&&n.isBreachedPassword&&!e?yield Fi(xa.setLoginState({step:Ot.breachedPassword,loading:!1})):(yield xi(av))?yield Fi(xa.setLoginState({step:Ot.promptPasskeys,loading:!1})):yield yv(),null==t||t(!0)}function*vv(e){yield fv(),null==e||e(!0)}function*hv(e,t,n){let{callback:a}=e,i=Za(e,pv);yield Fi(t({loading:!0,error:void 0}));try{const{user:e,tenants:o=[],activeTenant:r}=yield xi(lp.auth.loginWithMfaV2,i),s=!!e.accessToken,l=yield xi(gv,o,s,n);if(yield xi(iv,{user:e,tenants:o,activeTenant:r},l),e.id&&localStorage.setItem("userId",e.id),yield Fi(t({loading:!1,error:void 0})),n)return void(yield xi(vv,a));yield xi(Sv,s,a)}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==a||a(!1,e)}}function*mv({payload:e}){yield hv(e,xa.setLoginState,!1)}function*bv(){yield xi(fv)}function*Av(e){const{loginState:t}=yield Bi((e=>e.auth)),{step:n}=yield Bi((e=>e.auth.mfaState)),[a]=yield xi(Lp,["security-center-show-login-flows"]);if(t.flow===Pt.Login)if(a&&t.isBreachedPassword&&!e)yield Fi(xa.setLoginState({step:Ot.breachedPassword,loading:!1}));else{const e=yield xi(av);n===ln.smsVerifyCode&&e?yield Fi(xa.setLoginState({step:Ot.promptPasskeys,loading:!1})):yield yv()}}function*Tv({user:e,tenants:t,activeTenant:n},a=!1){yield Fi(xa.setUser(e)),yield Fi(xa.setTenantsState({tenants:t,activeTenant:n,loading:!1})),e.id&&localStorage.setItem("userId",e.id);const i=!!e.accessToken;yield Fi(xa.setState({isAuthenticated:i})),a?yield xi(bv):yield xi(Av,i)}const Ev=["callback","deviceId"],kv=["callback","deviceId"];function*Iv(e,t){let{callback:n,deviceId:a}=e,i=Za(e,Ev);yield Fi(t({loading:!1,error:void 0}));try{const e=yield xi(lp.auth.preVerifyMFASMSForLogin,a,i);yield Fi(xa.setMfaState({otcToken:e.otcToken,step:ln.smsVerifyCode,phoneNumber:e.phoneNumber})),yield Fi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==n||n(null)}}function*Ov(e,t,n=!1){let{callback:a,deviceId:i}=e,o=Za(e,kv);yield Fi(t({loading:!0}));try{const e=yield xi(lp.auth.verifyMFASMSForLoginV2,i,o);yield Tv(e,n),yield Fi(t({loading:!1,error:void 0})),null==a||a(!0)}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==a||a(null)}}function*Pv({payload:e}){yield Iv(e,xa.setLoginState)}function*_v({payload:e}){yield Ov(e,xa.setLoginState,!1)}const Lv=["callback","deviceId"],wv=["callback","deviceId"];function*Dv(e,t){let{callback:n,deviceId:a}=e,i=Za(e,Lv);yield Fi(t({loading:!0}));try{var o;const e=yield xi(lp.auth.preVerifyMFAWebAuthnForLogin,a,i),r=M({},e.options,{challenge:kt(e.options.challenge),allowCredentials:null==(o=e.options.allowCredentials)?void 0:o.map((e=>M({},e,{id:kt(e.id)})))});yield Fi(t({loading:!1,error:void 0})),null==n||n({options:r,webauthnToken:e.webauthnToken})}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==n||n(null)}}function*Uv(e,t,n){let{callback:a,deviceId:i}=e,o=Za(e,wv);yield Fi(t({loading:!0}));try{const e=It(o.publicKey),r=yield xi(lp.auth.verifyMFAWebAuthnForLoginV2,i,M({},o,{options:e}));yield Tv(r,n),yield Fi(t({loading:!1,error:void 0})),null==a||a(!0)}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==a||a(null)}}function*Rv({payload:e}){yield Dv(e,xa.setLoginState)}function*Cv({payload:e}){yield Uv(e,xa.setLoginState,!1)}const Nv=["callback"],Mv=["callback"];function*Fv(e,t){let{callback:n}=e,a=Za(e,Nv);yield Fi(t({loading:!0,error:void 0}));try{const e=yield xi(lp.auth.preVerifyMFAEmailCode,a);yield Fi(xa.setMfaState({otcToken:e.otcToken,step:ln.emailVerifyCode})),yield Fi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Fi(t({error:Og(e)})),null==n||n(null)}}function*Gv(e,t){let{callback:n}=e,a=Za(e,Mv);yield Fi(t({loading:!0}));try{const e=yield xi(lp.auth.verifyMFAEmailCodeV2,a);yield Tv(e),yield Fi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Fi(t({loading:!1,error:Og(e)})),null==n||n(null)}}function*$v({payload:e}){yield Fv(e,xa.setLoginState)}function*xv({payload:e}){yield Gv(e,xa.setLoginState)}const Vv=["callback"],jv=["callback"],Bv=["callback"],Wv=["callback"],zv=["callback","events"],Kv=["callback"],Hv=["callback"],qv=["callback"],Jv=["callback"],Yv=["user"],Xv=["callback"],Qv=["callback"],Zv=["callback"],eh=["callback"],th=["callback"];function*nh(e){const t=yield Bi((e=>{var t;return null==(t=e.auth.user)?void 0:t.entitlements}));return ZS(t,null==e?void 0:e.entitlements)?M({},e,{entitlements:t}):e}function*ah(){let e;try{var t;const n=yield xi(lp.metadata.getSamlMetadata);e=null==n||null==(t=n.configuration)?void 0:t.acsUrl}catch(e){console.error(e)}yield Fi(xa.setState({ssoACS:e}))}function*ih(){try{const{isActive:e}=yield xi(lp.auth.getSSOPublicConfiguration);yield Fi(xa.setState({isSSOAuth:e}))}catch(e){console.error(e)}}function*oh(e){var t;const{routes:n,loginState:a}=yield Bi((e=>e.auth)),i=null!=(t=localStorage.getItem("register-quick-login"))?t:a.quickLoginToRegister;return i&&"true"!==localStorage.getItem(`${e.id}-${i}`)&&!window.location.pathname.endsWith(n.logoutUrl)}function*rh(){const{hostedLoginBox:e}=yield Bi((e=>e.auth));e?yield xi(sh):yield xi(ch)}function*sh(){const{user:e}=yield Bi((e=>e.auth));if(null==e||!e.refreshToken)return $o.setAccessToken(null),$o.setUser(null),void(yield Fi(xa.setState({user:null,isAuthenticated:!1})));try{const t={grant_type:"refresh_token",refresh_token:null==e?void 0:e.refreshToken},n=yield xi(lp.auth.exchangeOAuthTokensV2,t),a=yield xi(nh,n.user);yield xi(iv,M({},n,{user:a}),{isAuthenticated:!0})}catch(e){$o.setAccessToken(null),$o.setUser(null),yield Fi(xa.setState({user:null,isAuthenticated:!1}))}}function*lh(){const{user:e}=yield Bi((e=>e.auth));if(null==e||!e.refreshToken)return $o.setAccessToken(null),$o.setUser(null),void(yield Fi(xa.setState({user:null,isAuthenticated:!1})));try{const t={grant_type:"refresh_token",refresh_token:null==e?void 0:e.refreshToken},n=yield xi(lp.auth.exchangeOAuthTokensV2,t),a=yield xi(nh,n.user);yield xi(iv,M({},n,{user:a}),{isAuthenticated:!0})}catch(e){$o.setAccessToken(null),$o.setUser(null),yield Fi(xa.setState({user:null,isAuthenticated:!1}))}}function*ch(){try{const t=$o.onRedirectTo,{routes:n,loginState:a}=yield Bi((e=>e.auth)),{user:i,tenants:o=[],activeTenant:r}=yield xi(lp.auth.refreshTokenV3);if(Tg(i)){const e=yield Ig(i);yield Fi(xa.setState(e)),t(n.loginUrl,{preserveQueryParams:!0})}else{var e;i.id&&localStorage.setItem("userId",i.id);const t=null!=(e=localStorage.getItem("register-quick-login"))?e:a.quickLoginToRegister,n=yield oh(i),s=yield xi(nh,i);yield xi(iv,{user:s,tenants:o,activeTenant:r},{loginState:M({},a,{quickLoginToRegister:t,flow:n?Pt.RegisterQuickLogin:Pt.Login}),isAuthenticated:!0}),yield uh(n)}}catch(e){$o.setAccessToken(null),$o.setUser(null),yield Fi(xa.setState({user:void 0,isAuthenticated:!1}))}}function*dh(){try{const t=$o.onRedirectTo,{routes:n,loginState:a}=yield Bi((e=>e.auth)),{user:i,tenants:o=[],activeTenant:r}=yield xi(lp.auth.refreshTokenV3);if(Tg(i)){const e=yield Ig(i);yield Fi(xa.setState(e)),t(n.loginUrl,{preserveQueryParams:!0})}else{const s=yield xi(nh,i);if(yield xi(av))yield Fi(xa.setLoginState({step:Ot.promptPasskeys,loading:!1})),yield xi(iv,{user:s,tenants:o,activeTenant:r},{isLoading:!1}),t(n.loginUrl,{preserveQueryParams:!0});else{var e;i.id&&localStorage.setItem("userId",i.id);const t=null!=(e=localStorage.getItem("register-quick-login"))?e:a.quickLoginToRegister,n=yield oh(i);yield xi(iv,{user:s,tenants:o,activeTenant:r},{loginState:M({},a,{quickLoginToRegister:t,flow:n?Pt.RegisterQuickLogin:Pt.Login}),isAuthenticated:!0}),yield uh(n)}}}catch(e){$o.setAccessToken(null),$o.setUser(null),yield Fi(xa.setState({user:void 0,isAuthenticated:!1}))}}function*uh(e){var t;const n=new URL(null==(t=window)?void 0:t.location.href),a=$o.onRedirectTo,{routes:i,loginState:o}=yield Bi((e=>e.auth)),r=n.searchParams.get("invitationToken"),s=[i.socialLoginCallbackUrl,i.oidcRedirectUrl,i.samlCallbackUrl];r||s.push(i.loginUrl,i.signUpUrl),e?a(i.loginUrl):s.some((e=>e&&window.location.pathname.endsWith(e)))&&(o.isNewUser&&i.signUpSuccessUrl&&i.socialLoginCallbackUrl===window.location.pathname?a(i.signUpSuccessUrl,{refresh:i.signUpSuccessUrl.startsWith("http")}):yield yv())}function*yh({payload:{callback:e}}){try{const{ip:t}=yield xi(lp.metadata.getCurrentUserIpMetadata);yield Fi(xa.setState({userIp:t})),null==e||e(!0)}catch(t){null==e||e(!1)}}function*fh({payload:e}){const t=[],n=[];t.push(xi(rh)),e&&(yield Fi(xa.setState({isLoading:!0})),yield Fi(xa.loadSocialLoginsConfigurationV2()),t.push(xi(xS)),t.push(xi(yS)),t.push(xi(ih)),t.push(xi(YS)),t.push(xi(ah)),n.push(xi(Ng))),yield Gi(t),n.length>0&&(yield Gi(n)),yield Fi(xa.setState({isLoading:!1}))}function*ph({accessToken:e,user:t}){if(!e)return void(yield Fi(xa.setState({user:void 0,isAuthenticated:!1})));const n=$o.onRedirectTo,{routes:a}=yield Bi((e=>e.auth));if(Tg(t)){const e=yield Ig(t);yield Fi(xa.setState(e)),n(a.loginUrl,{preserveQueryParams:!0})}}function*gh({payload:e}){const t=[];yield Fi(xa.loadSocialLoginsConfigurationV2()),t.push(xi(xS)),t.push(xi(ih)),t.push(xi(YS)),t.push(xi(ah)),t.push(xi(ph,e)),t.push(xi(Ng)),yield Gi(t)}const Sh=e=>{var t;if("path"===e)return(null!=(t=window)?t:document).location.pathname;{var n;const e=((null!=(n=window)?n:document).location.hash||"#").substring(1);return-1!==e.indexOf("?")?e.substring(0,e.indexOf("?")):e}};function*vh(){const e=yield xi(lp.auth.silentOAuthRefreshTokenV2);if(null==e||!e.user)throw new Error("couldn't refresh user token with oauth service");yield xi(iv,e,{isAuthenticated:!0,isLoading:!1})}function*hh({payload:e}){var t;null==(t=localStorage)||t.removeItem(sv);const{disableSilentRefresh:n}=yield Bi((e=>({disableSilentRefresh:e.auth.disableSilentRefresh})));if("login"!==(null==e?void 0:e.prompt))try{if(n)throw new Error("silent refresh is disabled");yield vh()}catch(t){yield bh(e)}else yield bh(e)}function*mh({payload:{additionalParams:e,shouldRedirectToLogin:t,firstTime:n,loginDirectAction:a}}){var i,o;if(null==(i=localStorage)||i.removeItem(sv),n){const{urlStrategy:e}=yield Bi((e=>({urlStrategy:e.root.urlStrategy}))),t=Sh(e);if(yield Fi(xa.setState({isLoading:!0})),(e=>"/oauth/callback"===e)(t))return}const{disableSilentRefresh:r}=yield Bi((e=>({disableSilentRefresh:e.auth.disableSilentRefresh})));if(a&&((e=e||{}).login_direct_action=btoa(JSON.stringify(a))),"login"!==(null==(o=e)?void 0:o.prompt))try{if(r)throw new Error("silent refresh is disabled");yield vh()}catch(n){if(!t)return void(yield Fi(xa.setState({isLoading:!1})));yield bh(e)}else yield bh(e)}function*bh(e){const{routes:t,context:n,onRedirectTo:a,urlStrategy:i}=yield Bi((e=>({routes:e.auth.routes,onRedirectTo:e.auth.onRedirectTo,context:e.root.context,urlStrategy:e.root.urlStrategy})));if(Sh(i)===t.hostedLoginRedirectUrl)return void console.debug("Calling loginWithRedirect while in hostedLoginCallback route");yield Fi(xa.setState({isLoading:!0}));const o=Pp(),r=Pp(),s=yield xi(Op,r);localStorage.setItem(Dt,r);let l=`${window.location.origin}${"path"===i?"":"#"}${t.hostedLoginRedirectUrl}`;yield xi(Ng);const c=yield Bi((e=>{var t;return null==(t=e.auth.customLoginState)?void 0:t.customLoginSearchParams}));c&&(l.endsWith("/")&&(l=l.slice(0,-1)),l+=c);const d=`${Pr(n,"/oauth/authorize")}/oauth/authorize`,u=M({response_type:"code",client_id:n.clientId||"INVALID-CLIENT-ID",scope:"openid email profile",redirect_uri:l,code_challenge:s,code_challenge_method:"S256",nonce:o},e);if(null==e||!e.organization){const e=yield xi(Cg);e&&(u.organization=e)}const y=bg(Ag);y&&(u.tenantId=y),a(`${d}?${new URLSearchParams(u).toString()}`,{refresh:!0})}function*Ah({payload:e}){const t=localStorage.getItem(Dt)||"INVALID-CODE-VERIFIER",{routes:n,urlStrategy:a}=yield Bi((e=>({routes:e.auth.routes,urlStrategy:e.root.urlStrategy})));let i=`${window.location.origin}${"path"===a?"":"#"}${n.hostedLoginRedirectUrl}`;yield xi(Ng);const o=yield Bi((e=>{var t;return null==(t=e.auth.customLoginState)?void 0:t.customLoginSearchParams}));o&&(i.endsWith("/")&&(i=i.slice(0,-1)),i+=o);const r={code:e.code,redirect_uri:i,code_verifier:t,grant_type:"authorization_code"};try{const e=yield xi(lp.auth.exchangeOAuthTokensV2,r);yield xi(iv,e,{isAuthenticated:!0,isLoading:!1})}catch(e){yield Fi(xa.setState({isLoading:!1})),console.error("Failed to exchangeOAuthTokens",e)}finally{const e=yield Bi((({auth:e})=>e.user)),t=window.localStorage.getItem(sv);window.localStorage.removeItem(sv),t&&lv(e)?yield fv():yield yv()}}function*Th(e){let{payload:{callback:t}}=e,n=Za(e.payload,Vv);try{yield Fi(xa.setLoginState({loading:!0}));const e=yield xi(lp.auth.changePhoneNumberWithVerification,n);yield Fi(xa.setLoginState({phoneNumber:n.phoneNumber,loading:!1,changePhoneId:e.changePhoneId,step:Ot.loginWithQuickSmsOtc,error:void 0})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({error:Og(e),loading:!1}))}}function*Eh(e){let{payload:{callback:t}}=e,n=Za(e.payload,jv);try{yield Fi(xa.setLoginState({loading:!0})),yield xi(lp.auth.verifyChangePhoneNumber,n),yield Fi(xa.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({error:Og(e),loading:!1}))}}function*kh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Bv);try{yield Fi(xa.setLoginState({loading:!0}));const e=yield xi(lp.auth.passwordlessPreLogin,M({},n,{type:Ea.SmsCode}));yield Fi(xa.setLoginState({step:Ot.loginWithQuickSmsOtc,loading:!1,phoneNumber:null==e?void 0:e.phoneNumber,error:void 0})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({error:Og(e),loading:!1})),null==t||t(e)}}function*Ih(e){let{payload:{callback:t}}=e,n=Za(e.payload,Wv);try{let e;yield Fi(xa.setLoginState({loading:!0})),function(e){return"email"in e}(n)&&(e=n.email);const a=yield xi(lp.auth.passwordlessPreLogin,n),i=Ia[n.type];yield Fi(xa.setLoginState({step:i,loading:!1,phoneNumber:null==a?void 0:a.phoneNumber,email:e,error:void 0})),null==t||t()}catch(e){yield Fi(xa.setLoginState({error:Og(e),loading:!1})),null==t||t()}}function*Oh(e){let{payload:{callback:t,events:n}}=e,a=Za(e.payload,zv);try{yield Fi(xa.setLoginState({loading:!0}));const{user:e,tenants:o=[],activeTenant:r}=yield xi(lp.auth.passwordlessPostLoginV2,a),s=$o.onRedirectTo,{routes:l}=yield Bi((e=>e.auth));if(Tg(e)){const t=yield Ig(e);yield Fi(xa.setState(t)),s(l.loginUrl,{preserveQueryParams:!0})}else{const{loginState:a}=yield Bi((e=>e.auth));if(e.emailVerified){var i;const t={email:e.email,origin:gg.PASSWORDLESS,id:e.id,tenantId:e.tenantId,createdAt:new Date,name:e.name};null==n||null==(i=n.userVerified)||i.call(n,t),_g(Pg.USER_VERIFIED,t)}e.id&&localStorage.setItem("userId",e.id),yield xi(iv,{user:e,tenants:o,activeTenant:r}),yield Fi(xa.setLoginState({error:void 0})),yield Fi(xa.setState({isLoading:!1})),a.flow===Pt.Login?(yield xi(av))?(yield Fi(xa.setLoginState({step:Ot.promptPasskeys,loading:!1})),s(l.loginUrl,{preserveQueryParams:!0})):(yield Fi(xa.setState({isAuthenticated:!0})),yield yv()):s(l.loginUrl,{preserveQueryParams:!0}),localStorage.removeItem("register-quick-login"),null==t||t(!0)}}catch(e){yield Fi(xa.setLoginState({error:Og(e,"Failed to authenticate")}))}finally{yield Fi(xa.setLoginState({loading:!1}))}}function*Ph({payload:e}){try{yield Fi(xa.setLoginState({loading:!0}));const{name:t}=yield xi(lp.auth.verifyInviteToken,e);yield Fi(xa.setLoginState({inviteTokenTenantName:t}))}catch(e){yield Fi(xa.setLoginState({inviteTokenError:Og(e,"We couldn't verify your invitation")}))}finally{yield Fi(xa.setLoginState({loading:!1}))}}function*_h({payload:{email:e,recaptchaToken:t,invitationToken:n,callback:a}}){yield Fi(xa.setLoginState({loading:!0}));try{const i=yield Bi((({auth:{onRedirectTo:e}})=>e)),o=bg(Ag),{address:r,idpType:s}=yield xi(lp.auth.preLoginV2,{email:e,tenantId:o});if(r){let t=r;if(s===up.Oidc&&!t.includes("redirect_uri")){const{routes:{oidcRedirectUrl:e}}=yield Bi((({auth:{routes:e}})=>({routes:e})));t+=`&redirect_uri=${window.location.origin}${e}`}nv.isLoginWithSSOAvailable()?(nv.loginWithSSO(e),yield Fi(xa.setLoginState({loading:!1})),null==a||a()):(yield Fi(xa.setLoginState({step:Ot.redirectToSSO,loading:!1,ssoRedirectUrl:t})),setTimeout((()=>{i(t,{refresh:!0})}),2e3))}else yield Lh({email:e,recaptchaToken:t,callback:a,invitationToken:n})}catch(i){yield Lh({email:e,recaptchaToken:t,callback:a,invitationToken:n})}}function*Lh(e){let{callback:t}=e,n=Za(e,Kv);const a=yield Bi((({auth:{securityPolicyState:{publicPolicy:{policy:e}}}})=>e));if(null==a||!a.authStrategy)return yield Fi(xa.setLoginState({step:Ot.loginWithPassword,loading:!1})),void(null==t||t());(null==a?void 0:a.authStrategy)===Ea.EmailAndPassword?(yield Fi(xa.setLoginState({step:Ot.loginWithPassword,loading:!1})),null==t||t()):[Ea.MagicLink,Ea.Code,Ea.SmsCode].includes(null==a?void 0:a.authStrategy)?yield Fi(xa.passwordlessPreLogin(M({},n,{type:null==a?void 0:a.authStrategy,callback:t}))):(yield Fi(xa.setLoginState({step:Ot.loginWithPassword,loading:!1})),null==t||t())}function*wh({payload:{callback:e}}){try{yield Fi(xa.setLoginState({loading:!0}));const{options:t}=yield xi(lp.auth.webAuthnCreateNewDeviceSession);t.user.id=kt(t.user.id),t.challenge=kt(t.challenge),t.excludeCredentials=[],null==e||e(t)}catch(t){yield Fi(xa.setLoginState({error:Og(t)})),null==e||e(null)}finally{yield Fi(xa.setLoginState({loading:!1}))}}function*Dh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Hv);try{yield Fi(xa.setLoginState({loading:!0}));const e=It(n.publicKey),a="platform"===(null==e?void 0:e.authenticatorAttachment)?Vs.Platform:Vs.CrossPlatform;yield xi(lp.auth.verifyNewDeviceSession,{id:e.id,response:e.response,deviceType:a}),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({error:Og(e)})),null==t||t(null)}finally{yield Fi(xa.setLoginState({loading:!1}))}}function*Uh(e){let{payload:{callback:t}}=e,n=Za(e.payload,qv);try{var a;yield Fi(xa.setPasskeysState({loading:!0})),yield Fi(xa.setLoginState({loading:!0}));const{options:e}=yield xi(lp.auth.webAuthnPreLogin,n);e.challenge=kt(e.challenge),e.allowCredentials=null==(a=e.allowCredentials)?void 0:a.map((e=>M({},e,{id:kt(e.id)}))),yield Fi(xa.setLoginState({error:void 0})),null==t||t(e)}catch(e){yield Fi(xa.setLoginState({error:Og(e)})),null==t||t(null)}finally{yield Fi(xa.setPasskeysState({loading:!1})),yield Fi(xa.setLoginState({loading:!1}))}}function*Rh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Jv);try{var a;yield Fi(xa.setPasskeysState({loading:!0})),yield Fi(xa.setLoginState({loading:!0}));const e=It(n.publicKey),i=yield xi(lp.auth.webAuthnPostLoginV2,M({},e,{response:M({},e.response,{userHandle:null!=(a=e.response.userHandle)?a:void 0}),recaptchaToken:n.recaptchaToken,invitationToken:n.invitationToken})),{user:o}=i,r=Za(i,Yv);if(Tg(o)){const e=$o.onRedirectTo,{routes:t}=yield Bi((e=>e.auth)),n=yield Ig(o);yield Fi(xa.setState(n)),e(t.loginUrl,{preserveQueryParams:!0})}else o.id&&localStorage.setItem("userId",o.id),yield xi(iv,M({user:o},r),{isAuthenticated:!0}),yield Fi(xa.setLoginState({error:void 0})),yield yv(),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({error:Og(e)})),null==t||t(null)}finally{yield Fi(xa.setPasskeysState({loading:!1})),yield Fi(xa.setLoginState({loading:!1}))}}function*Ch({payload:e}){const{onRedirectTo:t,routes:n}=yield Bi((({auth:{onRedirectTo:e,routes:t}})=>({onRedirectTo:e,routes:t})));yield Fi(xa.setLoginState({loading:!0}));try{const t=yield xi(lp.auth.postLogin,e);yield Fi(xa.setState({user:t.accessToken?t:void 0,isAuthenticated:!!t.accessToken})),yield yv()}catch(e){setTimeout((()=>{t(n.authenticatedUrl)}),1e3),yield Fi(xa.setLoginState({step:Ot.loginWithSSOFailed,loading:!1}))}}function*Nh({payload:{email:e,password:t,recaptchaToken:n,invitationToken:a,callback:i}}){yield Fi(xa.setLoginState({loading:!0}));try{const{user:o,tenants:r=[],activeTenant:s}=yield xi(lp.auth.loginv2,{email:e,password:t,recaptchaToken:n,invitationToken:a}),l=$o.onRedirectTo,{routes:c}=yield Bi((e=>e.auth));if(Tg(o)){const e=yield Ig(o);yield Fi(xa.setState(e)),l(c.loginUrl,{preserveQueryParams:!0})}else{const{loginState:t}=yield Bi((e=>e.auth)),n=!!o.accessToken;o.id&&localStorage.setItem("userId",o.id),yield xi(iv,{user:o,tenants:r,activeTenant:s},{loginState:{flow:t.flow,quickLoginToRegister:t.quickLoginToRegister,email:e,loading:!1,error:void 0,mfaToken:o.mfaToken,step:t.flow===Pt.Login?Ot.success:t.step,tenants:r,tenantsLoading:!0,isBreachedPassword:o.isBreachedPassword},isAuthenticated:n});const[a]=yield xi(Lp,["security-center-show-login-flows"]);t.flow===Pt.Login&&(a&&o.isBreachedPassword&&!n?yield Fi(xa.setLoginState({step:Ot.breachedPassword,loading:!1})):n&&((yield xi(av))?(yield Fi(xa.setLoginState({step:Ot.promptPasskeys,loading:!1})),l(c.loginUrl,{preserveQueryParams:!0})):yield yv()))}localStorage.removeItem("register-quick-login"),null==i||i(!0)}catch(t){$o.setAccessToken(null),$o.setUser(null),null==i||i(!1,t),yield Fi(xa.setLoginState({email:e,error:Og(t),loading:!1}))}}function*Mh({payload:e}){yield Fi(xa.setLoginState({loading:!0}));try{var t;yield xi(lp.auth.recoverMfaToken,e),yield Fi(xa.setLoginState({loading:!1,error:void 0,step:Ot.preLogin})),yield Fi(xa.setState({user:void 0,isAuthenticated:!1})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setLoginState({error:Og(t),loading:!1})),null==(n=e.callback)||n.call(e,!1,t)}}function*Fh({payload:e}){const{hostedLoginBox:t}=yield Bi((e=>e.auth));yield Fi(xa.setState({isLoading:!0}));try{t?yield xi(lp.auth.OAuthLogout):yield xi(lp.auth.logout)}catch{}$o.isSessionPerTenantEnabled()&&Zr(),yield Fi(xa.resetState()),yield Fi(xa.requestAuthorize(!0)),null==e||e()}function*Gh({payload:e}){var t;try{yield xi(lp.auth.logout)}catch{}$o.isSessionPerTenantEnabled()&&Zr(),setTimeout((()=>{var t;return null==e||null==(t=e.callback)?void 0:t.call(e,!0)}),null!=(t=null==e?void 0:e.callbackTimeout)?t:500)}function*$h({user:e,tenants:t,activeTenant:n}){const a={step:ln.recoveryCode,loading:!1,error:void 0,saving:!1};null!=e&&e.recoveryCode&&(a.recoveryCode=e.recoveryCode),yield Fi(xa.setMfaState(a)),yield Fi(xa.setUser(e)),yield Fi(xa.setTenantsState({tenants:t,activeTenant:n,loading:!1})),e.id&&localStorage.setItem("userId",e.id)}function*xh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Xv);yield Fi(xa.setLoginState({loading:!0}));try{const e=yield xi(lp.auth.preEnrollMFASMSForLogin,n);yield Fi(xa.setMfaState({otcToken:e.otcToken,step:ln.smsVerifyCode,phoneNumber:e.phoneNumber})),yield Fi(xa.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)})),null==t||t(null)}}function*Vh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Qv);yield Fi(xa.setLoginState({loading:!0}));try{const e=yield xi(lp.auth.enrollMFASMSForLoginV2,n);yield $h(e),yield Fi(xa.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)})),null==t||t(null)}}function*jh(e){let{payload:{callback:t}}=e,n=Za(e.payload,Zv);yield Fi(xa.setLoginState({loading:!0}));try{var a;const e=yield xi(lp.auth.preEnrollMFAWebAuthnForLogin,n),i=M({},e.options,{challenge:kt(e.options.challenge),user:M({},e.options.user,{id:kt(e.options.user.id)}),excludeCredentials:null==(a=e.options.excludeCredentials)?void 0:a.map((e=>M({},e,{id:kt(e.id)})))});yield Fi(xa.setLoginState({loading:!1})),null==t||t({options:i,webauthnToken:e.webauthnToken})}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)})),null==t||t(null)}}function*Bh(e){let{payload:{callback:t}}=e,n=Za(e.payload,eh);yield Fi(xa.setLoginState({loading:!0}));try{const e=It(n.publicKey),a=yield xi(lp.auth.enrollMFAWebAuthnForLoginV2,M({},n,{options:e}));yield $h(a),yield Fi(xa.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)})),null==t||t(null)}}function*Wh(e){let{payload:{callback:t}}=e,n=Za(e.payload,th);yield Fi(xa.setLoginState({loading:!0}));try{const e=yield xi(lp.auth.enrollMFAAuthenticatorAppForLoginV2,n);yield $h(e),yield Fi(xa.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)})),null==t||t(null)}}function*zh({payload:e}){yield Fi(xa.setLoginState({loading:!0}));try{yield xi(lp.auth.forgotPassword,e),yield Fi(xa.setLoginState({loading:!1,error:void 0,step:Ot.breachedPasswordSuccess})),yield Fi(xa.setState({isAuthenticated:!1}))}catch(e){yield Fi(xa.setLoginState({loading:!1,error:Og(e)}))}}function*Kh(){yield Go(xa.requestAuthorize,fh),yield Go(xa.requestAuthorizeSSR,gh),yield Go(xa.requestHostedLoginAuthorize,hh),yield Go(xa.requestHostedLoginAuthorizeV2,mh),yield Go(xa.handleHostedLoginCallback,Ah),yield Go(xa.preLogin,_h),yield Go(xa.postLogin,Ch),yield Go(xa.login,Nh),yield Go(xa.logout,Fh),yield Go(xa.silentLogout,Gh),yield Go(xa.loginWithMfa,mv),yield Go(xa.recoverMfa,Mh),yield Go(xa.quickSmsPasswordlessPreLogin,kh),yield Go(xa.changePhoneNumberWithVerification,Th),yield Go(xa.verifyChangePhoneNumber,Eh),yield Go(xa.passwordlessPreLogin,Ih),yield Go(xa.passwordlessPostLogin,Oh),yield Go(xa.verifyInviteToken,Ph),yield Go(xa.webAuthnPrelogin,Uh),yield Go(xa.webAuthnPostLogin,Rh),yield Go(xa.webAuthnCreateNewDeviceSession,wh),yield Go(xa.webAuthnVerifyNewDeviceSession,Dh),yield Go(xa.afterAuthNavigation,yv),yield Go(xa.getUserIP,yh),yield Go(xa.preEnrollMFASMSForLogin,xh),yield Go(xa.enrollMFASMSForLogin,Vh),yield Go(xa.preEnrollMFAWebAuthnForLogin,jh),yield Go(xa.enrollMFAWebAuthnForLogin,Bh),yield Go(xa.enrollMFAAuthenticatorAppForLogin,Wh),yield Go(xa.preVerifyMFASMSForLogin,Pv),yield Go(xa.verifyMFASMSForLogin,_v),yield Go(xa.preVerifyMFAWebAuthnForLogin,Rv),yield Go(xa.verifyMFAWebAuthnForLogin,Cv),yield Go(xa.preVerifyMFAEmailCode,$v),yield Go(xa.verifyMFAEmailCode,xv),yield Go(xa.resetBreachedPassword,zh)}function*Hh({payload:e}){e&&(yield Fi(xa.setState({isLoading:!0})));const t=Cp;yield Fi(xa.loadTenants()),yield Fi(xa.setState({user:t,isAuthenticated:!0,isLoading:!1}))}function*qh({payload:{callback:e}}){try{const{ip:t}=ig[0];yield Fi(xa.setState({userIp:t})),null==e||e(!0,t)}catch(t){null==e||e(!1,t)}}function*Jh(){yield Go(xa.requestAuthorize,Hh),yield Go(xa.afterAuthNavigation,yv),yield Go(xa.getUserIP,qh)}const Yh=["callback","samlVendor"],Xh=["callback","samlVendor"];function*Qh(){try{var e,t;yield Fi(xa.setSSOState({loading:!0}));const n=yield xi(lp.auth.getSamlConfiguration),a=yield xi(lp.auth.getOidcConfiguration),i=yield xi(lp.metadata.getSamlMetadata);n.acsUrl=null==i||null==(e=i.configuration)?void 0:e.acsUrl,n.spEntityId=null==i||null==(t=i.configuration)?void 0:t.spEntityId,n.isSamlActive=null==i?void 0:i.isActive,yield Fi(xa.setSSOState({samlConfiguration:n,oidcConfiguration:a,loading:!1,firstLoad:!1}))}catch(e){yield Fi(xa.setSSOState({error:Og(e),loading:!1}))}}function*Zh({payload:e}){const t=yield Bi((e=>e.auth.ssoState.samlConfiguration)),n="saving";yield Fi(xa.setSSOState({error:void 0,[n]:!0}));try{const a=yield _p(e[0]),i=yield xi(lp.auth.updateSamlVendorMetadata,{metadata:a});i.isSamlActive=null==t?void 0:t.isSamlActive,yield Fi(xa.setSSOState({samlConfiguration:i,error:void 0,[n]:!1}))}catch(e){yield Fi(xa.setSSOState({samlConfiguration:t,error:Og(e),[n]:!1}))}}function*em({payload:e}){const{configFile:t,callback:n}=e,a=yield Bi((e=>e.auth.ssoState.samlConfiguration)),i="saving";yield Fi(xa.setSSOState({error:void 0,[i]:!0}));try{const e=yield _p(t),o=yield xi(lp.auth.updateSamlVendorMetadata,{metadata:e});o.isSamlActive=null==a?void 0:a.isSamlActive,yield Fi(xa.setSSOState({samlConfiguration:o,error:void 0,[i]:!1})),null==n||n(!0)}catch(e){yield Fi(xa.setSSOState({samlConfiguration:a,error:Og(e),[i]:!1})),null==n||n(null,e)}}function*tm({payload:e}){const{callback:t,samlVendor:n}=e,a=Za(e,Yh),i=yield Bi((e=>e.auth.ssoState.samlConfiguration)),o=M({},i,a);let r="saving";(null==o?void 0:o.enabled)!==i.enabled&&(r="loading");try{if(null==o||!o.domain)return void(yield Fi(xa.setSSOState({samlConfiguration:M({},i,o)})));if(yield Fi(xa.setSSOState({error:void 0,[r]:!0})),e.type===up.Saml){var s,l;const e=yield xi(lp.metadata.getSamlMetadata);o.acsUrl=null==e||null==(s=e.configuration)?void 0:s.acsUrl,o.spEntityId=null==e||null==(l=e.configuration)?void 0:l.spEntityId}const a=Ip(o,["validated","generatedVerification","createdAt","updatedAt"]);(null==i?void 0:i.domain)!==(null==a?void 0:a.domain)&&(a.ssoEndpoint="",a.publicCertificate="",a.signRequest=!1),a.type=null==n?void 0:n.toLowerCase();const c=yield xi(lp.auth.updateSamlConfiguration,a);c.isSamlActive=null==i?void 0:i.isSamlActive,yield Fi(xa.setSSOState({samlConfiguration:c,error:void 0,[r]:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setSSOState({samlConfiguration:i,error:Og(e),[r]:!1})),null==t||t(null,e)}}function*nm({payload:{callback:e}={}}){const t=yield Bi((e=>e.auth.ssoState.samlConfiguration));try{yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield xi(lp.auth.validateSamlDomain),yield Fi(xa.setSSOState({samlConfiguration:M({},t,{validated:!0}),error:void 0,saving:!1})),null==e||e(!0)}catch(n){yield Fi(xa.setSSOState({samlConfiguration:M({},t,{validated:!1}),error:Og(n),saving:!1})),null==e||e(null,n)}}function*am(){try{const e=yield xi(lp.auth.getSamlRoles),t=yield xi(lp.auth.getSamlRolesGroups);yield Fi(xa.setSSOState({authorizationRoles:e.roleIds,rolesGroups:t,error:void 0}))}catch(e){yield Fi(xa.setSSOState({error:Og(e)}))}}function*im({payload:{callback:e,authorizationRoles:t,groups:n}}){try{yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield xi(lp.auth.updateSamlRoles,{roleIds:t}),n&&(yield function*(e){try{yield Gi(e.map((e=>xi(lp.auth.updateSamlGroup,{id:e.id,roleIds:e.roleIds,group:e.group}))))}catch(e){yield Fi(xa.setSSOState({error:Og(e)}))}}(n)),yield am(),yield Fi(xa.setSSOState({error:void 0,saving:!1})),null==e||e(!0)}catch(t){yield Fi(xa.setSSOState({error:Og(t),saving:!1})),null==e||e(null,t)}}function*om({payload:{callback:e,id:t}}){try{yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield xi(lp.auth.deleteSamlGroup,{id:t}),yield am(),yield Fi(xa.setSSOState({error:void 0,saving:!1})),null==e||e(!0)}catch(t){yield Fi(xa.setSSOState({error:Og(t),saving:!1})),null==e||e(null,t)}}function*rm({payload:{group:e,roleIds:t,callback:n}}){try{yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield xi(lp.auth.createSamlGroup,{group:e,roleIds:t}),yield am(),yield Fi(xa.setSSOState({error:void 0,saving:!1})),null==n||n(!0)}catch(e){yield Fi(xa.setSSOState({error:Og(e),saving:!1})),null==n||n(null,e)}}function*sm({payload:e}){const t={code:e.code,redirectUri:e.redirectUri,RelayState:e.state};try{yield Fi(xa.setSSOState({loading:!0})),yield xi(lp.auth.oidcPostLoginV2,t),yield xi(rh),yield Fi(xa.setSSOState({loading:!1}))}catch(e){yield Fi(xa.setSSOState({loading:!1,error:Og(e,"Failed to authenticate"),firstLoad:!1}))}}function*lm(){yield Mo(xa.loadSSOConfigurations,Qh),yield Mo(xa.saveSSOConfigurations,tm),yield Mo(xa.saveSSOConfigurationsFile,Zh),yield Mo(xa.saveSSOConfigurationsFileWithCallback,em),yield Mo(xa.validateSSODomain,nm),yield Mo(xa.loadSSOAuthorizationRoles,am),yield Mo(xa.updateSSOAuthorizationRoles,im),yield Mo(xa.deleteSamlGroup,om),yield Mo(xa.createSamlGroup,rm),yield Mo(xa.oidcPostlogin,sm)}function*cm(){yield Fi(xa.setSSOState({loading:!0})),yield At(),yield Fi(xa.setSSOState({samlConfiguration:Vp,loading:!1,firstLoad:!1}))}function*dm({payload:e}){const t="saving";yield Fi(xa.setSSOState({error:void 0,[t]:!0}));const n=M({},yield Bi((e=>e.auth.ssoState.samlConfiguration)),{enabled:!0},e[0]);yield Fi(xa.setSSOState({samlConfiguration:n,error:void 0,[t]:!1}))}function*um({payload:e}){var t,n;const{callback:a,samlVendor:i}=e,o=Za(e,Xh),r=Wp.samlConfiguration,s=M({},r,o);let l="saving";if((null==s?void 0:s.enabled)!==r.enabled&&(l="loading"),null==s||!s.domain)return void(yield Fi(xa.setSSOState({samlConfiguration:M({},r,s)})));yield Fi(xa.setSSOState({error:void 0,[l]:!0})),yield At(),s.acsUrl=null==jp||null==(t=jp.configuration)?void 0:t.acsUrl,s.spEntityId=null==jp||null==(n=jp.configuration)?void 0:n.spEntityId;const c=Ip(s,["validated","generatedVerification","createdAt","updatedAt"]);(null==r?void 0:r.domain)!==(null==c?void 0:c.domain)&&(c.ssoEndpoint="",c.publicCertificate="",c.signRequest=!1),c.type=null==i?void 0:i.toLowerCase(),yield At(),yield Fi(xa.setSSOState({samlConfiguration:c,error:void 0,[l]:!1})),null==a||a(!0)}function*ym({payload:{callback:e}={}}){const t=Wp.samlConfiguration;yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield At(),yield Fi(xa.setSSOState({samlConfiguration:M({},t,{validated:!0}),error:void 0,saving:!1})),null==e||e(!0)}function*fm(){yield At(),yield Fi(xa.setSSOState({authorizationRoles:["1","2","3"],error:void 0}))}function*pm({payload:{callback:e,authorizationRoles:t}}){yield Fi(xa.setSSOState({error:void 0,saving:!0})),yield At(),yield Fi(xa.setSSOState({authorizationRoles:t,error:void 0,saving:!1})),null==e||e(!0)}function*gm(){yield Mo(xa.loadSSOConfigurations,cm),yield Mo(xa.saveSSOConfigurations,um),yield Mo(xa.saveSSOConfigurationsFile,dm),yield Mo(xa.validateSSODomain,ym),yield Mo(xa.loadSSOAuthorizationRoles,fm),yield Mo(xa.updateSSOAuthorizationRoles,pm)}const Sm=["callback"],vm=["callback","ssoConfigId"],hm=["callback","ssoConfigId"],mm=["callback","ssoConfigId"];function*bm(){try{return yield xi(lp.auth.getOidcConfiguration)}catch(e){return null}}function*Am(){try{return yield xi(lp.metadata.getSamlMetadata)}catch(e){return null}}function*Tm(){try{yield Fi(xa.setSSOLoader({key:dp.LOAD_SSO_CONFIGURATIONS,value:!0}));const[e,t]=yield Gi([xi(bm),xi(Am)]),n=yield xi(lp.auth.getSSOConfigurations);yield Fi(xa.setSSOState({ssoConfigurations:n,oidcConfiguration:e,samlMetadata:t}))}catch(e){yield Fi(xa.setSSOError({key:dp.LOAD_SSO_CONFIGURATIONS,value:Og(e)}))}finally{yield Fi(xa.setSSOLoader({key:dp.LOAD_SSO_CONFIGURATIONS,value:!1}))}}function*Em({payload:e}){yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION,value:!0}));const{callback:t}=e,n=Za(e,Sm),a=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{var i;const e=yield xi(lp.auth.createSSOConfiguration,M({},n,{enabled:null!=(i=n.enabled)&&i}));yield Fi(xa.setSSOState({ssoConfigurations:[...a,e]})),null==t||t(e)}catch(e){yield Fi(xa.setSSOError({key:dp.SAVE_SSO_CONFIGURATION,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION,value:!1}))}}function*km({payload:e}){yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{configFile:t,callback:n}=e,a=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield _p(t),i=yield xi(lp.auth.createSSOConfigurationByMetadata,{metadata:e});yield Fi(xa.setSSOState({ssoConfigurations:[...a,i]})),null==n||n(i)}catch(e){yield Fi(xa.setSSOError({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:Og(e)})),null==n||n(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*Im({payload:e}){yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_CONFIGURATION,value:!0}));const{callback:t,ssoConfigId:n}=e,a=Za(e,vm),i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield xi(lp.auth.updateSSOConfiguration,n,a),o=i.map((t=>t.id===n?e:t));yield Fi(xa.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){yield Fi(xa.setSSOError({key:dp.UPDATE_SSO_CONFIGURATION,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_CONFIGURATION,value:!1}))}}function*Om({payload:e}){yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{callback:t,ssoConfigId:n,configFile:a}=e,i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield _p(a),o=yield xi(lp.auth.updateSSOConfigurationByMetadata,n,{metadata:e}),r=i.map((e=>e.id===n?o:e));yield Fi(xa.setSSOState({ssoConfigurations:r})),null==t||t(o)}catch(e){yield Fi(xa.setSSOError({key:dp.UPDATE_SSO_CONFIGURATION,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_CONFIGURATION,value:!1}))}}function*Pm({payload:e}){yield Fi(xa.setSSOLoader({key:dp.DELETE_SSO_CONFIGURATION,value:!0}));const{ssoConfigId:t,callback:n}=e,a=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{yield xi(lp.auth.deleteSSOConfiguration,t),yield Fi(xa.setSSOState({ssoConfigurations:a.filter((({id:e})=>e!==t))})),null==n||n(!0)}catch(e){yield Fi(xa.setSSOError({key:dp.DELETE_SSO_CONFIGURATION,value:Og(e)})),null==n||n(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.DELETE_SSO_CONFIGURATION,value:!1}))}}function*_m({payload:e}){const{callback:t,ssoConfigId:n}=e,a=Za(e,hm);yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_DOMAIN,value:!0}));const i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield xi(lp.auth.createSSODomain,n,a),o=i.map((t=>t.id===n?M({},t,{domains:[...t.domains,e]}):t));yield Fi(xa.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){yield Fi(xa.setSSOError({key:dp.SAVE_SSO_DOMAIN,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_DOMAIN,value:!1}))}}function*Lm({payload:e}){const{ssoConfigId:t,domainId:n,callback:a}=e;yield Fi(xa.setSSOLoader({key:dp.DELETE_SSO_DOMAIN,value:!0}));const i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{yield xi(lp.auth.deleteSSODomain,t,n);const e=i.map((e=>e.id===t?M({},e,{domains:e.domains.filter((({id:e})=>e!==n))}):e));yield Fi(xa.setSSOState({ssoConfigurations:e})),null==a||a(!0)}catch(e){yield Fi(xa.setSSOError({key:dp.DELETE_SSO_DOMAIN,value:Og(e)})),null==a||a(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.DELETE_SSO_DOMAIN,value:!1}))}}function*wm({payload:e}){const{callback:t,domainId:n,ssoConfigId:a}=e;yield Fi(xa.setSSOLoader({key:dp.VALIDATE_SSO_DOMAIN,value:!0}));const i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{yield xi(lp.auth.validateSSODomain,a,n);const e=i.map((e=>e.id===a?M({},e,{domains:e.domains.map((e=>e.id===n?M({},e,{validated:!0}):e))}):e));yield Fi(xa.setSSOState({ssoConfigurations:e})),null==t||t(!0)}catch(e){yield Fi(xa.setSSOError({key:dp.VALIDATE_SSO_DOMAIN,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.VALIDATE_SSO_DOMAIN,value:!1}))}}function*Dm({payload:{callback:e,ssoConfigId:t,roleIds:n}}){yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_DEFAULT_ROLES,value:!0}));const a=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{yield xi(lp.auth.setSSODefaultRoles,t,{roleIds:n});const i=a.map((e=>e.id===t?M({},e,{roleIds:n}):e));yield Fi(xa.setSSOState({ssoConfigurations:i})),null==e||e(!0)}catch(t){yield Fi(xa.setSSOError({key:dp.UPDATE_SSO_DEFAULT_ROLES,value:Og(t)})),null==e||e(null,t)}finally{yield Fi(xa.setSSOLoader({key:dp.UPDATE_SSO_DEFAULT_ROLES,value:!1}))}}function*Um({payload:{groupsToAdd:e,groupsToDelete:t,ssoConfigId:n,callback:a}}){yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_GROUPS,value:!0}));const i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{yield Gi(t.map((e=>xi(lp.auth.deleteSSOGroup,n,e)))),yield Gi(e.map((e=>xi(lp.auth.createSSOGroup,n,e))));const o=yield xi(lp.auth.getSSOGroups,n),r=i.map((e=>e.id===n?M({},e,{groups:o}):e));yield Fi(xa.setSSOState({ssoConfigurations:r})),null==a||a(!0)}catch(e){yield Fi(xa.setSSOError({key:dp.SAVE_SSO_GROUPS,value:Og(e)})),null==a||a(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_GROUPS,value:!1}))}}function*Rm({payload:{ssoConfigId:e,changedGroups:t,callback:n}}){try{yield Gi(t.map((t=>xi(lp.auth.updateSSOGroup,e,t)))),null==n||n(!0)}catch(e){yield Fi(xa.setSSOError({key:dp.SAVE_SSO_GROUPS,value:Og(e)})),null==n||n(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_GROUPS,value:!1}))}}function*Cm({payload:e}){yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{metadataUrl:t,configMetadata:n,ssoConfigId:a,callback:i}=e,o=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{const e={url:t,configMetadata:n};let r,s;a?(r=yield xi(lp.auth.updateSSOConfigurationByMetadataUrl,a,e),s=o.map((e=>e.id===a?r:e))):(r=yield xi(lp.auth.createSSOConfigurationByMetadataUrl,e),s=[r,...o]),yield Fi(xa.setSSOState({ssoConfigurations:s})),null==i||i(r)}catch(e){null==i||i(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*Nm({payload:e}){yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION,value:!0}));const{callback:t,ssoConfigId:n}=e,a=Za(e,mm),i=yield Bi((e=>e.auth.ssoState.ssoConfigurations));try{let e,o;n?(e=yield xi(lp.auth.updateSSOConfiguration,n,a),o=i.map((t=>t.id===n?e:t))):(e=yield xi(lp.auth.createSSOConfiguration,a),o=[e,...i]),yield Fi(xa.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){null==t||t(null,e)}finally{yield Fi(xa.setSSOLoader({key:dp.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*Mm(){yield Mo(xa.loadSSOConfigurationsV2,Tm),yield Mo(xa.saveSSOConfigurationV2,Em),yield Mo(xa.saveSSODomain,_m),yield Mo(xa.deleteSSODomain,Lm),yield Mo(xa.validateSSODomainV2,wm),yield Mo(xa.updateSSOConfiguration,Im),yield Mo(xa.deleteSSOConfiguration,Pm),yield Mo(xa.setSSOGroups,Um),yield Mo(xa.updateSSOGroups,Rm),yield Mo(xa.setSSODefaultRoles,Dm),yield Mo(xa.saveSSOConfigurationByMetadata,km),yield Mo(xa.updateSSOConfigurationByMetadata,Om),yield Mo(xa.saveSSOConfigurationByUrl,Cm),yield Mo(xa.saveSSOConfigurationByData,Nm)}const Fm=["callback","profilePictureUrl"],Gm=["callback","profilePictureUrl"];function*$m(){yield Fi(xa.setProfileState({loading:!0}));try{const e=yield function(e,t,n){for(var a=arguments.length,i=new Array(a>3?a-3:0),o=3;o<a;o++)i[o-3]=arguments[o];return xi.apply(void 0,[No,e,t,n].concat(i))}(3,2e3,lp.teams.getProfile),t=yield Bi((e=>e.auth.user));xa.setUser(M({},t,e)),yield Fi(xa.setProfileState({profile:e,loading:!1}))}catch(e){yield Fi(xa.setProfileState({loading:!1,error:Og(e)}))}}function*xm(e){let{payload:{callback:t,profilePictureUrl:n}}=e,a=Za(e.payload,Fm);yield Fi(xa.setProfileState({saving:!0,error:null,loading:!0}));try{const e=yield Bi((e=>e.auth.profileState.profile));let i=e.profilePictureUrl;if(n!==e.profilePictureUrl&&n&&(n||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)){const e=function(e,t="file"){const n=e.match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);if(null==n)return null;const a=`image/${n[1]}`,i=function(e,t){const n=atob(e),a=[];for(let e=0;e<n.length;e+=512){const t=n.slice(e,e+512),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);a.push(new Uint8Array(i))}return new Blob(a,{type:t})}(n[2],a),o=new FormData;return o.append(t,new File([i],t,{type:a})),o}(n,"image");if(e){i=yield xi(lp.teams.updateProfileImage,e);const t=Date.now().toString(),n=new URL(i);n.searchParams.set("t",t),i=n.href}}const o=M({},e,a,{profilePictureUrl:i}),r=yield xi(lp.users.updateUserProfileV2,o),s=yield Bi((e=>e.auth.user));yield Fi(xa.setUser(M({},s,r))),yield Fi(xa.setProfileState({profile:r,saving:!1,loading:!1})),null==t||t(o)}catch(e){yield Fi(xa.setProfileState({saving:!1,error:Og(e),loading:!1})),null==t||t(null,e)}}function*Vm({payload:e}){yield Fi(xa.setProfileState({loading:!0}));try{var t;yield xi(lp.teams.changePassword,e),yield Fi(xa.setProfileState({loading:!1,error:void 0})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setProfileState({loading:!1,error:Og(t)})),null==(n=e.callback)||n.call(e,null,t)}}function*jm(){yield Go(xa.loadProfile,$m),yield Mo(xa.saveProfile,xm),yield Mo(xa.changePassword,Vm)}function*Bm(){yield Fi(xa.setProfileState({loading:!0})),yield At(),yield Fi(xa.setUser(M({},Cp,Rp))),yield Fi(xa.setProfileState({loading:!1,profile:Rp}))}function*Wm(e){let{payload:{callback:t,profilePictureUrl:n}}=e,a=Za(e.payload,Gm);yield Fi(xa.setProfileState({saving:!0,error:null}));const i=Np;let o=i.profile.profilePictureUrl;n!==i.profile.profilePictureUrl&&n&&(n||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)&&(o=n);const r=M({},i.profile,a,{profilePictureUrl:o}),s=Cp;yield At(),yield Fi(xa.setUser(M({},s,r))),yield Fi(xa.setProfileState({loading:!1,error:null,saving:!1,profile:r})),null==t||t(r)}function*zm({payload:e}){var t;yield Fi(xa.setProfileState({loading:!0})),yield At(),yield Fi(xa.setProfileState({loading:!1,error:void 0})),null==(t=e.callback)||t.call(e,!0)}function*Km(){yield Go(xa.loadProfile,Bm),yield Mo(xa.saveProfile,Wm),yield Mo(xa.changePassword,zm)}const Hm=["callback"],qm=["callback"],Jm=["user"],Ym=["callback"],Xm=["deviceId","callback"],Qm=["deviceId","callback"],Zm=["callback"],eb=["deviceId"],tb=["deviceId"],nb=["callback"],ab=["deviceId"],ib=["callback"];function*ob(e){const{step:t}=yield Bi((e=>e.auth.mfaState));return{step:e.recoveryCode?ln.recoveryCode:t,loading:!1,saving:!1,error:void 0,recoveryCode:null==e?void 0:e.recoveryCode}}function*rb(){yield Fi(xa.setMfaState({saving:!0}));try{const{qrCode:e}=yield xi(lp.auth.enrollMfa);yield Fi(xa.setMfaState({saving:!1,error:void 0,qrCode:e}))}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)}))}}function*sb(e){let{payload:{callback:t}}=e,n=Za(e.payload,Hm);yield Fi(xa.setMfaState({saving:!0}));try{const e=yield Bi((e=>e.auth.user)),a=yield xi(lp.auth.verifyMfa,n),i=yield xi(lp.auth.getMFADevices),o=yield ob(a);yield Fi(xa.setMfaState(M({},o,{mfaDevices:i}))),yield Fi(xa.setUser(M({},e,{mfaEnrolled:!0}))),null==t||t(o.recoveryCode)}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*lb(e){let{payload:{callback:t}}=e,n=Za(e.payload,qm);yield Fi(xa.setMfaState({loading:!0}));try{const e=yield xi(lp.auth.loginWithMfaV2,n),{user:a}=e,i=Za(e,Jm),o={step:ln.recoveryCode,loading:!1,saving:!1,error:void 0};null!=a&&a.recoveryCode&&(o.recoveryCode=a.recoveryCode),yield Fi(xa.setMfaState(o)),yield iv(M({user:a},i)),null==t||t(o.recoveryCode)}catch(e){yield Fi(xa.setMfaState({loading:!1,error:Og(e)})),null==t||t(null,e)}}function*cb({payload:e}){yield Fi(xa.setMfaState({saving:!0}));try{var t;yield xi(lp.auth.disableMfa,e);const n=yield xi(lp.auth.getMFADevices);yield Fi(xa.setMfaState({saving:!1,error:void 0,mfaDevices:n})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setMfaState({saving:!1,error:Og(t)})),null==(n=e.callback)||n.call(e,!1,t)}}function*db({payload:e}){yield Fi(xa.setMfaState({saving:!0}));try{var t,n;const a=yield xi(lp.auth.preEnrollMFAWebAuthn),i=M({},a.options,{challenge:kt(a.options.challenge),user:M({},a.options.user,{id:kt(a.options.user.id)}),excludeCredentials:null==(t=a.options.excludeCredentials)?void 0:t.map((e=>M({},e,{id:kt(e.id)})))});yield Fi(xa.setMfaState({saving:!1})),null==(n=e.callback)||n.call(e,{options:i,webauthnToken:a.webauthnToken})}catch(t){var a;yield Fi(xa.setMfaState({saving:!1,error:Og(t)})),null==(a=e.callback)||a.call(e,null,t)}}function*ub(e){let{payload:{callback:t}}=e,n=Za(e.payload,Ym);yield Fi(xa.setMfaState({saving:!0}));try{const e=It(n.publicKey),a=yield xi(lp.auth.enrollMFAWebAuthn,M({},n,{options:e})),i=yield xi(lp.auth.getMFADevices),o=yield ob(a);yield Fi(xa.setMfaState(M({},o,{mfaDevices:i}))),null==t||t(o.recoveryCode)}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*yb(e){let{payload:{deviceId:t,callback:n}}=e;Za(e.payload,Xm),yield Fi(xa.setMfaState({saving:!0}));try{var a;const e=yield xi(lp.auth.preDisableMFAWebAuthn,t),i=M({},e.options,{challenge:kt(e.options.challenge),allowCredentials:null==(a=e.options.allowCredentials)?void 0:a.map((e=>M({},e,{id:kt(e.id)})))});yield Fi(xa.setMfaState({saving:!1})),null==n||n({options:i,webauthnToken:e.webauthnToken})}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==n||n(null,e)}}function*fb(e){let{payload:{deviceId:t,callback:n}}=e,a=Za(e.payload,Qm);yield Fi(xa.setMfaState({saving:!0}));try{const e=It(a.publicKey);yield xi(lp.auth.disableMFAWebAuthn,t,M({},a,{options:e}));const i=yield xi(lp.auth.getMFADevices);yield Fi(xa.setMfaState({saving:!1,error:void 0,mfaDevices:i})),null==n||n(!0)}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==n||n(!1,e)}}function*pb({payload:e}){yield Fi(xa.setMfaState({saving:!0}));try{var t;const n=yield xi(lp.auth.preEnrollMFASMS,e);yield Fi(xa.setMfaState({saving:!1,error:void 0,otcToken:n.otcToken,phoneNumber:n.phoneNumber})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setMfaState({saving:!1,error:Og(t)})),null==(n=e.callback)||n.call(e,!1,t)}}function*gb(e){let{payload:{callback:t}}=e,n=Za(e.payload,Zm);yield Fi(xa.setMfaState({saving:!0}));try{const e=yield xi(lp.auth.enrollMFASMS,n),a=yield xi(lp.auth.getMFADevices),i=yield ob(e);yield Fi(xa.setMfaState(M({},i,{mfaDevices:a}))),null==t||t(i.recoveryCode)}catch(e){yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*Sb(e){let{payload:{deviceId:t}}=e,n=Za(e.payload,eb);yield Fi(xa.setMfaState({saving:!0}));try{var a;const e=yield xi(lp.auth.preDisableMFASMS,t);yield Fi(xa.setMfaState({saving:!1,error:void 0,otcToken:e.otcToken,phoneNumber:e.phoneNumber})),null==(a=n.callback)||a.call(n,!0)}catch(e){var i;yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==(i=n.callback)||i.call(n,!1,e)}}function*vb(e){let{payload:{deviceId:t}}=e,n=Za(e.payload,tb);yield Fi(xa.setMfaState({saving:!0}));try{var a;yield xi(lp.auth.disableMFASMS,t,n);const e=yield xi(lp.auth.getMFADevices);yield Fi(xa.setMfaState({saving:!1,error:void 0,mfaDevices:e})),null==(a=n.callback)||a.call(n,!0)}catch(e){var i;yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==(i=n.callback)||i.call(n,!1,e)}}function*hb(){yield Fi(xa.setMfaState({loading:!0}));try{yield Bi((e=>e.auth.user));const e=yield xi(lp.auth.getMFADevices);yield Fi(xa.setMfaState({loading:!1,error:void 0,mfaDevices:e}))}catch(e){yield Fi(xa.setMfaState({loading:!1,error:Og(e)}))}}function*mb(){yield Fi(xa.setMfaState({loading:!0}));try{const e=(yield xi(lp.auth.getMFAStrategiesConfig)).strategies.filter((({isActive:e})=>e)).map((({strategy:e})=>e));yield Fi(xa.setMfaState({loading:!1,error:void 0,mfaStrategies:e}))}catch(e){yield Fi(xa.setMfaState({loading:!1,error:Og(e)}))}}function*bb(){yield Mo(xa.enrollMfa,rb),yield Mo(xa.getMFADevices,hb),yield Mo(xa.getMFAStrategies,mb),yield Mo(xa.verifyMfa,sb),yield Mo(xa.disableMfa,cb),yield Mo(xa.verifyMfaAfterForce,lb),yield Mo(xa.preDisableMfaSms,Sb),yield Mo(xa.disableMfaSms,vb),yield Mo(xa.preEnrollMfaSms,pb),yield Mo(xa.enrollMfaSms,gb),yield Mo(xa.preEnrollMfaWebAuthn,db),yield Mo(xa.enrollMfaWebAuthn,ub),yield Mo(xa.preDisableMfaWebAuthn,yb),yield Mo(xa.disableMfaWebAuthn,fb)}function*Ab(){yield Fi(xa.setMfaState({saving:!0})),yield Fi(xa.setMfaState({saving:!1,error:void 0,qrCode:"test"}))}function*Tb({payload:{callback:e}}){const{mfaDevices:t={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield Bi((e=>e.auth.mfaState));yield Fi(xa.setMfaState({saving:!0})),yield At();const n={token:"token",recoveryCode:"recoveryCode"},a={step:ln.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:M({},t,{authenticators:[{id:"authenticator-id"}]})};null!=n&&n.recoveryCode&&(a.recoveryCode=n.recoveryCode),yield Fi(xa.setMfaState(a)),yield Fi(xa.setUser(M({},Cp,{mfaEnrolled:!0}))),null==e||e(a.recoveryCode)}function*Eb(e){let{payload:{callback:t}}=e,n=Za(e.payload,nb);yield Fi(xa.setMfaState({loading:!0})),yield At();const a=M({},n,{recoveryCode:"recoveryCode"}),i={step:ln.recoveryCode,loading:!1,error:void 0,saving:!1};null!=a&&a.recoveryCode&&(i.recoveryCode=a.recoveryCode),yield Fi(xa.setMfaState(i)),yield At(),yield Fi(xa.setUser(M({},Cp,{mfaEnrolled:!0}))),null==t||t(i.recoveryCode)}function*kb({payload:e}){var t;const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield Bi((e=>e.auth.mfaState));yield Fi(xa.setMfaState({saving:!0})),yield At(),yield Fi(xa.setMfaState({saving:!1,error:void 0,mfaDevices:M({},n,{authenticators:[]})})),yield Fi(xa.setUser(M({},Cp))),null==(t=e.callback)||t.call(e,!0)}function*Ib(e){let{}=e,t=Za(e.payload,ab);yield Fi(xa.setMfaState({saving:!0}));try{var n;yield Fi(xa.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"})),null==(n=t.callback)||n.call(t,!0)}catch(e){var a;yield Fi(xa.setMfaState({saving:!1,error:Og(e)})),null==(a=t.callback)||a.call(t,!1,e)}}function*Ob({payload:e}){var t;const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield Bi((e=>e.auth.mfaState));yield Fi(xa.setMfaState({saving:!0})),yield At(),yield Fi(xa.setMfaState({loading:!1,error:void 0,mfaDevices:M({},n,{phones:[]})})),yield Fi(xa.setUser(M({},Cp))),null==(t=e.callback)||t.call(e,!0)}function*Pb({payload:e}){var t;yield Fi(xa.setMfaState({saving:!0})),yield At(),yield Fi(xa.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"})),null==(t=e.callback)||t.call(e,!0)}function*_b(e){let{payload:{callback:t}}=e;Za(e.payload,ib);const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield Bi((e=>e.auth.mfaState));yield Fi(xa.setMfaState({saving:!0})),yield At();const a={token:"token",recoveryCode:"recoveryCode"},i={step:ln.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:M({},n,{phones:[{id:"phone-id",phoneNumber:"+972504589346"}]})};null!=a&&a.recoveryCode&&(i.recoveryCode=a.recoveryCode),yield Fi(xa.setMfaState(i)),yield Fi(xa.setUser(M({},Cp,{mfaEnrolled:!0}))),null==t||t(i.recoveryCode)}function*Lb(){yield Mo(xa.enrollMfa,Ab),yield Mo(xa.verifyMfa,Tb),yield Mo(xa.disableMfa,kb),yield Mo(xa.verifyMfaAfterForce,Eb),yield Mo(xa.preDisableMfaSms,Ib),yield Mo(xa.disableMfaSms,Ob),yield Mo(xa.preEnrollMfaSms,Pb),yield Mo(xa.enrollMfaSms,_b)}const wb=["callback"];function*Db({payload:e}){yield Fi(xa.setForgotPasswordState({loading:!0}));try{var t;yield xi(lp.auth.forgotPassword,e),yield Fi(xa.setForgotPasswordState({loading:!1,error:void 0,step:Ht.success})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setForgotPasswordState({loading:!1,error:Og(t,"Unknown error occurred")})),null==(n=e.callback)||n.call(e,!1,t)}}function*Ub(e){let{payload:{callback:t}}=e,n=Za(e.payload,wb);yield Fi(xa.setForgotPasswordState({loading:!0}));try{yield xi(lp.auth.resetPassword,n),yield Fi(xa.setForgotPasswordState({loading:!1,error:void 0,step:Ht.success})),null==t||t(!0)}catch(e){yield Fi(xa.setForgotPasswordState({loading:!1,error:Og(e)})),null==t||t(!1,e)}}function*Rb({payload:e}){yield Fi(xa.setForgotPasswordState({loading:!0}));try{const t=yield xi(lp.auth.loadPasswordConfig,e);yield Fi(xa.setForgotPasswordState({loading:!1,passwordConfig:t}))}catch(e){yield Fi(xa.setForgotPasswordState({loading:!1,error:Og(e)}))}}function*Cb(){yield Go(xa.forgotPassword,Db),yield Go(xa.resetPassword,Ub),yield Go(xa.loadPasswordConfig,Rb)}let Nb;!function(e){e.USERS="USERS",e.STATS="STATS",e.UPDATE_USER="UPDATE_USER",e.DELETE_USER="DELETE_USER",e.RESEND_ACTIVATE_LINK="RESEND_ACTIVATE_LINK",e.RESEND_INVITATION_LINK="RESEND_INVITATION_LINK",e.ROLES_AND_PERMISSIONS="ROLES_AND_PERMISSIONS",e.CREATE_TOKEN_LINK="CREATE_TOKEN_LINK",e.GET_TOKEN_LINK="GET_TOKEN_LINK",e.UPDATE_TOKEN_LINK="UPDATE_TOKEN_LINK",e.DELETE_TOKEN_LINK="DELETE_TOKEN_LINK",e.CONFIG_TOKEN_LINK="CONFIG_TOKEN_LINK",e.CONFIG_TEMPORARY_USERS="CONFIG_TEMPORARY_USERS",e.UPDATE_USER_EXPIRATION_TIME="UPDATE_USER_EXPIRATION_TIME"}(Nb||(Nb={}));const Mb=["callback","events"],Fb=["user"],Gb=["callback"],$b=["callback"];function*xb({payload:{userId:e,token:t}}){yield Fi(xa.setActivateState({loading:!0,step:$t.activating}));try{const{isAuthenticated:n}=yield Bi((e=>e.auth));n&&(yield Fi(xa.silentLogout()));const a=yield xi(lp.auth.getActivateAccountStrategy,{userId:e,token:t});yield Fi(xa.setActivateStrategyState({strategy:a,loading:!1,error:void 0})),a.shouldSetPassword&&(yield Fi(xa.setActivateState({loading:!1,step:$t.activatingForm})))}catch(e){yield Fi(xa.setActivateState({loading:!1,error:Og(e)}))}}function*Vb(e){let{payload:{callback:t,events:n}}=e,a=Za(e.payload,Mb);yield Fi(xa.setActivateState({loading:!0}));try{const e=$o.onRedirectTo,{routes:o}=yield Bi((e=>e.auth)),r=yield xi(lp.auth.activateAccountV2,a),{user:s}=r,l=Za(r,Fb);if(s.redirectLocation)return void(window.location.href=s.redirectLocation);if(Tg(s)){yield Fi(xa.setActivateState({step:$t.success}));const t=yield Ig(s);yield Fi(xa.setState(t)),yield Wi(1e3),e(o.loginUrl,{preserveQueryParams:!0})}else{var i;yield Fi(xa.setActivateState({step:$t.success}));const e={email:s.email,origin:gg.ACTIVATION_LINK,id:s.id,tenantId:s.tenantId,name:s.name,createdAt:new Date};null==n||null==(i=n.userVerified)||i.call(n,e),_g(Pg.USER_VERIFIED,e),yield xi(iv,M({user:s},l),{isAuthenticated:!0}),yield Wi(1e3),yield yv(),yield Fi(xa.resetActivateState())}null==t||t(!0)}catch(e){yield Fi(xa.setActivateState({loading:!1,error:Og(e)}))}}function*jb({payload:e}){const{callback:t}=e,n=Za(e,Gb);yield Fi(xa.setActivateStrategyState({loading:!0}));try{const e=yield xi(lp.auth.getActivateAccountStrategy,n);yield Fi(xa.setActivateStrategyState({strategy:e,loading:!1,error:void 0})),null==t||t(e)}catch(e){yield Fi(xa.setActivateStrategyState({loading:!1,error:Og(e)}))}}function*Bb({payload:e}){const{callback:t}=e,n=Za(e,$b);yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:n.email})),yield Fi(xa.setActivateState({loading:!0}));try{yield xi(lp.auth.resendActivationEmail,n),yield Fi(xa.setActivateState({loading:!1,error:void 0,resentEmail:!0})),null==t||t(!0)}catch(e){yield Fi(xa.setActivateState({loading:!1,error:Og(e)})),yield Fi(xa.setTeamError({key:Nb.RESEND_ACTIVATE_LINK,value:Og(e)})),null==t||t(null,e)}yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:!1}))}function*Wb(){yield Go(xa.activateAccount,Vb),yield Go(xa.preActivateAccount,xb),yield Go(xa.getActivateAccountStrategy,jb),yield Go(xa.resendActivationEmail,Bb)}function*zb({payload:e}){if(e.token&&e.userId)try{yield Fi(xa.setAcceptInvitationState({error:void 0,step:Bt.pending})),yield xi(lp.auth.acceptInvitation,e),yield Fi(xa.setState({isAuthenticated:!1,user:null,acceptInvitationState:{error:void 0,step:Bt.success}}))}catch(e){yield Fi(xa.setAcceptInvitationState({step:Bt.failed,error:Og(e)}))}else yield Fi(xa.setAcceptInvitationState({error:void 0,step:Bt.invalid}))}function*Kb(){yield Go(xa.acceptInvitation,zb)}var Hb,qb=new Uint8Array(16);function Jb(){if(!Hb&&!(Hb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hb(qb)}const Yb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Xb=function(e){return"string"==typeof e&&Yb.test(e)};for(var Qb=[],Zb=0;Zb<256;++Zb)Qb.push((Zb+256).toString(16).substr(1));const eA=function(e,t,n){var a=(e=e||{}).random||(e.rng||Jb)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=a[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Qb[e[t+0]]+Qb[e[t+1]]+Qb[e[t+2]]+Qb[e[t+3]]+"-"+Qb[e[t+4]]+Qb[e[t+5]]+"-"+Qb[e[t+6]]+Qb[e[t+7]]+"-"+Qb[e[t+8]]+Qb[e[t+9]]+"-"+Qb[e[t+10]]+Qb[e[t+11]]+Qb[e[t+12]]+Qb[e[t+13]]+Qb[e[t+14]]+Qb[e[t+15]]).toLowerCase();if(!Xb(n))throw TypeError("Stringified UUID is invalid");return n}(a)};let tA,nA;!function(e){e.CREATE_GROUP="CREATE_GROUP",e.GET_GROUP="GET_GROUP",e.GET_GROUPS="GET_GROUPS",e.DELETE_GROUP="DELETE_GROUP",e.UPDATE_GROUP="UPDATE_GROUP",e.ADD_USERS_TO_GROUP="ADD_USERS_TO_GROUP",e.DELETE_USERS_FROM_GROUP="DELETE_USERS_FROM_GROUP",e.ADD_ROLES_TO_GROUP="ADD_ROLES_TO_GROUP",e.DELETE_ROLES_FROM_GROUP="DELETE_ROLES_FROM_GROUP",e.GET_GROUP_CONFIGURATION="GET_GROUP_CONFIGURATION",e.UPDATE_GROUP_CONFIGURATION="UPDATE_GROUP_CONFIGURATION",e.GET_TEAM_USERS="GET_TEAM_USERS"}(tA||(tA={})),function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"}(nA||(nA={}));const aA=["callback"],iA=["roles"],oA=["callback"],rA=["callback","profileImage"],sA=["callback"],lA=["callback","userId"],cA=["callback"],dA=["callback"],uA=["callback"],yA=["callback"],fA=["callback"],pA=["callback"],gA=["callback"],SA=["callback"],vA=["callback"],hA=["callback","profileImage"],mA=["callback"],bA=["callback"],AA=["callback"],TA=["callback"],EA=["callback"],kA=["callback"],IA=["callback"],OA=["callback"],PA=()=>Bi((e=>e.auth.teamState));function*_A(){try{const{groups:e}=yield xi(lp.groups.getGroups,{_groupsRelations:nA.roles});return e}catch(e){return[]}}function*LA({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s}=e,l=yield PA(),c=null!=(t=e.pageSize)?t:l.pageSize,d=null!=(n=e.pageOffset)?n:l.pageOffset,u=null!=(a=e.filter)?a:l.filterV2,y=null!=(i=e.sort)?i:l.sortV2,f=null!=(o=null==e?void 0:e.shouldShowSubTenantUsersIfReseller)?o:null==l?void 0:l.shouldShowSubTenantUsersIfReseller;yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!r})),yield Fi(xa.setTeamState({pageSize:c,pageOffset:d,filterV2:u,sortV2:y}));try{const[{items:t,_metadata:{totalPages:n,totalItems:a}},{items:i},{items:o},r]=yield Gi([xi(lp.users.getUsersV2,M({},(null==u?void 0:u.length)&&{_filter:u},y&&{_sortBy:y},e.order&&{_order:e.order},{_offset:d,_limit:c,_includeSubTenants:f})),xi(lp.teams.loadAvailableRoles),xi(lp.teams.loadAvailablePermissions),xi(_A)]),l=t.map((e=>{var t;const n=null==e||null==(t=e.groups)?void 0:t.map((e=>r.filter((t=>t.id===e.id)))).flat();return M({},e,{groups:n})}));yield Fi(xa.setTeamState({users:l.map((e=>M({},e,{roleIds:e.roles.map((e=>e.id))}))),totalPages:n,totalItems:a,roles:i,permissions:o})),null==s||s(t)}catch(e){yield Fi(xa.setTeamError({key:Nb.USERS,value:Og(e)})),yield Fi(xa.setTeamState({totalPages:0,users:[]})),null==s||s(null,e)}yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!1}))}function*wA({payload:e}){var t,n,a,i;const{silentLoading:o,callback:r}=e,s=yield PA(),l=null!=(t=e.pageSize)?t:s.pageSize,c=null!=(n=e.pageOffset)?n:s.pageOffset,d=null!=(a=e.filter)?a:s.filter,u=null!=(i=e.sort)?i:s.sort;yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!o})),yield Fi(xa.setTeamState({pageSize:l,pageOffset:c,filter:d,sort:u}));try{const[{items:e,totalPages:t,totalItems:n},{items:a},{items:i}]=yield Gi([xi(lp.teams.loadUsers,{pageSize:l,pageOffset:c,filter:d,sort:u}),xi(lp.teams.loadAvailableRoles),xi(lp.teams.loadAvailablePermissions)]);yield Fi(xa.setTeamState({users:e,totalPages:t,totalItems:n,roles:a,permissions:i})),null==r||r(e)}catch(e){yield Fi(xa.setTeamError({key:Nb.USERS,value:e.message})),yield Fi(xa.setTeamState({totalPages:0,users:[]})),null==r||r(null,e)}yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!1}))}function*DA({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s}=e,l=yield PA(),c={_limit:(null!=(t=e._limit)?t:l.allUsersQueryParams._limit)||20,_offset:(null!=(n=e._offset)?n:l.allUsersQueryParams._offset)||0,_filter:(null!=(a=e._filter)?a:l.allUsersQueryParams._filter)||"",_sortBy:(null!=(i=e._sortBy)?i:l.allUsersQueryParams._sortBy)||"name",_order:(null!=(o=e._order)?o:l.allUsersQueryParams._order)||"DESC"};yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!r})),yield Fi(xa.setTeamState({allUsersQueryParams:c}));try{const[{items:e,_metadata:{totalPages:t,totalItems:n}},{items:a},{items:i}]=yield Gi([xi(lp.subTenants.loadAllUsers,M({},c)),xi(lp.teams.loadAvailableRoles),xi(lp.teams.loadAvailablePermissions)]);yield Fi(xa.setTeamState({allUsers:e,totalPages:t,totalItems:n,roles:a,permissions:i})),null==s||s(e)}catch(e){yield Fi(xa.setTeamError({key:Nb.USERS,value:Og(e)})),yield Fi(xa.setTeamState({totalPages:0,users:[]})),null==s||s(null,e)}yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!1}))}function*UA({payload:e}){yield Fi(xa.setTeamLoader({key:Nb.ROLES_AND_PERMISSIONS,value:!0}));try{var t;const[{items:n},{items:a}]=yield Gi([xi(lp.teams.loadAvailableRoles),xi(lp.teams.loadAvailablePermissions)]);yield Fi(xa.setTeamState({roles:n,permissions:a})),null==e||null==(t=e.callback)||t.call(e,{roles:n,permissions:a})}catch(t){var n;null==e||null==(n=e.callback)||n.call(e,null,t),yield Fi(xa.setTeamError({key:Nb.ROLES_AND_PERMISSIONS,value:Og(t)}))}yield Fi(xa.setTeamLoader({key:Nb.ROLES_AND_PERMISSIONS,value:!0}))}function*RA({payload:e}){const{callback:t}=e,n=Za(e,aA),a=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!0})}));try{var i;const e=yield xi(lp.teams.addUser,n),{roles:o}=e,r=M({},Za(e,iA),{roleIds:null!=(i=null==o?void 0:o.map((e=>e.id)))?i:[]});null==t||t(r),yield Fi(xa.setTeamState({users:[r,...a.users],addUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!1,error:Og(e)})})),null==t||t(null,e)}}function*CA({payload:e}){const{callback:t}=e,n=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},n.addUserDialogState,{loading:!0})}));const a=[],i=[],o=e.emails.map((t=>M({email:t,roleIds:e.roleIds},e.expirationInSeconds&&{expirationInSeconds:e.expirationInSeconds})));yield Fi(xa.setTeamState({addUserDialogState:{open:!0,loading:!0}}));for(let e=0;e<o.length;e++){const t=o.at(e);try{yield xi(lp.teams.addUser,t),a.push(t.email)}catch(e){i.push(t.email)}}const r={pageOffset:0,pageSize:10,filter:"",silentLoading:e.emails.length>0};yield Fi(xa.loadUsersV2(r)),yield Fi(xa.setTeamState({addUserDialogState:{loading:!1}})),null==t||t({unallowedEmails:i,allowedEmails:a})}function*NA({payload:e}){const{callback:t}=e,n=Za(e,oA),a=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!0})}));try{yield xi(lp.subTenants.addUserToTenantAndSubTenants,n);const{items:e,_metadata:{totalPages:a,totalItems:i}}=yield xi(lp.subTenants.loadAllUsers,{_limit:20,_offset:0,_filter:"",_sortBy:"name",_order:"DESC"});yield Fi(xa.setTeamState({allUsers:e,totalPages:a,totalItems:i,addUserDialogState:{open:!1,loading:!1}})),null==t||t(null)}catch(e){yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!1,error:Og(e)})})),null==t||t(null,e)}}function*MA({payload:e}){const{callback:t}=e,n=Za(e,rA),{id:a}=n,i=yield PA(),o=i.users.find((e=>e.id===n.id));yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER,value:a||""})),yield Fi(xa.setTeamState({addUserDialogState:M({},i.addUserDialogState,{loading:!0})})),yield Fi(xa.setTeamState({addUserDialogState:M({},i.addUserDialogState,{loading:!0}),users:i.users.map((e=>e.id===n.id?M({},e,n):e))}));try{var r;o.roleIds.length>0&&0===(null==(r=n.roleIds)?void 0:r.length)&&(n.roleIds=[""]);const{item:e}=yield xi(lp.teams.updateUser,n);null==t||t(e),yield Fi(xa.setTeamState({users:i.users.map((t=>t.id===e.id?M({},t,e,{groups:t.groups,createdAt:t.createdAt,customData:t.customData,lastLogin:t.lastLogin}):t))})),yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER,value:!1}))}catch(e){yield Fi(xa.setTeamState({addUserDialogState:M({},i.addUserDialogState,{loading:!1,error:Og(e)}),users:i.users.map((e=>e.id===n.id?M({},e,o):e))})),yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER,value:!1})),null==t||t(null,e)}}function*FA({payload:e}){const{callback:t}=e,n=Za(e,sA),a=yield PA();yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!0})}));try{yield xi(lp.teams.deleteUser,n),null==t||t(!0),yield Fi(xa.setTeamState({users:a.users.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!1,error:Og(e)})})),null==t||t(null,e)}}function*GA({payload:e}){const{callback:t,userId:n}=e,a=Za(e,lA),i=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},i.addUserDialogState,{loading:!0})}));try{yield xi(lp.subTenants.setUserRolesForSubTenants,n,a);const e=i.allUsers.find((e=>e.id===n));let o=[];e&&(o=e.tenants.map((e=>{var t;return M({},e,{roles:(null==(t=a.subTenantsRoles.find((t=>t.tenantId===e.tenantId)))?void 0:t.roleIds.map((e=>i.roles.find((({id:t})=>e===t)))).filter((e=>e)))||e.roles})}))),yield Fi(xa.setTeamState({allUsers:[...i.allUsers.filter((e=>e.id!==n)),...e?[M({},e,{tenants:o})]:[]],addUserDialogState:{open:!1,loading:!1}})),null==t||t(!0)}catch(e){yield Fi(xa.setTeamState({addUserDialogState:M({},i.addUserDialogState,{loading:!1,error:Og(e)})})),null==t||t(null,e)}}function*$A({payload:e}){const{callback:t}=e,n=Za(e,cA),a=yield PA();yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!0})}));try{yield xi(lp.subTenants.removeUserFromTenantAndSubTenants,n),null==t||t(!0),yield Fi(xa.setTeamState({allUsers:a.allUsers.filter((e=>e.id!==n.userId&&e.tenants.length===n.subTenants.length)),deleteUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!1,error:Og(e)})})),null==t||t(null,e)}}function*xA({payload:e}){const{callback:t}=e,n=Za(e,dA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:n.userId}));try{yield xi(lp.teams.resendActivationLink,n),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.RESEND_ACTIVATE_LINK,value:Og(e)})),null==t||t(null,e)}yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:!1}))}function*VA({payload:e}){const{callback:t}=e,n=Za(e,uA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email}));try{yield xi(lp.teams.resendInvitationLink,n),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.RESEND_INVITATION_LINK,value:Og(e)})),null==t||t(null,e)}yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*jA({payload:e}){const{callback:t}=e,n=Za(e,yA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email}));try{yield xi(lp.auth.resendInvitationEmail,n),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.RESEND_INVITATION_LINK,value:Og(e)})),null==t||t(null,e)}yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*BA({payload:e}){const{callback:t}=e,n=Za(e,fA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email}));try{yield xi(lp.teams.resendInvitationLinkToAllTenants,n),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.RESEND_INVITATION_LINK,value:Og(e)})),null==t||t(null,e)}yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*WA(){yield Fi(xa.setTeamError({key:Nb.CONFIG_TOKEN_LINK,value:!1}));try{const e=yield xi(lp.teams.getInviteLinkConfiguration);yield Fi(xa.setTeamState({inviteTokenState:M({},e)}))}catch(e){yield Fi(xa.setTeamError({key:Nb.CONFIG_TOKEN_LINK,value:Og(e)}))}}function*zA(){yield Fi(xa.setTeamError({key:Nb.CONFIG_TEMPORARY_USERS,value:!1}));try{const e=yield xi(lp.teams.getTemporaryUserConfiguration);yield Fi(xa.setTeamState({temporaryUsersConfig:e}))}catch(e){yield Fi(xa.setTeamError({key:Nb.CONFIG_TEMPORARY_USERS,value:Og(e)}))}}function*KA({payload:e}){const{callback:t}=e,n=Za(e,pA),a=yield PA();yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!0}));try{const e=yield xi(lp.teams.updateUserExpirationTime,n);yield Fi(xa.setTeamState({users:a.users.map((t=>t.id===n.userId?M({},t,{temporaryExpirationDate:new Date(e.temporaryExpirationDate)}):t))})),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!1}))}}function*HA({payload:e}){const{callback:t}=e,n=Za(e,gA),a=yield PA();yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!0}));try{yield xi(lp.teams.setPermanentUser,n.userId),yield Fi(xa.setTeamState({users:a.users.map((e=>e.id===n.userId?M({},e,{temporaryExpirationDate:void 0}):e))})),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!1}))}}function*qA(){yield Fi(xa.setTeamError({key:Nb.GET_TOKEN_LINK,value:!1}));try{yield xi(WA);const e=yield xi(lp.teams.getInviteUserLink),{inviteTokenState:t}=yield PA();yield Fi(xa.setTeamState({inviteTokenState:M({},t,e)}))}catch(e){yield Fi(xa.setTeamError({key:Nb.GET_TOKEN_LINK,value:Og(e)}))}}function*JA({payload:{callback:e}}){yield Fi(xa.setTeamError({key:Nb.CREATE_TOKEN_LINK,value:!1}));const{inviteTokenState:t}=yield PA();try{const n=yield xi(lp.teams.createInviteUserLink,{expiresInMinutes:43200});yield Fi(xa.setTeamState({inviteTokenState:M({},t,n)})),null==e||e(n.token)}catch(t){null==e||e(null,t),yield Fi(xa.setTeamError({key:Nb.CREATE_TOKEN_LINK,value:Og(t)}))}}function*YA({payload:{callback:e,expiresInMinutes:t,shouldSendEmail:n}}){const{inviteTokenState:a}=yield PA();yield Fi(xa.setTeamError({key:Nb.UPDATE_TOKEN_LINK,value:!1}));try{const i=yield xi(lp.teams.updateInviteUserLink,{expiresInMinutes:t,shouldSendEmail:n});yield Fi(xa.setTeamState({inviteTokenState:M({},a,i)})),null==e||e(!0)}catch(t){null==e||e(null,t),yield Fi(xa.setTeamError({key:Nb.UPDATE_TOKEN_LINK,value:Og(t)}))}}function*XA({payload:e}){const{callback:t}=null!=e?e:{};yield Fi(xa.setTeamError({key:Nb.DELETE_TOKEN_LINK,value:!1}));try{yield xi(lp.teams.deleteInviteUserLink),yield Fi(xa.setTeamState({inviteTokenState:void 0})),null==t||t(!0)}catch(e){yield Fi(xa.setTeamError({key:Nb.DELETE_TOKEN_LINK,value:Og(e)})),null==t||t(!1,e)}}function*QA({payload:e}){yield Fi(xa.setTeamState({addUserDialogState:M({open:!0,loading:!1,error:!1},e)}))}function*ZA({payload:e}){const t=yield PA(),{addUserDialogState:{onClose:n}}=t;null==n||n(e),yield Fi(xa.setTeamState({addUserDialogState:{loading:!1,error:!1,open:!1}}))}function*eT({payload:e}){yield Fi(xa.setTeamState({deleteUserDialogState:M({open:!0,loading:!1,error:!1},e)}))}function*tT({payload:e}){const t=yield PA(),{deleteUserDialogState:{onClose:n}}=t;null==n||n(e),yield Fi(xa.setTeamState({deleteUserDialogState:{loading:!1,error:!1,open:!1}}))}function*nT(){yield Fo(xa.loadUsers,wA),yield Fo(xa.loadUsersV2,LA),yield Fo(xa.loadAllSubTenantsUsers,DA),yield Fo(xa.loadRoles,UA),yield Mo(xa.addUser,RA),yield Mo(xa.addUsersBulk,CA),yield Mo(xa.addUserToSubTenants,NA),yield Mo(xa.updateUser,MA),yield Mo(xa.setUserRolesForSubTenants,GA),yield Mo(xa.deleteUser,FA),yield Mo(xa.deleteUserFromSubTenants,$A),yield Mo(xa.resendActivationLink,xA),yield Mo(xa.resendInvitationLink,VA),yield Mo(xa.resendInvitationEmail,jA),yield Mo(xa.resendInvitationLinkToAllSubTenants,BA),yield Mo(xa.getTemporaryUsersConfig,zA),yield Mo(xa.updateUserExpirationTime,KA),yield Mo(xa.setUserAsPermanent,HA),yield Mo(xa.getInvitationLink,qA),yield Mo(xa.createInvitationLink,JA),yield Mo(xa.updateInvitationLink,YA),yield Mo(xa.deleteInvitationLink,XA),yield Mo(xa.openAddUserDialog,QA),yield Mo(xa.closeAddUserDialog,ZA),yield Mo(xa.openDeleteUserDialog,eT),yield Mo(xa.closeDeleteUserDialog,tT)}function*aT({payload:e}){var t,n,a,i;const{silentLoading:o,callback:r}=e,s=yield PA(),l=null!=(t=e.pageSize)?t:s.pageSize,c=null!=(n=e.pageOffset)?n:s.pageOffset,d=null!=(a=e.filter)?a:s.filterV2,u=null!=(i=e.sort)?i:s.sortV2;yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!o})),yield Fi(xa.setTeamState({pageSize:l,pageOffset:c,filterV2:d,sortV2:u})),yield At(),yield Fi(xa.setTeamState({users:Xp,totalPages:2,totalItems:10,roles:Bp,permissions:zp})),yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!1})),null==r||r(Xp)}function*iT({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s}=e,l=yield PA(),c=null!=(t=e._limit)?t:l.allUsersQueryParams._limit,d=null!=(n=e._offset)?n:l.allUsersQueryParams._offset,u=null!=(a=e._filter)?a:l.allUsersQueryParams._filter,y=null!=(i=e._sortBy)?i:l.allUsersQueryParams._sortBy,f=null!=(o=e._order)?o:l.allUsersQueryParams._order;yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!r})),yield Fi(xa.setTeamState({allUsersQueryParams:{_limit:c,_offset:d,_filter:u,_sortBy:y,_order:f}})),yield At(),yield Fi(xa.setTeamState({allUsers:Zp,totalPages:2,totalItems:10,roles:Bp,permissions:zp})),yield Fi(xa.setTeamLoader({key:Nb.USERS,value:!1})),null==s||s(Zp)}function*oT({payload:e}){var t;yield Fi(xa.setTeamLoader({key:Nb.ROLES_AND_PERMISSIONS,value:!0})),yield At(),yield Fi(xa.setTeamState({roles:Bp,permissions:zp})),yield Fi(xa.setTeamLoader({key:Nb.ROLES_AND_PERMISSIONS,value:!0})),null==e||null==(t=e.callback)||t.call(e,{roles:Bp,permissions:zp})}function*rT({payload:e}){const{callback:t}=e,n=Za(e,SA),a=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!0})})),yield At();const i=new Date,o=M({},qp,{groups:[]},n,{id:`${eA()}`,temporaryExpirationDate:n.expirationInSeconds?new Date(i.setSeconds(i.getSeconds()+n.expirationInSeconds)):void 0});null==t||t(o),yield Fi(xa.setTeamState({users:[o,...a.users],addUserDialogState:{open:!1,loading:!1}}))}function*sT({payload:e}){const{callback:t}=e,n=Za(e,vA),a=yield PA();yield Fi(xa.setTeamState({addUserDialogState:M({},a.addUserDialogState,{loading:!0})})),yield At();const i=M({},qp,n,{id:`${eA()}`});yield Fi(xa.setTeamState({users:[i,...a.users],addUserDialogState:{open:!1,loading:!1}})),null==t||t(null)}function*lT({payload:e}){var t;const{callback:n}=e,a=Za(e,hA),{id:i}=a,o=yield PA(),r=o.users.find((e=>e.id===a.id));yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER,value:i||""})),yield Fi(xa.setTeamState({addUserDialogState:M({},o.addUserDialogState,{loading:!0})})),yield Fi(xa.setTeamState({addUserDialogState:M({},o.addUserDialogState,{loading:!0}),users:o.users.map((e=>e.id===a.id?M({},e,a):e))})),r.roleIds.length>0&&0===(null==(t=a.roleIds)?void 0:t.length)&&(a.roleIds=[""]),yield At();const s=M({},r,a);null==n||n(s),yield Fi(xa.setTeamState({users:o.users.map((e=>e.id===s.id?M({},e,s,{createdAt:e.createdAt,customData:e.customData,lastLogin:e.lastLogin}):e))})),yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER,value:!1}))}function*cT({payload:e}){const{callback:t}=e,n=Za(e,mA),a=yield PA();yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!0})})),yield At(),null==t||t(!0),yield Fi(xa.setTeamState({users:a.users.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}function*dT({payload:e}){const{callback:t}=e,n=Za(e,bA),a=yield PA();yield Fi(xa.setTeamState({deleteUserDialogState:M({},a.deleteUserDialogState,{loading:!0})})),yield At(),null==t||t(!0),yield Fi(xa.setTeamState({allUsers:a.allUsers.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}function*uT({payload:e}){const{callback:t}=e,n=Za(e,AA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:n.userId})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.RESEND_ACTIVATE_LINK,value:!1}))}function*yT({payload:e}){const{callback:t}=e,n=Za(e,TA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*fT({payload:e}){const{callback:t}=e,n=Za(e,EA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*pT({payload:e}){const{callback:t}=e,n=Za(e,kA);yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:n.email})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.RESEND_INVITATION_LINK,value:!1}))}function*gT({payload:e}){const{callback:t}=e,n=Za(e,IA),a=yield PA();yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!0}));const i=new Date;yield Fi(xa.setTeamState({users:a.users.map((e=>e.id===n.userId?M({},e,{temporaryExpirationDate:n.expirationInSeconds?new Date(i.setSeconds(i.getSeconds()+n.expirationInSeconds)):void 0}):e))})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!1}))}function*ST({payload:e}){const{callback:t}=e,n=Za(e,OA),a=yield PA();yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!0})),yield Fi(xa.setTeamState({users:a.users.map((e=>e.id===n.userId?M({},e,{temporaryExpirationDate:void 0}):e))})),yield At(),null==t||t(!0),yield Fi(xa.setTeamLoader({key:Nb.UPDATE_USER_EXPIRATION_TIME,value:!1}))}function*vT(){yield Fo(xa.loadUsersV2,aT),yield Fo(xa.loadAllSubTenantsUsers,iT),yield Fo(xa.loadRoles,oT),yield Mo(xa.addUser,rT),yield Mo(xa.addUserToSubTenants,sT),yield Mo(xa.updateUser,lT),yield Mo(xa.deleteUser,cT),yield Mo(xa.updateUserExpirationTime,gT),yield Mo(xa.setUserAsPermanent,ST),yield Mo(xa.deleteUserFromSubTenants,dT),yield Mo(xa.resendActivationLink,uT),yield Mo(xa.resendInvitationLink,yT),yield Mo(xa.resendInvitationEmail,fT),yield Mo(xa.resendInvitationLinkToAllSubTenants,pT),yield Mo(xa.openAddUserDialog,QA),yield Mo(xa.closeAddUserDialog,ZA),yield Mo(xa.openDeleteUserDialog,eT),yield Mo(xa.closeDeleteUserDialog,tT)}const hT=["authorizationUrl"],mT=["events","url"];function*bT(){try{yield Fi(xa.setSocialLoginsState({loading:!0}));const e=yield xi(lp.auth.getSocialLoginProviders);yield Fi(xa.setSocialLoginsState({socialLoginsConfig:e,loading:!1,firstLoad:!1}))}catch(e){yield Fi(xa.setSocialLoginsState({error:Og(e),loading:!1,firstLoad:!1}))}}function*AT(){const e=yield Bi((({auth:e})=>e.isAuthenticated));let t;return t=e?yield xi(lp.auth.getSocialLoginProvidersV2ForAuthenticatedUser):yield xi(lp.auth.getSocialLoginProvidersV2),t}function*TT(e){try{var t,n;const a=yield Bi((e=>e.root.context));yield Fi(xa.setSocialLoginsState({loading:!0}));const i=yield xi(AT),{providers:o}=yield xi(lp.auth.getCustomSocialLoginProvidersV1),r={socialLoginsConfigV2:i.map((e=>{let{authorizationUrl:t}=e,n=Za(e,hT);const i=Pr(a,null!=t?t:"");return M({},n,{authorizationUrl:t?`${i}${t}`:null})})),customSocialLoginsConfig:o,loading:!1,firstLoad:!1};yield Fi(xa.setSocialLoginsState(r)),null==e||null==(t=e.payload)||null==(n=t.callback)||n.call(t,r)}catch(t){var a,i;null==e||null==(a=e.payload)||null==(i=a.callback)||i.call(a,null,t),yield Fi(xa.setSocialLoginsState({error:Og(t),loading:!1,firstLoad:!1}))}}function*ET(e){let{payload:{events:t,url:n}}=e,a=Za(e.payload,mT);try{yield Fi(xa.setSocialLoginsState({loading:!0}));const{email:e,isNewUser:r,userId:s,tenantId:l,name:c}=yield xi(lp.auth.loginViaSocialLogin,a);if(r){var i,o;const r={email:e,url:n,createdAt:new Date,id:s,tenantId:l},d=M({},r,{socialProvider:a.provider,authenticationType:Sg.SOCIAL_LOGIN});null==t||null==(i=t.signUpComplete)||i.call(t,d),_g(Pg.SIGNUP_COMPLETED,d);const u=M({},r,{origin:gg.SOCIAL_LOGIN,name:c});null==t||null==(o=t.userVerified)||o.call(t,u),_g(Pg.USER_VERIFIED,u)}s&&localStorage.setItem("userId",s),yield Fi(xa.setLoginState({email:e,isNewUser:r})),yield function*(){const{hostedLoginBox:e}=yield Bi((e=>e.auth));e?yield xi(lh):yield xi(dh)}(),localStorage.removeItem("register-quick-login"),yield Fi(xa.setSocialLoginsState({loading:!1}))}catch(e){yield Fi(xa.setSocialLoginsState({loading:!1,error:Og(e,"Failed to authenticate"),firstLoad:!1}))}}function*kT({payload:e}){yield Fi(xa.setSocialLoginsState({error:e.error,loading:!1,firstLoad:!1}))}function*IT(){yield Go(xa.loadSocialLoginsConfiguration,bT),yield Mo(xa.loadSocialLoginsConfigurationV2,TT),yield Go(xa.loginViaSocialLogin,ET),yield Fo(xa.setSocialLoginError,kT)}let OT,PT;function*_T({payload:e}){const{description:t,expires:n,callback:a}=e,{apiTokensDataUser:i}=yield Bi((e=>e.auth.apiTokensState)),{policy:o}=yield Bi((e=>e.auth.securityPolicyState.publicPolicy)),r=(null==o?void 0:o.machineToMachineAuthStrategy)===ka.AccessToken;try{let e;yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!0}));let o=null;n&&(o=1440*n),e=r?yield xi(lp.auth.createUserAccessToken,{description:t,expiresInMinutes:o}):yield xi(lp.auth.updateUserApiTokensData,{description:t,expiresInMinutes:o}),yield Fi(xa.setApiTokensState({showAddTokenDialog:!1})),yield Wi(200),yield Fi(xa.setApiTokensState({apiTokensDataUser:[M({},e,{type:r?ka.AccessToken:ka.ClientCredentials}),...i],successDialog:{open:!0,secret:e.secret,clientId:r?void 0:e.clientId}})),yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!1})),null==a||a(null)}catch(e){yield Fi(xa.setApiTokensError({key:OT.ADD_API_TOKEN,value:Og(e)})),yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!1})),null==a||a(null,e)}}function*LT({payload:e}){const{description:t,roleIds:n,expires:a,callback:i}=e,{apiTokensDataTenant:o}=yield Bi((e=>e.auth.apiTokensState)),{policy:r}=yield Bi((e=>e.auth.securityPolicyState.publicPolicy)),s=(null==r?void 0:r.machineToMachineAuthStrategy)===ka.AccessToken;try{let e;yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!0}));let r=null;a&&(r=1440*a),e=s?yield xi(lp.auth.createTenantAccessToken,{description:t,expiresInMinutes:r,roleIds:n}):yield xi(lp.auth.updateTenantApiTokensData,{description:t,roleIds:n,expiresInMinutes:r}),yield Fi(xa.setApiTokensState({showAddTokenDialog:!1})),yield Wi(200),yield Fi(xa.setApiTokensState({apiTokensDataTenant:[M({},e,{type:s?ka.AccessToken:ka.ClientCredentials}),...o],successDialog:{open:!0,secret:e.secret,clientId:s?void 0:e.clientId}})),yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!1})),null==i||i(null)}catch(e){yield Fi(xa.setApiTokensError({key:OT.ADD_API_TOKEN,value:Og(e)})),yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!1})),null==i||i(null,e)}}function*wT({payload:e}){const{apiTokensDataUser:t}=yield Bi((e=>e.auth.apiTokensState)),n=t.some((t=>t.id===e));try{yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!0})),n?(yield xi(lp.auth.deleteUserAccessToken,{id:e}),yield Fi(xa.setApiTokensState({apiTokensDataUser:t.filter((t=>t.id!==e)),deleteTokenDialog:{open:!1,id:e}}))):(yield xi(lp.auth.deleteUserApiToken,{tokenId:e}),yield Fi(xa.setApiTokensState({apiTokensDataUser:t.filter((t=>t.clientId!==e)),deleteTokenDialog:{open:!1,clientId:e}}))),yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!1}))}catch(e){yield Fi(xa.setApiTokensError({key:OT.DELETE_API_TOKEN,value:Og(e)})),yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!1}))}}function*DT({payload:e}){const{apiTokensDataTenant:t}=yield Bi((e=>e.auth.apiTokensState)),n=t.some((t=>t.id===e));let a=t;try{yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!0})),n?(yield xi(lp.auth.deleteTenantAccessToken,{id:e}),a=t.filter((t=>t.id!==e))):(yield xi(lp.auth.deleteTenantApiToken,{tokenId:e}),a=t.filter((t=>t.clientId!==e))),yield Fi(xa.setApiTokensState({apiTokensDataTenant:a,deleteTokenDialog:{open:!1,id:e}})),yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!1}))}catch(e){yield Fi(xa.setApiTokensError({key:OT.DELETE_API_TOKEN,value:Og(e)})),yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!1}))}}function*UT({payload:e}){null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));try{var t;const[n=[],a=[]]=yield Gi([xi(lp.auth.getUserApiTokensData),xi(lp.auth.getTenantApiTokensData)]);yield Fi(xa.setApiTokensState({apiTokensDataUser:n,apiTokensDataTenant:a})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setApiTokensError({key:OT.LOAD_API_TOKENS,value:Og(t)})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*RT({payload:e}){null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));try{var t,n,a,i;const o=yield null!=(t=xi(lp.auth.getUserApiTokensData))?t:[],r=(null!=(a=(yield null!=(n=xi(lp.auth.getUserAccessTokensData))?n:[]).accessTokens)?a:[]).map((e=>M({},e,{type:ka.AccessToken}))).concat(o.map((e=>M({},e,{type:ka.ClientCredentials})))).sort(((e,t)=>new Date(t.createdAt)-new Date(e.createdAt)));yield Fi(xa.setApiTokensState({apiTokensDataUser:null!=r?r:[]})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(i=e.callback)||i.call(e,!0)}catch(t){var o;yield Fi(xa.setApiTokensError({key:OT.LOAD_API_TOKENS,value:Og(t)})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(o=e.callback)||o.call(e,null,t)}}function*CT({payload:e}){null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));try{var t,n,a,i;const o=yield null!=(t=xi(lp.auth.getTenantApiTokensData))?t:[],r=yield null!=(n=xi(lp.auth.getTenantAccessTokensData))?n:[],s=(null!=(a=null==r?void 0:r.accessTokens)?a:[]).map((e=>M({},e,{type:ka.AccessToken}))).concat(o.map((e=>M({},e,{type:ka.ClientCredentials})))).sort(((e,t)=>new Date(t.createdAt)-new Date(e.createdAt)));yield Fi(xa.setApiTokensState({apiTokensDataTenant:null!=s?s:[]})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(i=e.callback)||i.call(e,!0)}catch(t){var o;yield Fi(xa.setApiTokensError({key:OT.LOAD_API_TOKENS,value:Og(t)})),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(o=e.callback)||o.call(e,null,t)}}function*NT(){yield Go(xa.loadApiTokens,UT),yield Go(xa.loadUserApiTokens,RT),yield Go(xa.loadTenantApiTokens,CT),yield Mo(xa.addUserApiToken,_T),yield Mo(xa.addTenantApiToken,LT),yield Fo(xa.deleteTenantApiToken,DT),yield Fo(xa.deleteUserApiToken,wT)}function*MT({payload:e}){const{description:t,roleIds:n,callback:a}=e;yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!0}));const{apiTokensDataTenant:i}=yield Bi((e=>e.auth.apiTokensState)),o=M({},Dp,{description:t,roleIds:n,clientId:`CLIENT_ID_${eA()}`});yield Fi(xa.setApiTokensState({showAddTokenDialog:!1})),yield Wi(200),yield Fi(xa.setApiTokensState({apiTokensDataTenant:[...i,o],successDialog:{open:!0,secret:o.secret,clientId:o.clientId}})),yield Wi(200),yield Fi(xa.setApiTokensLoader({key:OT.ADD_API_TOKEN,value:!1})),null==a||a(null)}function*FT({payload:e}){yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!0})),yield Wi(200);const t=[Dp];yield Fi(xa.setApiTokensState({apiTokensDataTenant:t.filter((t=>t.clientId!==e)),deleteTokenDialog:{open:!1,clientId:e}})),yield Fi(xa.setApiTokensLoader({key:OT.DELETE_API_TOKEN,value:!1}))}function*GT({payload:e}){var t;null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));const n=[wp],a=[Dp];yield Fi(xa.setApiTokensState({apiTokensDataUser:n,apiTokensDataTenant:a})),yield Wi(200),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*$T({payload:e}){var t;null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));const n=[wp];yield Fi(xa.setApiTokensState({apiTokensDataUser:n})),yield Wi(200),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*xT({payload:e}){var t;null!=e&&e.silentLoading||(yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!0})));const n=[Dp];yield Fi(xa.setApiTokensState({apiTokensDataTenant:n})),yield Wi(200),yield Fi(xa.setApiTokensLoader({key:OT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*VT(){yield Go(xa.loadApiTokens,GT),yield Go(xa.loadUserApiTokens,$T),yield Go(xa.loadTenantApiTokens,xT),yield Mo(xa.addTenantApiToken,MT),yield Fo(xa.deleteTenantApiToken,FT)}function*jT({payload:e}){try{var t;yield Fi(xa.setAccountSettingsState({loading:!0}));const{accountSettingsState:n}=yield Bi((e=>e.auth)),{address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l}=n,c=yield xi(lp.accountSettings.updateSettings,M({address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l},e));yield Fi(xa.setAccountSettingsState(M({},c,{loading:!1}))),null==(t=e.callback)||t.call(e,c)}catch(t){var n;yield Fi(xa.setAccountSettingsState({loading:!1,error:Og(t)})),null==(n=e.callback)||n.call(e,null,t)}}function*BT({payload:e}){yield Fi(xa.setAccountSettingsState({loading:!(null!=e&&e.silentLoading),error:null}));try{const e=yield xi(lp.accountSettings.getSettings);yield Fi(xa.setAccountSettingsState(M({},e,{loading:!1})))}catch(e){yield Fi(xa.setAccountSettingsState({loading:!1,error:Og(e)}))}}function*WT(){yield Go(xa.saveAccountSettings,jT),yield Go(xa.loadAccountSettings,BT)}function*zT({payload:e}){var t;yield Fi(xa.setAccountSettingsState({loading:!0})),yield At();const{accountSettingsState:n}=yield Bi((e=>e.auth)),{address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l}=n,c=M({address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l},e);yield Fi(xa.setAccountSettingsState(M({},c,{loading:!1}))),null==(t=e.callback)||t.call(e,c)}function*KT({payload:e}){yield Fi(xa.setAccountSettingsState({loading:!(null!=e&&e.silentLoading),error:null})),yield At(),yield Fi(xa.setAccountSettingsState({address:"Tel-aviv",timezone:"Asia/Jerusalem",dateFormat:"DD/MM/YYYY",timeFormat:"HH:mm",currency:"USD",loading:!1}))}function*HT(){yield Go(xa.saveAccountSettings,zT),yield Go(xa.loadAccountSettings,KT)}function*qT({payload:{tenantId:e,callback:t}}){yield Fi(xa.setState({isLoading:!0}));try{yield xi(lp.tenants.switchTenant,{tenantId:e}),yield xi(rh),(null==t?void 0:t(!0))||(yield Fi(xa.setState({isLoading:!1})))}catch(e){yield Fi(xa.setState({isLoading:!1})),null==t||t(!1,e)}}function*JT({payload:e}){yield Fi(xa.setTenantsState({loading:!0}));try{var t;const n=yield xi(ts());yield Fi(xa.setTenantsState({tenants:n.tenants,activeTenant:n.activeTenant,loading:!1})),null==e||null==(t=e.callback)||t.call(e,[])}catch(t){var n;null==e||null==(n=e.callback)||n.call(e,[],t),yield Fi(xa.setTenantsState({loading:!1}))}}function*YT({payload:e}){yield Fi(xa.setTenantsState({loading:!0}));try{var t;const n=yield xi(lp.tenants.getSubTenants);yield Fi(xa.setTenantsState({subTenants:n,loading:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setTenantsState({loading:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*XT({payload:e}){yield Fi(xa.setTenantsState({loading:!0}));try{var t;const n=yield xi(lp.tenants.getSubTenantsAsTree);yield Fi(xa.setTenantsState({tenantTree:n,loading:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Fi(xa.setTenantsState({loading:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*QT(){yield Mo(xa.loadTenants,JT),yield Mo(xa.loadSubTenants,YT),yield Mo(xa.switchTenant,qT),yield Mo(xa.loadSubTenantsTree,XT)}function*ZT(){yield Fi(xa.setTenantsState({loading:!0})),yield At(),yield Fi(xa.setTenantsState({tenants:eg,activeTenant:eg[0],loading:!1}))}function*eE(){yield Mo(xa.loadTenants,ZT)}!function(e){e.LOAD_API_TOKENS="LOAD_API_TOKENS",e.ADD_API_TOKEN="ADD_API_TOKEN",e.DELETE_API_TOKEN="DELETE_API_TOKEN"}(OT||(OT={})),function(e){e.EDIT_ROLE_DIALOG="editRoleDialog",e.DELETE_ROLE_DIALOG="deleteRoleDialog",e.LOAD_ROLES="loadRoles",e.ADD_ROLE="addRole",e.MANAGE_PERMISSIONS="managePermissions"}(PT||(PT={}));const tE=["callback"],nE=["callback"],aE=["callback"],iE=["callback"],oE=["callback"];function*rE({payload:e}){var t;const n=PT.LOAD_ROLES;yield Fi(xa.setRolesStateLoader({key:n,value:!(null!=(t=null==e?void 0:e.silentLoading)&&t)}));try{const e=yield Gi([xi(lp.roles.getRoles),xi(lp.roles.getPermissions),xi(lp.roles.getPermissionCategories)]),[t,a,i]=e,{selectedRole:o}=yield Bi((e=>e.auth.rolesState)),r=null==t?void 0:t.find((({id:e})=>(null==o?void 0:o.id)===e));yield Fi(xa.setRolesState({roles:t,permissions:a,permissionCategories:i,selectedRole:r}))}catch(e){yield Fi(xa.setRolesStateError({key:n,value:Og(e)}))}finally{yield Fi(xa.setRolesStateLoader({key:n,value:!1}))}}function*sE(e){let{payload:{callback:t}}=e,n=Za(e.payload,tE);const a=PT.ADD_ROLE;yield Fi(xa.setRolesStateLoader({key:a,value:!0}));try{const e=yield xi(lp.roles.addRole,n),i=yield xi(lp.roles.getRoles);yield Fi(xa.loadRolesAndPermissions({silentLoading:!0})),yield Fi(xa.setRolesState({roles:i})),null==t||t(e)}catch(e){yield Fi(xa.setRolesStateError({key:a,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setRolesStateLoader({key:a,value:!1}))}}function*lE(e){let{payload:{callback:t}}=e,n=Za(e.payload,nE);const a=PT.ADD_ROLE;yield Fi(xa.setRolesStateLoader({key:a,value:!0}));try{const e=yield xi(lp.roles.addRoleV2,n);yield Fi(xa.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Fi(xa.setRolesStateError({key:a,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setRolesStateLoader({key:a,value:!1}))}}function*cE(e){let{payload:{callback:t}}=e,n=Za(e.payload,aE);const a=PT.DELETE_ROLE_DIALOG;yield Fi(xa.setRolesStateLoader({key:a,value:!0}));try{yield xi(lp.roles.deleteRole,n),yield Fi(xa.loadRolesAndPermissions({silentLoading:!0})),null==t||t(!0)}catch(e){yield Fi(xa.setRolesStateError({key:a,value:Og(e)})),null==t||t(!1,e)}finally{yield Fi(xa.setRolesStateLoader({key:a,value:!1}))}}function*dE(e){let{payload:{callback:t}}=e,n=Za(e.payload,iE);const a=PT.EDIT_ROLE_DIALOG;yield Fi(xa.setRolesStateLoader({key:a,value:!0}));try{const e=yield xi(lp.roles.updateRole,n);yield Fi(xa.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Fi(xa.setRolesStateError({key:a,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setRolesStateLoader({key:a,value:!1}))}}function*uE(e){let{payload:{callback:t}}=e,n=Za(e.payload,oE);const a=PT.MANAGE_PERMISSIONS;yield Fi(xa.setRolesStateLoader({key:a,value:!0}));try{const e=yield xi(lp.roles.attachPermissionsToRole,n);yield Fi(xa.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Fi(xa.setRolesStateError({key:a,value:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setRolesStateLoader({key:a,value:!1}))}}function*yE(){yield Go(xa.loadRolesAndPermissions,rE),yield Mo(xa.addRole,sE),yield Mo(xa.addRoleV2,lE),yield Mo(xa.deleteRole,cE),yield Mo(xa.updateRole,dE),yield Mo(xa.attachPermissionsToRole,uE)}function*fE({payload:e}){var t;const n=PT.LOAD_ROLES;yield Fi(xa.setRolesStateLoader({key:n,value:!(null!=(t=null==e?void 0:e.silentLoading)&&t)}));try{yield Fi(xa.setRolesState({roles:Up,permissionCategories:pg,permissions:fg,selectedRole:Up[2]}))}catch(e){yield Fi(xa.setRolesStateError({key:n,value:Og(e)}))}finally{yield Fi(xa.setRolesStateLoader({key:n,value:!1}))}}function*pE(){yield Go(xa.loadRolesAndPermissions,fE)}const gE=["callback"],SE=["callback"],vE=["callback"];function*hE(e){let{payload:{callback:t}}=e,n=Za(e.payload,gE);yield Fi(xa.setResetPhoneNumberState({loading:!0}));try{const e=yield xi(lp.auth.resetPhoneNumber,n);yield Fi(xa.setResetPhoneNumberState({loading:!1,error:void 0,resetPhoneNumberToken:e.resetPhoneNumberToken,step:Xt.VerifyResetPhoneNumber})),yield Fi(xa.setLoginState({email:n.email}))}catch(e){yield Fi(xa.setResetPhoneNumberState({loading:!1,error:Og(e)})),null==t||t(null,e)}}function*mE(e){let{payload:{callback:t}}=e,n=Za(e.payload,SE);yield Fi(xa.setResetPhoneNumberState({loading:!0}));try{const e=yield xi(lp.auth.verifyResetPhoneNumber,n);yield Fi(xa.setResetPhoneNumberState({loading:!1,error:void 0,changePhoneNumberToken:e.changePhoneNumberToken,step:Xt.ChangePhoneNumber})),null==t||t(!0)}catch(e){yield Fi(xa.setResetPhoneNumberState({loading:!1,error:Og(e)})),null==t||t(null,e)}}function*bE(e){let{payload:{callback:t}}=e,n=Za(e.payload,vE);yield Fi(xa.setResetPhoneNumberState({loading:!0}));try{const{onRedirectTo:e,routes:a}=yield Bi((({auth:{onRedirectTo:e,routes:t}})=>({onRedirectTo:e,routes:t})));yield xi(lp.auth.changePhoneNumber,{phoneNumber:n.phoneNumber,changePhoneNumberToken:n.changePhoneNumberToken}),yield Fi(xa.setLoginState({step:Ot.loginWithSmsOtc})),yield Fi(xa.passwordlessPreLogin({type:Ea.SmsCode,email:n.email,recaptchaToken:n.recaptchaToken})),e(a.loginUrl),yield Fi(xa.setResetPhoneNumberState({loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setResetPhoneNumberState({loading:!1,error:Og(e)})),null==t||t(null,e)}}function*AE(){yield Go(xa.resetPhoneNumber,hE),yield Go(xa.verifyResetPhoneNumber,mE),yield Go(xa.changePhoneNumber,bE)}function*TE(){yield Fi(xa.setSessionsState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getCurrentUserSessions);yield Fi(xa.setSessionsState({sessions:e,loading:!1}))}catch(e){yield Fi(xa.setSessionsState({error:e,loading:!1}))}}function*EE(){yield Fi(xa.setSessionsState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getCurrentUserSession);yield Fi(xa.setSessionsState({currentSession:e,loading:!1}))}catch(e){yield Fi(xa.setSessionsState({error:e,loading:!1}))}}function*kE({payload:{id:e}}){yield Fi(xa.setSessionsState({loading:!0,error:null}));try{yield xi(lp.auth.deleteSessionForUser,e),yield Fi(xa.loadUserSessions())}catch(e){yield Fi(xa.setSessionsState({error:e,loading:!1}))}}function*IE({payload:{callback:e,userId:t}}){yield Fi(xa.setSessionsState({loading:!0,error:null}));try{yield xi(lp.auth.revokeSessionsForUser,t),null==e||e(!0)}catch(t){yield Fi(xa.setSessionsState({error:t,loading:!1})),null==e||e(!1)}}function*OE(){yield Fi(xa.setSessionsState({loading:!0,error:null}));try{yield xi(lp.auth.deleteAllSessionsForUser),yield Fi(xa.loadUserSessions())}catch(e){yield Fi(xa.setSessionsState({error:e,loading:!1}))}}function*PE(){yield Fo(xa.loadUserSessions,TE),yield Fo(xa.deleteUserSession,kE),yield Fo(xa.deleteAllUserSessions,OE),yield Fo(xa.loadCurrentUserSession,EE),yield Mo(xa.revokeUserSessions,IE)}function*_E(){yield Fi(xa.setSessionsState({loading:!0,error:null})),yield Fi(xa.setSessionsState({sessions:tg,loading:!1}))}function*LE({payload:{id:e}}){yield Fi(xa.setSessionsState({loading:!0,error:null}));const t=(yield Bi((e=>{var t;return null!=(t=e.auth.sessionsState.sessions)?t:[]}))).filter((t=>t.id!==e));yield Fi(xa.setSessionsState({sessions:t,loading:!1}))}function*wE(){yield Fi(xa.setSessionsState({loading:!0,error:null}));const e=tg.filter((e=>e.current));yield Fi(xa.setSessionsState({sessions:e,loading:!1}))}function*DE(){yield Fo(xa.loadUserSessions,_E),yield Fo(xa.deleteUserSession,LE),yield Fo(xa.deleteAllUserSessions,wE)}const UE=["callback"],RE=["callback"];function*CE(){yield Fi(xa.setSessionsPolicyState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getSessionConfigurations);yield Fi(xa.setSessionsPolicyState({configurations:e,loading:!1}))}catch(e){yield Fi(xa.setSessionsState({error:e,loading:!1}))}}function*NE({payload:e}){yield Fi(xa.setSessionsPolicyState({loading:!0,error:null}));try{const{callback:t}=e,n=Za(e,UE);yield xi(lp.auth.createOrUpdateSessionConfigrations,n),yield Fi(xa.loadSessionsPolicy()),null==t||t(!0)}catch(e){yield Fi(xa.setSessionsPolicyState({error:e,loading:!1}))}}function*ME(){yield Go(xa.loadSessionsPolicy,CE),yield Fo(xa.createOrUpdateSessionsPolicy,$g(NE))}function*FE(){yield Fi(xa.setSessionsPolicyState({loading:!0,error:null}));const e=yield Bi((e=>{var t,n;return null!=(t=null==e||null==(n=e.auth)?void 0:n.sessionsPolicyState)?t:ng}));yield Fi(xa.setSessionsPolicyState(M({},e,{loading:!1})))}function*GE({payload:e}){yield Fi(xa.setSessionsPolicyState({loading:!0,error:null}));const{callback:t}=e,n=Za(e,RE);null==t||t(!0),yield Fi(xa.setSessionsPolicyState({configurations:n,loading:!1}))}function*$E(){yield Go(xa.loadSessionsPolicy,FE),yield Fo(xa.createOrUpdateSessionsPolicy,GE)}const xE=["callback"],VE=["callback"],jE=["callback"],BE=["callback"],WE=["callback"],zE=["callback"],KE=["callback"],HE=["callback"],qE=()=>Bi((e=>e.auth.restrictionsState.ipRestrictions)),JE=()=>Bi((e=>e.auth.restrictionsState.emailDomainRestrictions));function*YE(){yield Fi(xa.setEmailDomainRestrictionsState({loading:!0,error:null}));try{const e=yield xi(lp.auth.getDomainRestrictionsConfig),t=(yield xi(lp.auth.getDomainRestrictions)).items.filter((t=>t.type===e.listType));yield Fi(xa.setEmailDomainRestrictionsState({data:{restrictions:t,config:e},loading:!1}))}catch(e){yield Fi(xa.setEmailDomainRestrictionsState({error:Og(e),loading:!1}))}}function*XE(e){let{payload:{callback:t}}=e,n=Za(e.payload,xE);yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null}));const a=yield JE();try{var i;yield xi(lp.auth.createDomainRestriction,n);const e=(yield xi(lp.auth.getDomainRestrictions)).items.filter((e=>{var t;return e.type===(null==(t=a.data)?void 0:t.config.listType)}));yield Fi(xa.setEmailDomainRestrictionsState({data:{config:(null==(i=a.data)?void 0:i.config)||{active:!1,blockPublicDomains:!1,listType:n.type},restrictions:e},saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setEmailDomainRestrictionsState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*QE(e){let{payload:{callback:t}}=e,n=Za(e.payload,VE);yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null}));try{const e=yield xi(lp.auth.updateDomainRestrictionConfig,n),a=(yield xi(lp.auth.getDomainRestrictions)).items.filter((t=>t.type===e.listType));yield Fi(xa.setEmailDomainRestrictionsState({data:{config:e,restrictions:a},saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setEmailDomainRestrictionsState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*ZE({payload:{id:e}}){yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null}));const t=yield JE();try{var n;yield xi(lp.auth.deleteDomainRestriction,e);const a=(yield xi(lp.auth.getDomainRestrictions)).items.filter((e=>{var n;return e.type===(null==(n=t.data)?void 0:n.config.listType)}));yield Fi(xa.setEmailDomainRestrictionsState({data:{config:(null==(n=t.data)?void 0:n.config)||{active:!1,blockPublicDomains:!1,listType:Bn.ALLOW},restrictions:a},saving:!1}))}catch(e){yield Fi(xa.setEmailDomainRestrictionsState({saving:!1,error:Og(e)}))}}const ek=e=>{var t,n,a;return{_filter:null!=(t=null==e?void 0:e._filter)?t:Bn.ALLOW,_limit:null!=(n=null==e?void 0:e._limit)?n:10,_offset:null!=(a=null==e?void 0:e._offset)?a:0}};function*tk(){yield Fi(xa.setIpRestrictionsState({loading:!0,error:null}));try{const e=yield qE(),t=yield xi(lp.auth.getIPRestrictionsConfig),n=ek({_filter:t.strategy,_limit:e.pagination._limit,_offset:e.pagination._offset}),{items:a,_metadata:{totalPages:i}}=yield xi(lp.auth.getIPRestrictions,n);yield Fi(xa.setIpRestrictionsState({data:{restrictions:a,config:t},totalPages:i,pagination:n,loading:!1}))}catch(e){yield Fi(xa.setIpRestrictionsState({error:Og(e),loading:!1}))}}function*nk(){try{const{valid:e}=yield xi(lp.auth.testCurrentIpInAllowList);yield Fi(xa.setIpRestrictionsState({userIpValid:e}))}catch(e){yield Fi(xa.setIpRestrictionsState({error:Og(e)}))}}function*ak({payload:{callback:e}}){yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));try{const t=yield Bi((e=>e.auth.userIp));yield Gi([xi(lp.auth.createIPRestriction,{ip:t,isActive:!0,description:"My IP",strategy:Bn.ALLOW}),xi(lp.auth.updateIPRestrictionConfig,{isActive:!0})]);const n=yield qE(),a=ek(n.pagination),{items:i,_metadata:{totalPages:o}}=yield xi(lp.auth.getIPRestrictions,a);yield Fi(xa.setIpRestrictionsState({data:{config:{isActive:!0,strategy:Bn.ALLOW},restrictions:i},userIpValid:!0,pagination:a,totalPages:o,saving:!1})),null==e||e(!0)}catch(t){yield Fi(xa.setIpRestrictionsState({saving:!1,error:t})),null==e||e(!1,t)}}function*ik(e){let{payload:{callback:t}}=e,n=Za(e.payload,jE);yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));const a=yield qE();try{var i,o;yield xi(lp.auth.createIPRestriction,n);const e=yield qE(),r=ek(e.pagination),{items:s,_metadata:{totalPages:l}}=yield xi(lp.auth.getIPRestrictions,r);yield nk(),yield Fi(xa.setIpRestrictionsState({data:{config:null!=(i=null==(o=a.data)?void 0:o.config)?i:{isActive:!1,strategy:Bn.ALLOW},restrictions:s},pagination:r,totalPages:l,saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setIpRestrictionsState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*ok(e){let{payload:{callback:t}}=e,n=Za(e.payload,BE);yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));try{yield xi(lp.auth.updateIPRestrictionConfig,n);const e=yield qE(),a=yield xi(lp.auth.getIPRestrictionsConfig),i=ek(M({},e.pagination,{_filter:a.strategy})),{items:o,_metadata:{totalPages:r}}=yield xi(lp.auth.getIPRestrictions,i);yield nk(),yield Fi(xa.setIpRestrictionsState({data:{config:a,restrictions:o},pagination:i,totalPages:r,saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setIpRestrictionsState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*rk({payload:{id:e,callback:t}}){yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));const n=yield qE();try{var a;yield xi(lp.auth.deleteIPRestriction,e);const i=yield qE(),o=ek(i.pagination),{items:r,_metadata:{totalPages:s}}=yield xi(lp.auth.getIPRestrictions,o);yield nk(),yield Fi(xa.setIpRestrictionsState({data:{config:(null==(a=n.data)?void 0:a.config)||{isActive:!1,strategy:Bn.ALLOW},restrictions:r},pagination:o,totalPages:s,saving:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setIpRestrictionsState({saving:!1,error:Og(e)})),null==t||t(null,e)}}function*sk(){yield Go(xa.loadIpRestrictions,$g(tk)),yield Go(xa.loadEmailDomainRestrictions,$g(YE)),yield Mo(xa.saveIpRestriction,$g(ik)),yield Mo(xa.saveIpRestrictionsConfig,$g(ok)),yield Mo(xa.deleteIpRestriction,$g(rk)),yield Mo(xa.checkIfUserIpValid,$g(nk)),yield Mo(xa.addCurrentUserIpAndActivate,$g(ak)),yield Mo(xa.saveEmailDomainRestriction,$g(XE)),yield Mo(xa.saveEmailDomainRestrictionsConfig,$g(QE)),yield Mo(xa.deleteEmailDomainRestriction,$g(ZE))}function*lk(){yield Fi(xa.setIpRestrictionsState({loading:!0,error:null})),yield Fi(xa.setIpRestrictionsState({data:{restrictions:ig.filter((e=>e.strategy===ag.strategy)),config:ag},totalPages:1,pagination:{_filter:Bn.ALLOW,_limit:50,_offset:0},loading:!1}))}function*ck(){yield Fi(xa.setIpRestrictionsState({loading:!0,error:null}));try{const e=yield qE(),t=ig[0].ip,n=!!e.data.restrictions.find((e=>e.isActive&&e.ip===t));yield Fi(xa.setIpRestrictionsState({userIpValid:n,loading:!1}))}catch(e){yield Fi(xa.setIpRestrictionsState({error:Og(e),loading:!1}))}}function*dk(e){var t,n,a;let{payload:{callback:i}}=e,o=Za(e.payload,WE);yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));const r=yield qE(),s=r.data.restrictions.filter((e=>e.ip!==o.ip));yield Fi(xa.setIpRestrictionsState({data:{config:null!=(t=null==(n=r.data)?void 0:n.config)?t:{isActive:!1,strategy:Bn.ALLOW},restrictions:[...s,M({},o,{createdAt:new Date,updatedAt:new Date,id:eA(),isActive:null==(a=o.isActive)||a,strategy:r.data.config.strategy})]},totalPages:1,pagination:{_filter:Bn.ALLOW,_limit:50,_offset:0},saving:!1})),null==i||i(!0)}function*uk(e){var t,n,a;let{payload:{callback:i}}=e,o=Za(e.payload,zE);const r=yield qE();yield Fi(xa.setIpRestrictionsState({saving:!0,error:null})),yield Fi(xa.setIpRestrictionsState({data:{config:M({},null==(t=r.data)?void 0:t.config,o),restrictions:null!=(n=null==(a=r.data)?void 0:a.restrictions)?n:[]},pagination:{_filter:Bn.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1})),yield Fi(xa.setIpRestrictionsState({saving:!1,error:null})),null==i||i(!0)}function*yk({payload:{id:e,callback:t}}){var n;yield Fi(xa.setIpRestrictionsState({saving:!0,error:null}));const a=yield qE();yield Fi(xa.setIpRestrictionsState({data:{config:(null==(n=a.data)?void 0:n.config)||{isActive:!1,strategy:Bn.ALLOW},restrictions:a.data.restrictions.filter((t=>t.id!==e))},pagination:{_filter:Bn.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1,error:null})),null==t||t(!0)}function*fk(){yield Fi(xa.setEmailDomainRestrictionsState({loading:!0,error:null})),yield Fi(xa.setEmailDomainRestrictionsState({loading:!1,data:{restrictions:[{domain:"mock.com",id:"1",type:Bn.ALLOW}],config:{active:!0,listType:Bn.ALLOW,blockPublicDomains:!1}}}))}function*pk(e){var t,n;let{payload:{callback:a}}=e,i=Za(e.payload,KE);const o=yield JE();yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null})),yield At(),null==a||a(!0),yield Fi(xa.setEmailDomainRestrictionsState({data:{config:(null==(t=o.data)?void 0:t.config)||{active:!1,blockPublicDomains:!1,listType:i.type},restrictions:[...(null==(n=o.data)?void 0:n.restrictions)||[],M({},i,{id:Date.now().toString()})]},saving:!1}))}function*gk(e){var t;let{payload:{callback:n}}=e,a=Za(e.payload,HE);const i=yield JE();yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null})),yield At(),null==n||n(!0),yield Fi(xa.setEmailDomainRestrictionsState({data:{config:{active:a.active,blockPublicDomains:a.blockPublicDomains||!1,listType:a.type||Bn.ALLOW},restrictions:[...(null==(t=i.data)?void 0:t.restrictions)||[]]},saving:!1}))}function*Sk({payload:{id:e}}){var t,n;const a=yield JE();yield Fi(xa.setEmailDomainRestrictionsState({saving:!0,error:null})),yield At(),yield Fi(xa.setEmailDomainRestrictionsState({data:{config:(null==(t=a.data)?void 0:t.config)||{active:!1,blockPublicDomains:!1,listType:Bn.ALLOW},restrictions:((null==(n=a.data)?void 0:n.restrictions)||[]).filter((t=>t.id===e))},saving:!1}))}function*vk(){yield Go(xa.loadIpRestrictions,lk),yield Go(xa.loadEmailDomainRestrictions,fk),yield Mo(xa.saveIpRestriction,dk),yield Mo(xa.saveIpRestrictionsConfig,uk),yield Mo(xa.deleteIpRestriction,yk),yield Mo(xa.checkIfUserIpValid,ck),yield Mo(xa.saveEmailDomainRestriction,pk),yield Mo(xa.saveEmailDomainRestrictionsConfig,gk),yield Mo(xa.deleteEmailDomainRestriction,Sk)}const hk=["callback"],mk=["id"];function*bk(e){const{count:t}=yield xi(lp.directory.countConfigurationUsers,e.id);return M({},e,{count:t})}function*Ak(){yield Fi(xa.setProvisioningState({loading:!0,error:null}));try{const e=yield xi(lp.directory.getConfigs),t=yield Gi(e.map((e=>bk(e))));yield Fi(xa.setProvisioningState({connections:t,loading:!1}))}catch(e){yield Fi(xa.setProvisioningState({error:Og(e),loading:!1}))}}function*Tk(e){let{payload:{callback:t}}=e,n=Za(e.payload,hk);yield Fi(xa.setProvisioningState({loading:!0,error:null}));try{const e=yield xi(lp.directory.createConfiguration,n),a=yield xi(lp.directory.getConfigs),i=yield Gi(a.map((e=>bk(e))));yield Fi(xa.setProvisioningState({connections:i,loading:!1})),null==t||t(e)}catch(e){yield Fi(xa.setProvisioningState({error:Og(e),loading:!1}))}}function*Ek(e){let{payload:{id:t}}=e,n=Za(e.payload,mk);yield Fi(xa.setProvisioningState({loading:!0,error:null}));try{yield xi(lp.directory.updateConfiguration,t,n);const e=yield xi(lp.directory.getConfigs),a=yield Gi(e.map((e=>bk(e))));yield Fi(xa.setProvisioningState({connections:a,loading:!1}))}catch(e){yield Fi(xa.setProvisioningState({error:Og(e),loading:!1}))}}function*kk({payload:{id:e,callback:t}}){yield Fi(xa.setProvisioningState({loading:!0,error:null}));try{yield xi(lp.directory.deleteConfiguration,e);const n=yield xi(lp.directory.getConfigs),a=yield Gi(n.map((e=>bk(e))));yield Fi(xa.setProvisioningState({connections:a,loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setProvisioningState({error:Og(e),loading:!1})),null==t||t(!1,e)}}function*Ik(){yield Go(xa.loadProvisionConnections,Ak),yield Mo(xa.createProvisionConnection,Tk),yield Mo(xa.deleteProvisionConnection,kk),yield Mo(xa.updateProvisionConnection,Ek)}const Ok=["callback","events"];function*Pk(e){let{payload:{callback:t}}=e,n=Za(e.payload,Ok);yield Fi(xa.setImpersonateState({loading:!0}));try{yield xi(lp.impersonate.impersonate,n),yield Fi(xa.setImpersonateState({step:Ca.success})),yield Wi(1e3),yield yv(),yield Fi(xa.resetImpersonateState()),null==t||t(!0)}catch(e){yield Fi(xa.setImpersonateState({loading:!1,error:Og(e)}))}}function*_k(){yield Go(xa.impersonate,Pk)}function*Lk({payload:e}){const{callback:t,deviceId:n}=e;yield Fi(xa.setPasskeysState({loading:!0}));try{yield xi(lp.auth.deleteWebAuthnDevice,n);const{devices:e}=yield Bi((e=>e.auth.passkeysState)),a=e.filter((e=>e.id!==n));yield Fi(xa.setPasskeysState({devices:a,loading:!1})),null==t||t(!0)}catch(e){yield Fi(xa.setPasskeysState({loading:!1,error:Og(e,null)})),null==t||t(null,e)}}function*wk(){yield Fi(xa.setPasskeysState({loading:!0}));try{const{devices:e}=yield xi(lp.auth.getWebAuthnDevices);yield Fi(xa.setPasskeysState({devices:e,loading:!1}))}catch(e){yield Fi(xa.setPasskeysState({loading:!1,error:Og(e,null)}))}}function*Dk(){yield Mo(xa.loadWebAuthnDevices,wk),yield Mo(xa.deleteWebAuthnDevice,Lk)}const Uk=["roleIds","userIds"],Rk=()=>Bi((e=>e.auth.groupsState));function*Ck({payload:e}){const t=tA.GET_TEAM_USERS;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{const{items:n}=yield xi(lp.users.getUsersV2,{_filter:e.filter,_offset:e.pageOffset,_limit:e.pageSize,_includeSubTenants:!1});yield Fi(xa.setGroupsState({teamUsers:n}))}catch(e){yield Fi(xa.setUsersGroupsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Nk({payload:e}){const t=tA.GET_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{const n=yield xi(lp.groups.getGroupById,{groupId:e.groupId},{_groupsRelations:nA.rolesAndUsers});yield Fi(xa.setGroupsState({selectedGroup:n}))}catch(e){yield Fi(xa.setUsersGroupsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Mk(){const e=tA.GET_GROUPS,t=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:e,value:!0}));try{const{groups:n}=yield xi(lp.groups.getGroups,{_groupsRelations:nA.rolesAndUsers});yield Fi(xa.setGroupsState(M({groups:n},t.selectedGroup&&{selectedGroup:n.find((e=>{var n;return e.id===(null==(n=t.selectedGroup)?void 0:n.id)}))})))}catch(t){yield Fi(xa.setUsersGroupsError({key:e,value:Og(t)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:e,value:!1}))}}function*Fk({payload:e}){const t=tA.CREATE_GROUP,{roleIds:n,userIds:a}=e,i=Za(e,Uk);yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var o;const r=yield xi(lp.groups.createGroup,M({name:i.name},!!i.description&&{description:i.description},{color:i.color}));null!=a&&a.length&&(yield Fi(xa.addUsersToGroup({groupId:r.id,userIds:a}))),null!=n&&n.length&&(yield Fi(xa.addRolesToGroup({groupId:r.id,roleIds:n}))),yield Fi(xa.loadGroups()),null==e||null==(o=e.callback)||o.call(e,!0)}catch(n){var r;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(r=e.callback)||r.call(e,!1)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Gk({payload:e}){const t=tA.UPDATE_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.updateGroup,e),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*$k({payload:e}){const t=tA.DELETE_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.deleteGroup,e.groupId),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(a=e.callback)||a.call(e,!1,n)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*xk({payload:e}){const t=tA.ADD_ROLES_TO_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.addRolesToGroup,e.groupId,{roleIds:e.roleIds}),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Vk({payload:e}){const t=tA.DELETE_ROLES_FROM_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.deleteRolesFromGroup,e.groupId,{roleIds:e.roleIds}),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*jk({payload:e}){const t=tA.ADD_USERS_TO_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.addUsersToGroup,e.groupId,{userIds:e.userIds}),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;null==e||null==(a=e.callback)||a.call(e,!1),yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Bk({payload:e}){const t=tA.DELETE_USERS_FROM_GROUP;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield xi(lp.groups.deleteUsersFromGroup,e.groupId,{userIds:e.userIds}),yield Fi(xa.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Fi(xa.setUsersGroupsError({key:t,value:Og(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Wk(){const e=tA.GET_GROUP_CONFIGURATION;yield Fi(xa.setUsersGroupsLoader({key:e,value:!0}));try{const t=yield xi(lp.groups.getGroupConfiguration);yield Fi(xa.setGroupsState({groupsConfiguration:t}))}catch(t){yield Fi(xa.setUsersGroupsError({key:e,value:Og(t)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:e,value:!1}))}}function*zk({payload:e}){const t=tA.UPDATE_GROUP_CONFIGURATION;yield Fi(xa.setUsersGroupsLoader({key:t,value:!0}));try{yield xi(lp.groups.updateGroupConfiguration,e),yield Fi(xa.getGroupConfiguration())}catch(e){yield Fi(xa.setUsersGroupsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}}function*Kk(){yield Fo(xa.loadGroups,Mk),yield Fo(xa.getGroupById,Nk),yield Fo(xa.createGroup,Fk),yield Fo(xa.updateGroup,Gk),yield Fo(xa.deleteGroup,$k),yield Fo(xa.addRolesToGroup,xk),yield Fo(xa.deleteRolesFromGroup,Vk),yield Fo(xa.addUsersToGroup,jk),yield Fo(xa.deleteUsersFromGroup,Bk),yield Fo(xa.getGroupConfiguration,Wk),yield Fo(xa.updateGroupConfiguration,zk),yield Fo(xa.getTeamUsers,Ck)}function*Hk(){const e=tA.GET_GROUPS;yield Fi(xa.setUsersGroupsLoader({key:e,value:!0}));const t=sg;yield Fi(xa.setGroupsState({groups:t})),yield Fi(xa.setUsersGroupsLoader({key:e,value:!1}))}function*qk({payload:e}){var t;const n=tA.CREATE_GROUP,{groups:a}=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:n,value:!0})),yield Fi(xa.setGroupsState({groups:[M({},e,{id:`${e.name}ID`,managedBy:np.FRONTEGG}),...null!=a?a:[]]})),yield Wi(500),null==e||null==(t=e.callback)||t.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:n,value:!1}))}function*Jk({payload:e}){var t,n,a,i,o;const r=tA.UPDATE_GROUP,s=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:r,value:!0})),yield Fi(xa.setGroupsState({groups:null==s||null==(t=s.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?M({},e,{id:e.groupId,name:null!=(n=null==e?void 0:e.name)?n:"",managedBy:np.FRONTEGG}):t})),selectedGroup:M({},null==s?void 0:s.selectedGroup,{name:null!=(n=null==e?void 0:e.name)?n:"",color:null!=(a=null==e?void 0:e.color)?a:"",description:null!=(i=null==e?void 0:e.description)?i:""})})),yield Wi(500),null==e||null==(o=e.callback)||o.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:r,value:!1}))}function*Yk({payload:e}){var t,n;const a=tA.DELETE_GROUP,i=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:a,value:!0})),yield Fi(xa.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.filter((t=>t.id!==e.groupId))})),yield Wi(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:a,value:!1}))}function*Xk({payload:e}){var t,n;const a=tA.ADD_ROLES_TO_GROUP,i=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:a,value:!0})),yield Fi(xa.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?M({},t,{roles:[...null!=(n=null==t?void 0:t.roles)?n:[],...e.roleIds.map((e=>({id:e,name:e})))]}):t}))})),yield Wi(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:a,value:!1}))}function*Qk({payload:e}){var t,n;const a=tA.DELETE_ROLES_FROM_GROUP,i=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:a,value:!0})),yield Fi(xa.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?M({},t,{roles:null==t||null==(n=t.roles)?void 0:n.filter((t=>!e.roleIds.includes(t.id)))}):t}))})),yield Wi(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:a,value:!1}))}function*Zk({payload:e}){var t,n;const a=tA.ADD_USERS_TO_GROUP,i=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:a,value:!0})),yield Fi(xa.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?M({},t,{users:[...null!=(n=null==t?void 0:t.users)?n:[],...e.userIds.map((e=>({id:e,name:e})))]}):t}))})),yield Wi(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:a,value:!1}))}function*eI({payload:e}){var t,n;const a=tA.DELETE_USERS_FROM_GROUP,i=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:a,value:!0})),yield Fi(xa.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?M({},t,{users:null==t||null==(n=t.users)?void 0:n.filter((t=>!e.userIds.includes(t.id)))}):t}))})),yield Wi(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Fi(xa.setUsersGroupsLoader({key:a,value:!1}))}function*tI(){const e=tA.GET_GROUP_CONFIGURATION,{groupsConfiguration:t}=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:e,value:!0})),t&&(yield Fi(xa.setGroupsState({groupsConfiguration:M({},t)}))),yield Fi(xa.setUsersGroupsLoader({key:e,value:!1}))}function*nI({payload:e}){const t=tA.UPDATE_GROUP_CONFIGURATION,{groupsConfiguration:n}=yield Rk();yield Fi(xa.setUsersGroupsLoader({key:t,value:!0})),n&&(yield Fi(xa.setGroupsState({groupsConfiguration:M({},n,e)}))),yield Fi(xa.setUsersGroupsLoader({key:t,value:!1}))}function*aI(){yield Fo(xa.loadGroups,Hk),yield Fo(xa.createGroup,qk),yield Fo(xa.updateGroup,Jk),yield Fo(xa.deleteGroup,Yk),yield Fo(xa.addRolesToGroup,Xk),yield Fo(xa.deleteRolesFromGroup,Qk),yield Fo(xa.addUsersToGroup,Zk),yield Fo(xa.deleteUsersFromGroup,eI),yield Fo(xa.getGroupConfiguration,tI),yield Fo(xa.updateGroupConfiguration,nI)}let iI;!function(e){e.GET_ACCOUNTS="GET_ACCOUNTS",e.SEARCH_ACCOUNTS="SEARCH_ACCOUNTS",e.SET_ROOT_ACCOUNT_DATA="SET_ROOT_ACCOUNT_DATA",e.SET_SELECTED_SUB_ACCOUNT_DATA="SET_SELECTED_SUB_ACCOUNT_DATA",e.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT="LOAD_NUMBER_OF_USERS_FOR_ACCOUNT",e.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER="UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER",e.CREATE_SUB_ACCOUNT="CREATE_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT="UPDATE_SUB_ACCOUNT",e.DELETE_SUB_ACCOUNT="DELETE_SUB_ACCOUNT",e.GET_ACCOUNT_USERS="GET_ACCOUNT_USERS",e.ADD_USERS_TO_ACCOUNT="ADD_USERS_TO_ACCOUNT",e.DELETE_USERS_FROM_ACCOUNT="DELETE_USERS_FROM_ACCOUNT",e.SET_USER_ROLES_FOR_SUB_ACCOUNT="SET_USER_ROLES_FOR_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT_SETTINGS="UPDATE_SUB_ACCOUNT_SETTINGS",e.GET_USER_JWT="GET_USER_JWT",e.GET_TEAM_USERS="GET_TEAM_USERS"}(iI||(iI={}));const oI=(e,t,n)=>{var a,i;return e.tenantId===t?M({},e,{name:n}):M({},e,{children:null!=(a=null==e||null==(i=e.children)?void 0:i.map((e=>oI(e,t,n))))?a:[]})};function rI(e,t){var n;return M({},e,{children:null!=(n=e.children)&&n.length?e.children.filter((e=>e.tenantId!==t)).map((e=>rI(e,t))):[]})}function sI(e,t,n){var a,i;if(e.tenantId===t){var o;const t=[...null!=(o=null==e?void 0:e.children)?o:[],...n].filter(((e,t,n)=>t===n.findIndex((t=>t.tenantId===e.tenantId))));return M({},e,{children:t})}return M({},e,{children:null!=(a=null==e||null==(i=e.children)?void 0:i.map((e=>sI(e,t,n))))?a:[]})}const lI=({items:e},t)=>e.map((e=>{var n,a;return{name:e.name,tenantId:e.tenantId,numberOfUsers:null!=(n=null==(a=t.find((t=>t.tenantId===e.tenantId)))?void 0:a.totalUsers)?n:0,createdAt:e.createdAt,metadata:e.metadata}})),cI=()=>Bi((e=>e.auth.allAccountsState));function*dI({payload:e}){const t=iI.GET_ACCOUNTS;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{accountsQueryParams:n}=yield cI(),{jwt:a,_limit:i,_offset:o}=e,r={_offset:null!=o?o:n._offset,_limit:null!=i?i:n._limit,_subTenantId:null==e?void 0:e._subTenantId};try{if(a){var s;const{selectedAccount:t}=yield cI(),{items:n,_links:i}=yield xi(lp.tenants.searchSubTenants,r,{jwt:a}),o=yield xi(lp.tenants.getTenantsUsersCount,{tenantIds:n.map((e=>e.tenantId))},{jwt:a}),l=lI({items:n},o),c=sI(t.accounts?t.accounts:t,null!=(s=null==e?void 0:e._subTenantId)?s:"",l.map((e=>({name:e.name,tenantId:e.tenantId,numberOfUsers:e.numberOfUsers,createdAt:e.createdAt,metadata:e.metadata,children:[],loadMoreLink:null==i?void 0:i.next}))));yield Fi(xa.setSelectedAccountState({accounts:c}))}else{var l;const{accounts:t}=yield cI(),{items:n,_links:a}=yield xi(lp.tenants.searchSubTenants,r),i=yield xi(lp.tenants.getTenantsUsersCount,{tenantIds:n.map((e=>e.tenantId))}),o=lI({items:n},i),s=sI(t,null!=(l=null==e?void 0:e._subTenantId)?l:"",o.map((e=>({name:e.name,tenantId:e.tenantId,numberOfUsers:e.numberOfUsers,createdAt:e.createdAt,metadata:e.metadata,children:[],loadMoreLink:null==a?void 0:a.next}))));yield Fi(xa.setAllAccountsState({accounts:s}))}}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*uI({payload:e}){const t=iI.SEARCH_ACCOUNTS;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{rootAccount:n}=yield cI(),{jwt:a}=e;try{if(null!=e&&e._subTenantId){var i;const{items:t}=yield xi(lp.tenants.searchSubTenants,{_offset:0,_limit:50,_filter:null!=(i=null==e?void 0:e._filter)?i:"",_subTenantId:e._subTenantId},{jwt:a});yield Fi(xa.setAllAccountsState({searchAccountsData:[...t,{name:n.name,tenantId:n.tenantId}]}))}}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*yI({payload:e}){const t=iI.GET_USER_JWT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{tenantId:n,callback:a}=e;try{const e=yield xi(lp.users.GetUserJwt,{tenantId:n});yield Fi(xa.setSelectedAccountState({userJwt:e,accessPermission:!0})),null==a||a(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),yield Fi(xa.setSelectedAccountState({accessPermission:!1})),null==a||a(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*fI({payload:e}){const t=iI.CREATE_SUB_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{name:n,parentTenantId:a,tenantId:i,jwt:o,callback:r}=e;try{if(o){const{accounts:e}=yield cI(),{selectedAccount:t}=yield cI(),r=yield xi(lp.subTenants.createSubTenant,{name:n,parentTenantId:a,tenantId:i},{jwt:o}),s=sI(e,null!=a?a:"",[{name:r.name,tenantId:r.tenantId,numberOfUsers:0,createdAt:new Date}]),l=sI(M({name:"",tenantId:""},null==t?void 0:t.accounts),null!=a?a:"",[{name:r.name,tenantId:r.tenantId,numberOfUsers:0,createdAt:new Date}]);yield Fi(xa.setAllAccountsState({accounts:s})),yield Fi(xa.setSelectedAccountState({accounts:l}))}else{const{accounts:e}=yield cI(),t=yield xi(lp.subTenants.createSubTenant,{name:n,tenantId:i,parentTenantId:a}),o=sI(e,null!=a?a:"",[{name:t.name,tenantId:t.tenantId,numberOfUsers:0,createdAt:new Date}]);yield Fi(xa.setAllAccountsState({accounts:o}))}null==r||r(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==r||r(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*pI({payload:e}){const t=iI.DELETE_SUB_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{jwt:n,tenantId:a,callback:i}=e;try{if(n){const{selectedAccount:e,accounts:t}=yield cI();yield xi(lp.subTenants.deleteSubTenant,a,{jwt:n});const i=rI(t,a),o=rI(null==e?void 0:e.accounts,a);yield Fi(xa.setAllAccountsState({accounts:i})),yield Fi(xa.setSelectedAccountState({accounts:o}))}else{const{accounts:e}=yield cI();yield xi(lp.subTenants.deleteSubTenant,a);const t=rI(e,a);yield Fi(xa.setAllAccountsState({accounts:t}))}null==i||i(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==i||i(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*gI({payload:e}){const t=iI.UPDATE_SUB_ACCOUNT_SETTINGS;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{jwt:n,name:a,callback:i,tenantId:o}=e;try{if(n){const{selectedAccount:e,accounts:t}=yield cI();yield xi(lp.subTenants.updateSubTenant,{tenantId:o},{name:a},{jwt:n});const i=oI(e.accounts,o,a);yield Fi(xa.setSelectedAccountState({name:a,accounts:i}));const r=oI(t,o,a);yield Fi(xa.setAllAccountsState({accounts:r}))}else{const{accounts:e}=yield cI();yield xi(lp.subTenants.updateSubTenant,{tenantId:o},{name:a});const t=oI(e,o,a);yield Fi(xa.setAllAccountsState({accounts:t}))}null==i||i(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==i||i(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*SI({payload:e}){const t=iI.DELETE_USERS_FROM_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{userId:n,subTenants:a,jwt:i,callback:o}=e;try{yield xi(lp.subTenants.removeUserFromTenantAndSubTenants,{userId:n,subTenants:a},{jwt:i}),yield Fi(xa.getAccountUsers({jwt:i,_tenantId:a[0].tenantId})),null==o||o(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==o||o(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*vI({payload:e}){const t=iI.SET_USER_ROLES_FOR_SUB_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{userId:n,subTenantsRoles:a,jwt:i,callback:o}=e,{selectedAccount:r}=yield cI();try{yield xi(lp.subTenants.setUserRolesForSubTenants,n,{subTenantsRoles:a},{jwt:i}),yield Fi(xa.getAccountUsers({jwt:i,_tenantId:r.tenantId})),null==o||o(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==o||o(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*hI({payload:e}){const t=iI.ADD_USERS_TO_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{users:n,tenantId:a,jwt:i,callback:o,allowSubAccountAccess:r=!1,roleIds:s}=e;try{yield xi(lp.subTenants.addUsersToSubTenant,{users:n,tenantId:a,allowSubAccountAccess:r,roleIds:s},{jwt:i}),yield Fi(xa.getAccountUsers({jwt:i,_tenantId:a})),null==o||o(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==o||o(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*mI({payload:e}){const t=iI.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{selectedAccount:n}=yield cI(),{userId:a,allowAccess:i,jwt:o,callback:r}=e;try{var s;yield xi(lp.subTenants.updateSubAccountAccess,a,{allowAccess:i},{jwt:o}),yield Fi(xa.setSelectedAccountState({users:null==n||null==(s=n.users)?void 0:s.map((e=>e.id===a?M({},e,{subAccountAccessAllowed:i}):e))})),null==r||r(!0)}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)})),null==r||r(!1)}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*bI({payload:e}){var t,n,a,i,o,r,s,l;const c=iI.GET_ACCOUNT_USERS;yield Fi(xa.setAllAccountsLoader({key:c,value:!0}));const d=yield cI(),{jwt:u,_tenantId:y,_email:f}=e,p=null!=(t=null!=(n=null==e?void 0:e._offset)?n:null==d||null==(a=d.selectedAccount)||null==(i=a.usersQueryParams)?void 0:i._offset)?t:0,g=null!=(o=null!=(r=null==e?void 0:e._limit)?r:null==d||null==(s=d.selectedAccount)||null==(l=s.usersQueryParams)?void 0:l._limit)?o:10,S=M({_offset:p,_limit:g,_tenantId:y,_includeSubTenants:!1},!!f&&{_email:f});try{const{items:e,_metadata:{totalItems:t,totalPages:n}}=yield xi(lp.users.getUsersV3,S,{jwt:u}),a={totalUsersItems:t,totalUsersPages:n,usersQueryParams:M({_offset:null!=p?p:0,_limit:null!=g?g:10},!!f&&{_email:f})};if(e.length){const t=e.map((e=>e.id)),n=yield xi(lp.roles.getRoles),i=yield xi(lp.users.getUsersRoles,{ids:t},{jwt:u}),o=e.map((e=>{var t,a;const o=null==i||null==(t=i.find((t=>t.userId===e.id)))?void 0:t.roleIds;return M({},e,{roles:null!=(a=null==o?void 0:o.map((e=>{var t;return null!=(t=null==n?void 0:n.find((t=>t.id===e)))?t:[]})))?a:[]})}));yield Fi(xa.setSelectedAccountState(M({users:o},a)))}else yield Fi(xa.setSelectedAccountState(M({users:[]},a)))}catch(e){yield Fi(xa.setAllAccountsError({key:c,value:Og(e)}))}finally{yield Fi(xa.setAllAccountsLoader({key:c,value:!1}))}}function*AI({payload:e}){const t=iI.SET_SELECTED_SUB_ACCOUNT_DATA;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{jwt:n}=e;try{var a,i,o,r,s,l,c;const e=yield xi(lp.accountSettings.getSettings,{jwt:n}),d=yield xi(lp.tenants.getTenantsUsersCount,{tenantIds:[null!=(a=null==e?void 0:e.tenantId)?a:""]},{jwt:n}),u=yield xi(lp.tenants.getParentTenants,{jwt:n}),y=yield xi(lp.tenants.getHierarchyMetadata,{_tenantIds:[null!=(i=null==e?void 0:e.tenantId)?i:""]},{jwt:n});yield Fi(xa.setSelectedAccountState({tenantId:null!=(o=e.tenantId)?o:"",name:e.name,numberOfUsersObject:d[0],parentsAccounts:u,numberOfSubAccounts:null==(r=y[0])?void 0:r.totalSubTenants,accountSettings:e,accounts:{name:e.name,tenantId:null!=(s=e.tenantId)?s:"",numberOfUsers:null==(l=d[0])?void 0:l.totalUsers,createdAt:void 0,children:[]}})),yield Fi(xa.getAccountUsers({jwt:n,_tenantId:null!=(c=null==e?void 0:e.tenantId)?c:""}))}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*TI(){const e=iI.SET_ROOT_ACCOUNT_DATA;yield Fi(xa.setAllAccountsLoader({key:e,value:!0}));const{activeTenant:t}=yield Bi((e=>e.auth.tenantsState)),{accounts:n}=yield cI();if(t)try{var a;const i=yield xi(lp.tenants.getTenantsUsersCount,{tenantIds:[null==t?void 0:t.tenantId]}),o={name:null==t?void 0:t.name,tenantId:null==t?void 0:t.tenantId,numberOfUsers:null==(a=i[0])?void 0:a.totalUsers,createdAt:null==t?void 0:t.createdAt};yield Fi(xa.setAllAccountsState({rootAccount:o,accounts:M({},n,o)}))}catch(t){yield Fi(xa.setAllAccountsError({key:e,value:Og(t)}))}finally{yield Fi(xa.setAllAccountsLoader({key:e,value:!1}))}}function*EI({payload:e}){const t=iI.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT;yield Fi(xa.setAllAccountsLoader({key:t,value:!0}));const{tenantId:n,jwt:a}=e;try{const e=yield xi(lp.tenants.getTenantsUsersCount,{tenantIds:[n]},{jwt:a});yield Fi(xa.setSelectedAccountState({numberOfUsersObject:e[0]}))}catch(e){yield Fi(xa.setAllAccountsError({key:t,value:Og(e)}))}finally{yield Fi(xa.setAllAccountsLoader({key:t,value:!1}))}}function*kI(){yield Fo(xa.loadAccounts,dI),yield Fo(xa.searchAccounts,uI),yield Fo(xa.updateSubAccountAccessForUser,mI),yield Fo(xa.getUserJwtForSubAccount,yI),yield Fo(xa.createSubAccount,fI),yield Fo(xa.deleteSubAccount,pI),yield Fo(xa.updateSubAccountSettings,gI),yield Fo(xa.addUsersToAccount,hI),yield Fo(xa.deleteUsersFromAccount,SI),yield Fo(xa.setUserRolesForSubAccount,vI),yield Fo(xa.getAccountUsers,bI),yield Fo(xa.setRootAccountData,TI),yield Fo(xa.setSelectedSubAccountData,AI),yield Fo(xa.loadNumberOfUsersForSelectedSubAccount,EI)}const II=["callback"],OI=["callback"],PI=["callback","phoneId"],_I=["callback","phoneId"],LI=["callback"];function*wI(){yield Fi(xa.setSmsState({loading:!0}));const e={_limit:10,_offset:0};try{const{items:t}=yield xi(lp.userPhoneNumbers.getUserPhoneNumbers,e);yield Fi(xa.setSmsState({phoneNumbers:t}))}catch(e){yield Fi(xa.setSmsState({error:Og(e)}))}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*DI(e){let{payload:{callback:t}}=e,n=Za(e.payload,II);yield Fi(xa.setSmsState({loading:!0}));try{const e=yield xi(lp.userPhoneNumbers.createPhoneNumber,n);yield Fi(xa.setSmsState({otcToken:e.otcToken})),yield xi(wI),null==t||t(!0)}catch(e){yield Fi(xa.setSmsState({error:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*UI(e){let{payload:{callback:t}}=e,n=Za(e.payload,OI);yield Fi(xa.setSmsState({loading:!0}));try{yield xi(lp.userPhoneNumbers.verifyPhoneNumber,n),yield xi(wI),null==t||t(!0)}catch(e){yield Fi(xa.setSmsState({error:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*RI(e){let{payload:{callback:t,phoneId:n}}=e;Za(e.payload,PI),yield Fi(xa.setSmsState({loading:!0}));try{const e=yield xi(lp.userPhoneNumbers.deletePhoneNumber,n);yield Fi(xa.setSmsState({otcToken:e.otcToken})),null==t||t(!0)}catch(e){yield Fi(xa.setSmsState({error:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*CI(e){let{payload:{callback:t,phoneId:n}}=e,a=Za(e.payload,_I);yield Fi(xa.setSmsState({loading:!0}));try{yield xi(lp.userPhoneNumbers.verifyDeletePhoneNumber,n,a),yield xi(wI),null==t||t(!0)}catch(e){yield Fi(xa.setSmsState({error:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*NI(e){let{payload:{callback:t}}=e,n=Za(e.payload,LI);yield Fi(xa.setSmsState({loading:!0}));try{const e=yield xi(lp.userPhoneNumbers.preVerifyPhoneNumber,n);yield Fi(xa.setSmsState({otcToken:e.otcToken})),null==t||t(!0)}catch(e){yield Fi(xa.setSmsState({error:Og(e)})),null==t||t(null,e)}finally{yield Fi(xa.setSmsState({loading:!1}))}}function*MI(){yield Mo(xa.loadPhoneNumbers,wI),yield Mo(xa.setUpPhoneNumber,DI),yield Mo(xa.verifyPhoneNumber,UI),yield Mo(xa.deletePhoneNumber,RI),yield Mo(xa.verifyDeletePhoneNumber,CI),yield Mo(xa.preVerifyPhoneNumber,NI)}function*FI(e){yield xi(iv,e),yield xi(fv)}function*GI({mfaToken:e,mfaDevices:t}){yield Fi(xa.setStepUpState({mfaDevices:t,mfaToken:e}));const n=yield xi(Eg,t);yield Fi(xa.setMfaState({step:n}))}function*$I(e){if((e=>"MFA is not enrolled"===(null==e?void 0:e.message))(e))return void(yield Fi(xa.setMfaState({step:ln.noMFAEnrolledStepUp})));window.localStorage.setItem(sv,"true");const{routes:t}=yield Bi((e=>e.auth));$o.onRedirectTo(t.logoutUrl,{preserveQueryParams:!0})}function*xI({payload:{maxAge:e,callback:t}}){yield Fi(xa.setStepUpState({mfaDevices:void 0,mfaToken:""}));try{const n=yield xi(lp.auth.generateStepupSession,{maxAge:e});n.user?yield xi(FI,n):yield xi(GI,n),null==t||t(!0)}catch(e){null==t||t(!1),yield xi($I,e)}}function*VI({payload:e}){const t={acr_values:ov},{maxAge:n}=e||{};void 0!==n&&(t.max_age=n.toString());const a=yield Bi((({auth:e})=>{var t,n;return null==(t=e.tenantsState)||null==(n=t.activeTenant)?void 0:n.alias}));a&&(t.organization=a),cv(),window.localStorage.setItem(sv,"true"),yield bh(t)}function*jI({payload:e}){yield hv(e,xa.setStepUpState,!0)}function*BI({payload:e}){yield Dv(e,xa.setStepUpState)}function*WI({payload:e}){yield Uv(e,xa.setStepUpState,!0)}function*zI({payload:e}){yield Iv(e,xa.setStepUpState)}function*KI({payload:e}){yield Ov(e,xa.setStepUpState,!0)}function*HI({payload:e}){yield Gv(e,xa.setStepUpState)}function*qI({payload:e}){yield Fv(e,xa.setStepUpState)}function*JI(){yield Go(xa.stepUpHostedLogin,VI),yield Go(xa.generateStepUpSession,xI),yield Go(xa.stepUpWithAuthenticator,jI),yield Go(xa.preVerifyMFASMSForStepUp,zI),yield Go(xa.verifyMFASMSForStepUp,KI),yield Go(xa.preVerifyMFAWebAuthnForStepUp,BI),yield Go(xa.verifyMFAWebAuthnForStepUp,WI),yield Go(xa.verifyMFAEmailCodeForStepUp,HI),yield Go(xa.preVerifyMFAEmailCodeForStepUp,qI)}const YI={sagas:function*(){yield Gi([xi(Kh),xi(JI),xi(Wb),xi(Kb),xi(Cb),xi(AE),xi(lm),xi(Mm),xi(jm),xi(Mg),xi(bb),xi(nT),xi(Kk),xi(IT),xi(BS),xi(NT),xi(kS),xi(WT),xi(QT),xi(yE),xi(PE),xi(ME),xi(sk),xi(Ik),xi(_k),xi(Dk),xi(kI),xi(tv),xi(qg),xi(MI)])},mockSagas:function*(){yield Gi([xi(Jh),xi(gm),xi(Km),xi(Lb),xi(vT),xi(VT),xi(FS),xi(DE),xi(HT),xi(eE),xi($E),xi(vk),xi(pE),xi(aI),xi(tS)])},storeName:Ut,initialState:Ra,reducer:Ga,actions:xa},XI=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>M({},t,{[e]:M({},t[e],n)})}),QI={loading:!0,pageOffset:0,pageSize:20,logs:[],sort:[],filter:[],totalPages:0,isDownloadingCsv:!1},ZI={setAuditLogsState:XI("auditLogsState"),resetAuditLogsState:e=>M({},e,{auditLogsState:QI})},eO={exportAuditsCsv:dt("auditLogs/exportAuditsCsv"),loadAuditLogs:dt("auditLogs/loadAuditLogs",(e=>({payload:e})))},tO={loading:!0},nO={setAuditsMetadataState:XI("auditsMetadataState"),resetAuditsMetadataState:e=>M({},e,{auditsMetadataState:tO})},aO={loadAuditsMetadata:dt("auditLogs/loadAuditsMetadata")},iO={auditLogsState:QI,auditsMetadataState:tO},{reducer:oO,actions:rO}=yt({name:Ct,initialState:iO,reducers:M({resetState:e=>M({},e,iO),setState:(e,{payload:t})=>M({},e,t)},ZI,nO)}),sO=M({},rO,eO,aO),lO=e=>"createdAt"!==e.id,cO={total:20,data:Array.from(Array(5).keys()).map((e=>M({ip:"198.143.51.1",user:"Demo User Name",email:"demo-user@frontegg.com"},(()=>{switch(Math.floor(6*Math.random())){case 0:return{action:"Updated profile",description:"User updated profile details",severity:"Info"};case 1:return{action:"User logged in",severity:"Info",description:"User logged in to the product"};case 2:return{action:"User failed to login",severity:"High",description:"User failed to login with password"};case 3:return{action:"Added user",severity:"Info",description:"Added user david+535@frontegg.com to tenant"};case 4:return{action:"Assigned roles",severity:"Info",description:"Assigned 0 roles for user"};case 5:return{action:"Removed user david+108@frontegg.com from account",severity:"Info",description:"Removed access from the account for user david+108@frontegg.com"}}})(),{json:{key1:"value1",key2:"value2",key3:"value3",key4:"value4"},tenantId:"my-tenant-id",vendorId:"my-vendor-id",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",createdAt:`2022-04-07 10:${50-e}:40.201`})))},dO={properties:[{showInTable:!0,name:"createdAt",displayName:"Time",type:"Timestamp",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!1},{showInTable:!0,name:"email",displayName:"User",type:"Email",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"action",displayName:"Action",type:"AlphaNumeric",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!0,name:"description",type:"AlphaNumeric",sortable:!1,filterable:!1,displayName:"Description",isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"ip",displayName:"IP Address",type:"IpAddress",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"severity",displayName:"Severity",type:"Severity",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"userAgent",displayName:"User Agent",type:"AlphaNumeric",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!1,name:"json",type:"Json",sortable:!0,filterable:!0,displayName:"Json Data",showInMoreInfo:"Always",isPredefined:!1}]},uO=()=>Bi((e=>e.auditLogs.auditLogsState)),yO=()=>Bi((e=>e.auditLogs.auditsMetadataState));function*fO(){const e=yield uO(),{columns:t}=yield yO();try{const n=e.filter,a=e.sort.reduce(((e,t)=>M({},e,{sortBy:t.id,sortDirection:t.desc?"desc":"asc"})),{}),i=n.reduce(((e,t)=>M({},e,{[t.id]:t.value})),{});yield Fi(sO.setAuditLogsState({isDownloadingCsv:!0}));const o="audits.csv";yield lp.audits.exportAudits(M({endpoint:"csv/v2",headerProps:t,offset:0,outputFileName:o},a,i))}catch(e){console.error("failed to export audits - ",e)}yield Fi(sO.setAuditLogsState({isDownloadingCsv:!1}))}function*pO({payload:e}){yield Fi(sO.setAuditLogsState({loading:!(null!=e&&e.silentLoading),error:null}));const t=yield uO(),{columns:n}=yield yO();try{var a,i,o,r,s;const l=null!=(a=e.pageSize)?a:t.pageSize,c=null!=(i=e.pageOffset)?i:t.pageOffset,d=null!=(o=e.filter)?o:t.filter,u=null!=(r=e.sort)?r:t.sort;yield Fi(sO.setAuditLogsState({pageSize:l,pageOffset:c,filter:d,sort:u}));const y=u.reduce(((e,t)=>M({},e,{sortBy:t.id,sortDirection:t.desc?"desc":"asc"})),{}),f=d.reduce(((e,t)=>M({},e,{[t.id]:t.value})),{});n||(yield Fi(sO.loadAuditsMetadata()));const{data:p,total:g}=yield xi(lp.audits.getAudits,M({offset:c,count:l},y,f));yield Fi(sO.setAuditLogsState({loading:!1,logs:null!=p?p:[],totalPages:+Math.ceil(g/l)})),null==e||null==(s=e.callback)||s.call(e,!0)}catch(t){var l;yield Fi(sO.setAuditLogsState({loading:!1,error:Og(t)})),null==e||null==(l=e.callback)||l.call(e,null,t)}}function*gO(){yield Mo(sO.exportAuditsCsv,fO),yield Mo(sO.loadAuditLogs,pO)}function*SO({payload:e}){yield Fi(sO.setAuditLogsState({loading:!(null!=e&&e.silentLoading),error:null}));const t=yield uO(),{columns:n}=yield yO();try{var a,i,o,r,s;const l=null!=(a=e.pageSize)?a:t.pageSize,c=null!=(i=e.pageOffset)?i:t.pageOffset,d=null!=(o=e.filter)?o:t.filter,u=null!=(r=e.sort)?r:t.sort;yield Fi(sO.setAuditLogsState({pageSize:l,pageOffset:c,filter:d,sort:u})),n||(yield Fi(sO.loadAuditsMetadata()));const{data:y,total:f}=((e,t)=>{const{data:n}=cO;let a=n.filter((e=>t=>e.filter(lO).every((e=>t[e.id].includes(e.value))))(e));if(t.length){const{id:e,desc:n=!1}=t[0];a=a.sort(((e,t)=>(n,a)=>n[e]>a[e]?t?-1:1:a[e]>n[e]?t?1:-1:0)(e,n))}return{data:a,total:a.length}})(d,u);yield Fi(sO.setAuditLogsState({loading:!1,logs:null!=y?y:[],totalPages:+Math.ceil(f/l)})),null==e||null==(s=e.callback)||s.call(e,!0)}catch(t){var l;yield Fi(sO.setAuditLogsState({loading:!1,error:Og(t)})),null==e||null==(l=e.callback)||l.call(e,null,t)}}function*vO(){yield Mo(sO.loadAuditLogs,SO)}function*hO(){yield Fi(sO.setAuditsMetadataState({loading:!0,error:null}));try{const{properties:e}=yield xi(lp.metadata.getAuditsMetadata);yield Fi(sO.setAuditsMetadataState({columns:e,loading:!1}))}catch(e){yield Fi(sO.setAuditsMetadataState({error:e,loading:!1}))}}function*mO(){yield Mo(sO.loadAuditsMetadata,hO)}function*bO(){yield Fi(sO.setAuditsMetadataState({loading:!0,error:null}));try{const{properties:e}=dO;yield Fi(sO.setAuditsMetadataState({columns:e,loading:!1}))}catch(e){yield Fi(sO.setAuditsMetadataState({error:e,loading:!1}))}}function*AO(){yield Mo(sO.loadAuditsMetadata,bO)}const TO={sagas:function*(){yield Gi([xi(gO),xi(mO)])},mockSagas:function*(){yield Gi([xi(vO),xi(AO)])},storeName:Ct,initialState:iO,reducer:oO,actions:sO},EO={total:0,offset:0,filter:"",sortBy:"createdAt",context:null,filters:[],rowsData:[],lastUpdated:new Date,isLoading:!0,isFetchMore:!1,totalToday:0,currentPage:0,headerProps:[],sortDirection:"desc",severeThisWeek:0,predefinedFilters:[],isDownloadingCsv:!1,virtualScroll:!1},{name:kO,actions:IO,reducer:OO}=yt({name:"audits",initialState:EO,reducers:{setContext:(e,{payload:t})=>{e.context=t},startLoading:e=>{e.isLoading=!0},setVirtualScroll:(e,{payload:t})=>{e.virtualScroll=t},startRefresh:e=>{e.isLoading=!0},startFetching:e=>{e.isFetchMore=!0},finishLoading:e=>{e.isLoading=!1},startDownloadingCsv:e=>{e.isDownloadingCsv=!0},stopDownloadingCsv:e=>{e.isDownloadingCsv=!1},loadStatsSuccess:(e,{payload:t})=>{e.error=void 0,e.totalToday=t.totalToday,e.severeThisWeek=t.severeThisWeek},loadItemFailedAction:(e,{payload:t})=>{e.error=M({},e.error,{[t.name]:t.error})},loadMetadataSuccess:(e,{payload:t})=>{e.error={},e.headerProps=t.properties,e.themeAudits=t.theme?t.theme.styles:{}},loadAuditsSuccess:(e,{payload:t})=>{e.error={},e.rowsData=t.rowsData,e.lastUpdated=new Date,e.total=t.total},fetchMoreSuccess:(e,{payload:t})=>{e.error={},e.offset=t.offset,e.currentPage=t.currentPage,e.isFetchMore=!1},setFilterData:(e,{payload:t})=>{e.filters=t,e.currentPage=0,e.offset=0,e.isLoading=!0},textSearch:(e,{payload:t})=>{e.filter=t,e.currentPage=0,e.offset=0,e.isLoading=!0},onPageChange:(e,{payload:t})=>{e.currentPage=t-1,e.offset=20*e.currentPage,e.isLoading=!0},setDataSorting:(e,{payload:t})=>{e.sortBy=t.sortBy,e.currentPage=0,e.sortDirection="asc"===t.sortDirection?"desc":"asc",e.offset=0,e.isLoading=!0},setPredefinedFilters:(e,{payload:t})=>{e.predefinedFilters=t,e.filters=Object.keys(t).map((e=>({key:e,value:t[e]})))}}}),PO=M({},IO,{initData:dt(`${kO}/initData`),loadAudits:dt(`${kO}/loadAudits`),removeFilter:dt(`${kO}/removeFilter`),filterData:dt(`${kO}/filterData`),exportCSV:dt(`${kO}/exportCSV`),deleteAudits:dt(`${kO}/deleteAudits`)}),_O=()=>Bi((e=>e[kO]));function*LO(){const{sortBy:e,sortDirection:t}=yield _O();try{const n=yield xi(lp.audits.getAuditsStats,{sortBy:e,sortDirection:t,count:20});yield Fi(PO.loadStatsSuccess(n))}catch(e){const t={name:"stats",error:e};console.error("failed to load stats - ",e),yield Fi(PO.loadItemFailedAction(t))}}function*wO(){try{const e=yield xi(lp.metadata.getAuditsMetadata);yield Fi(PO.loadMetadataSuccess(e))}catch(e){const t={name:"metadata",error:e};console.error("failed to load metadata - ",e),yield Fi(PO.loadItemFailedAction(t))}}const DO=e=>e.reduce(((e,t)=>(e[t.key]=t.value,e)),{});function*UO({payload:e}){const{filters:t,sortBy:n,sortDirection:a,filter:i,offset:o,virtualScroll:r}=yield _O(),{appendMode:s=r,onlyOneLoad:l=!0,offset:c}=e||{},{rowsData:d}=s?yield _O():{rowsData:[]};try{const e=DO(t),{data:s,total:u}=yield xi(lp.audits.getAudits,M({},r&&{paginationMode:"virtual"},{sortDirection:a,sortBy:n,filter:i},e,{offset:r?d.length+c||d.length+o:c||o,count:20}));yield Fi(PO.loadAuditsSuccess({rowsData:[...d,...s],total:u})),l&&(yield Fi(PO.finishLoading()))}catch(e){const t={name:"audits",error:e};console.error("failed to load audits - ",e),yield Fi(PO.loadItemFailedAction(t))}}function*RO(){yield Fi(PO.startLoading()),yield Gi([LO(),wO(),UO({payload:{onlyOneLoad:!1},type:""})]),yield Fi(PO.finishLoading())}function*CO({payload:e}){const{filters:t}=yield _O(),n=t.findIndex((t=>t.key===e.key));if(n<0)return;const a=[...t.slice(0,n),...t.slice(n+1)];yield Fi(PO.setFilterData(a))}function*NO({payload:e}){const{filters:t}=yield _O();let n=t.findIndex((t=>t.key===e.key));n<0&&(n=t.length);const a=[...t.slice(0,n),e,...t.slice(n+1)];yield Fi(PO.setFilterData(a))}function*MO(){const{filters:e,sortBy:t,sortDirection:n,filter:a,headerProps:i}=yield _O(),o=DO(e);yield Fi(PO.startDownloadingCsv());try{yield lp.audits.exportAudits(M({endpoint:"csv/v2",headerProps:i,sortDirection:n,sortBy:t,filter:a},o,{offset:0,outputFileName:"audits.csv"}))}catch(e){console.error("failed to export audits - ",e)}finally{yield Fi(PO.stopDownloadingCsv())}}function*FO(){yield Fo(PO.initData,RO),yield Fo(PO.removeFilter,CO),yield Fo(PO.filterData,NO),yield Fo([PO.loadAudits,PO.textSearch,PO.onPageChange],UO),yield Fo([PO.setFilterData,PO.setDataSorting,PO.startRefresh],(()=>UO({payload:{appendMode:!1},type:""}))),yield Fo(PO.exportCSV,MO)}const GO={isLoading:!1,isSaving:!1,list:[],processIds:[],slackChannels:{isLoading:!1}},$O={initData:()=>M({},GO),setConnectivityState:(e,{payload:t})=>M({},e,t),cleanWebhookTestData:e=>M({},e,{testResult:void 0}),cleanWebhookLogsData:e=>M({},e,{webhookLogs:void 0}),cleanWebhookTestMessage:e=>{var t;return M({},e,{testResult:{status:null==(t=e.testResult)?void 0:t.status,message:void 0}})},cleanError:e=>M({},e,{error:void 0}),cleanSlackData:e=>M({},e,{slackChannels:{isLoading:!1}}),postWebhookRetryAction:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>M({},e,{retryResult:M({},e.retryResult,{[t]:{isProcess:!0,success:!1}})})},postWebhookRetryResult:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>M({},e,{retryResult:M({},e.retryResult,t)})}},xO={loadSlackActions:dt("connectivity/loadSlackActions"),loadDataAction:dt("connectivity/loadDataAction",(e=>({payload:e}))),postDataAction:dt("connectivity/postDataAction",(e=>({payload:e}))),postCodeAction:dt("connectivity/postCodeAction",(e=>({payload:e}))),loadScope:dt("connectivity/loadScope"),deleteWebhookConfigAction:dt("connectivity/deleteWebhookConfigAction",(e=>({payload:e}))),postWebhookTestAction:dt("connectivity/postWebhookTestAction",(e=>({payload:e}))),loadWebhookLogsAction:dt("connectivity/loadWebhookLogsAction",((e,t=0,n=10)=>({payload:{id:e,offset:t,limit:n}})))},VO={isLoading:!1,isSaving:!1,list:[],processIds:[],slackChannels:{isLoading:!1}},{reducer:jO,actions:BO}=yt({name:Rt,initialState:VO,reducers:M({},$O)}),WO=M({},BO,xO),zO={slack:lp.connectivity.getSlackConfiguration,email:lp.connectivity.getEmailConfiguration,sms:lp.connectivity.getSMSConfiguration,webhook:lp.connectivity.getWebhooksConfigurations,categories:lp.connectivity.getCategories,channelMap:lp.connectivity.getChannelMaps},KO={slack:lp.connectivity.postSlackConfiguration,email:lp.connectivity.postEmailConfiguration,sms:lp.connectivity.postSMSConfiguration,webhook:lp.connectivity.postWebhooksConfiguration},HO=["email","slack","sms","webhook"],qO={sms:{title:"connectivity.sms",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({enabled:e})=>e)))&&t},image:"sms"},email:{title:"common.email",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({enabled:e})=>e)))&&t},image:"email"},slack:{title:"connectivity.slack",events:e=>{var t;return(null==e||null==(t=e.slackSubscriptions)?void 0:t.length)||0},isActive:e=>{var t;return null!=(t=!(null==e||!e.slackSubscriptions.some((({isActive:e})=>e))))&&t},image:"slack"},webhook:{title:"connectivity.webhook",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({isActive:e})=>e)))&&t},image:"webhook"}},JO=["id"],YO=["id","enabled"],XO=["categories","channelMap"];function*QO(e){return yield xi(eP,{payload:{api:e},type:""})}function*ZO({payload:e=HO}){yield Fi(WO.setConnectivityState({isLoading:!0}));try{const t=yield Gi([...e.map(QO),yield eP({payload:{api:"categories"},type:""}),yield function*(){return(yield Gi(e.map((function*(e){return yield eP({payload:{api:"channelMap",params:e},type:""})})))).reduce(((t,n,a)=>M({},t,{[`${e[a]}`]:n})),{})}()]),n=yield eP({payload:{api:"webhook"},type:""}),a=t.reduce(((n,a,i)=>e[i]?t[t.length-1][e[i]].length?M({},n,{[`${e[i]}`]:a,list:[...n.list,{id:i,key:e[i],events:qO[e[i]].events(a),active:qO[e[i]].isActive(a),platform:qO[e[i]].title,image:qO[e[i]].image}]}):n:M({},n,{[`${XO[i-e.length]}`]:a})),{list:[],webhook:n});yield Fi(WO.setConnectivityState(M({},a,{error:void 0,isSaving:!1,isLoading:!1})))}catch(e){yield Fi(WO.setConnectivityState({isLoading:!1}))}}function*eP({payload:{api:e,params:t}}){try{return yield xi(zO[e],t)}catch(e){return}}function*tP(){try{yield Fi(WO.setConnectivityState({slackChannels:{isLoading:!0}}));const e=yield xi(lp.connectivity.getSlackChannels);yield Fi(WO.setConnectivityState({error:void 0,slackChannels:{isLoading:!1,data:e}}))}catch(e){yield Fi(WO.setConnectivityState({error:void 0,slackChannels:{isLoading:!1}}))}}function*nP(e,t){const{connectivity:{list:n}}=yield Bi(),a=n.find((({key:t})=>t===e));if(!a)return;const i=qO[e].isActive(t);i!==a.active&&(yield Fi(WO.setConnectivityState({list:n.map((t=>t.key===e?M({},t,{active:i}):t))})))}function*aP({payload:{platform:e,data:t,callback:n}}){const{processIds:a}=yield Bi((e=>e.connectivity));try{if(yield Fi(WO.setConnectivityState({isSaving:!0,processIds:"webhook"===e?[t._id,...a]:a})),"slack"===e?yield function*({payload:e}){const{connectivity:{slack:t}}=yield Bi();if(!t)return;const{slackSubscriptions:n}=t,{slackSubscriptions:a}=e;yield Gi([...a.reduce(((e,t)=>{var a,i;return!t.id&&t.slackEvents&&null!=(a=t.slackEvents[0].channelIds)&&a.length||(null==n?void 0:n.find((e=>{let{id:n}=e,a=Za(e,JO);return n===t.id&&JSON.stringify(M({id:n},a))!==JSON.stringify(t)})))&&t.slackEvents&&null!=(i=t.slackEvents[0].channelIds)&&i.length?[...e,t]:e}),[]).map((function*(e){return yield xi(KO.slack,e)})),...a.reduce(((e,t)=>t.id&&!t.slackEvents[0].channelIds.length?[...e,t]:e),[]).map((function*(e){return yield xi(lp.connectivity.deleteSlackConfiguration,e)}))])}({payload:t,type:""}):["sms","email"].includes(e)?yield function*({payload:e,type:t}){const{connectivity:n}=yield Bi(),{processIds:a}=yield Bi((e=>e.connectivity)),i=n[t];if(!i)return;let o=[];try{o=yield Gi([...e.reduce(((e,t)=>!i.find((({eventKey:e})=>e===t.eventKey))&&t.subscriptions[0].recipients.filter((e=>e)).length?[...e,t]:e),[]).map((function*(e){return yield xi("email"===t?lp.connectivity.postEmailConfiguration:lp.connectivity.postSMSConfiguration,e)})),...e.reduce(((e,t)=>{const n=i.find((({eventKey:e})=>e===t.eventKey));return n&&JSON.stringify(n)!==JSON.stringify(t)?[...e,t]:e}),[]).map((function*(e){const{subscriptions:n,eventKey:a}=e,i=n[0],{id:o="",enabled:r}=i,s=Za(i,YO);return yield Gi([yield xi("email"===t?lp.connectivity.patchEmailConfiguration:lp.connectivity.patchSMSConfiguration,{eventKey:a,enabled:r}),yield xi("email"===t?lp.connectivity.putEmailSubscriptions:lp.connectivity.putSMSSubscriptions,o,a,M({},s,{enabled:r}))])})),...e.reduce(((e,t)=>{const n=i.find((({eventKey:e})=>e===t.eventKey));return n&&n.subscriptions[0].recipients.length&&!t.subscriptions[0].recipients.filter((e=>!!e)).length?[...e,t]:e}),[]).map((function*({eventKey:e,subscriptions:n}){return xi("email"===t?lp.connectivity.deleteEmailSubscriptions:lp.connectivity.deleteSMSSubscriptions,e,n[0].id||"")}))])}catch{}if(o.length){const e=yield eP({payload:{api:t},type:""});yield Fi(WO.setConnectivityState({error:void 0,isSaving:!1,[`${t}`]:e,processIds:e.id?a.filter((t=>t!==e.id)):a})),yield nP(t,e)}else yield Fi(WO.setConnectivityState({error:void 0,isSaving:!1,[`${t}`]:i,processIds:a}))}({payload:t,type:e}):yield xi(KO[e],t),!["sms","email"].includes(e)){const i=yield eP({payload:{api:e},type:""});"webhook"===e&&(i.id=t._id),yield Fi(WO.setConnectivityState({error:void 0,isSaving:!1,[`${e}`]:i,processIds:i.id?a.filter((e=>e!==i.id)):a})),yield nP(e,i),null==n||n(!0)}}catch(e){yield Fi(WO.setConnectivityState({error:Og(e,e.toString()),isSaving:!1,isLoading:!1}))}}function*iP({payload:e}){try{yield lp.connectivity.postSlackCode(e)}catch{}yield Fi(WO.setConnectivityState({error:void 0,isSaving:!1}))}function*oP(){const{slackChannels:e}=yield Bi((e=>e.connectivity));try{yield Fi(WO.setConnectivityState({slackChannels:M({},e,{isLoadingScope:!0})}));const{clientId:t}=yield xi(lp.connectivity.getSlackScope);yield Fi(WO.setConnectivityState({slackChannels:{error:void 0,clientId:t,isLoadingScope:!1,isLoading:!1}}))}catch{yield Fi(WO.setConnectivityState({slackChannels:{error:void 0,isLoadingScope:!1,isLoading:!1}}))}}function*rP({payload:e}){const{callback:t,webhookId:n}=e,{processIds:a}=yield Bi((e=>e.connectivity));try{yield Fi(WO.setConnectivityState({isSaving:!0})),yield xi(lp.connectivity.deleteWebhooksConfiguration,n)}catch(e){null==t||t(null,Og(e))}const i=yield eP({payload:{api:"webhook"},type:""});i&&(yield Fi(WO.setConnectivityState({error:void 0,isSaving:!1,webhook:i,processIds:i.id?a.filter((e=>e!==i.id)):a}))),null==t||t(!0)}function*sP({payload:e}){try{yield Fi(WO.setConnectivityState({isTesting:!0}));const{statusCode:t,body:n}=yield xi(lp.connectivity.postWebhookTest,e);if([201,200].includes(t)){const e=JSON.stringify(n,null,2);yield Fi(WO.setConnectivityState({isTesting:!1,testResult:{status:"success",message:e}}))}else yield Fi(WO.setConnectivityState({isTesting:!1,testResult:{status:"failed"}}))}catch(e){yield Fi(WO.setConnectivityState({isTesting:!1,testResult:{status:"failed",message:e.toString()}}))}}function*lP({payload:e}){try{const{statusCode:t}=yield xi(lp.connectivity.postWebhookRetry,e);yield Fi(WO.postWebhookRetryResult({[e]:{isProcess:!1,success:202===t}}))}catch(t){yield Fi(WO.postWebhookRetryResult({[e]:{isProcess:!1,success:!1}}))}}function*cP({payload:{id:e,limit:t,offset:n}}){const{webhookLogs:a}=yield Bi((e=>e.connectivity));try{yield Fi(WO.setConnectivityState({webhookLogs:M({},a,{isLoading:!0})}));const i=yield xi(lp.connectivity.getWebhookLog,e,n,t);yield Fi(WO.setConnectivityState({error:void 0,webhookLogs:M({isLoading:!1},i)}))}catch(e){yield Fi(WO.setConnectivityState({error:void 0,webhookLogs:{isLoading:!1}}))}}const dP={sagas:function*(){yield Mo(WO.loadDataAction,ZO),yield Fo(WO.loadSlackActions,tP),yield Mo(WO.postDataAction,aP),yield Mo(WO.postCodeAction,iP),yield Mo(WO.loadScope,oP),yield Mo(WO.deleteWebhookConfigAction,rP),yield Mo(WO.postWebhookTestAction,sP),yield Mo(WO.postWebhookRetryAction,lP),yield Fo(WO.loadWebhookLogsAction,cP)},storeName:Rt,initialState:VO,reducer:jO,actions:WO};function uP(){return{setLoading:{prepare:e=>({payload:e}),reducer:(e,t)=>M({},e,{loading:t.payload},t.payload?{error:null}:{})},setError:{prepare:e=>({payload:e}),reducer:(e,t)=>M({},e,{error:t.payload,loading:!1,fetching:!1})},setState:{prepare:e=>({payload:e}),reducer:(e,t)=>M({},e,t.payload)}}}function yP(e,t){return{prepare:e=>({payload:e}),reducer:(n,a)=>M({},n,{[e]:t(n[e],a)})}}function fP(e){return yP(e,((e,t)=>M({},e,{loading:t.payload})))}function pP(e){return yP(e,((e,t)=>M({},e,{error:t.payload,loading:!1})))}const gP={loading:!1,error:null,fetching:!0,plans:[]},{actions:SP,reducer:vP,name:hP}=yt({name:"subscriptions/plans",initialState:gP,reducers:M({},uP())}),mP=M({loadPlans:dt(`${hP}/loadPlans`)},SP),bP={loading:!1,error:null,fetching:!0,config:null},AP=M({},uP()),{actions:TP,reducer:EP,name:kP}=yt({name:"subscriptions/config",initialState:bP,reducers:AP}),IP=M({loadPaymentConfiguration:dt(`${kP}/loadPaymentConfiguration`)},TP),OP={loading:!1,error:null,fetching:!0,cancellation:{loading:!1,error:null},renewal:{loading:!1,error:null}},PP=M({},uP(),{setCancellationLoading:fP("cancellation"),setCancellationError:pP("cancellation"),setRenewalLoading:fP("renewal"),setRenewalError:pP("renewal")}),{reducer:_P,actions:LP,name:wP}=yt({name:"subscriptions/billing/subscription",initialState:OP,reducers:PP}),DP=M({load:dt(`${wP}/loadSubscription`),cancelSubscription:dt(`${wP}/cancelSubscription`),renewSubscription:dt(`${wP}/renewSubscription`)},LP),UP={loading:!1,error:null,fetching:!0},RP=M({},uP()),{reducer:CP,actions:NP,name:MP}=yt({name:"subscriptions/billing/information",initialState:UP,reducers:RP}),FP=M({loadBillingInformation:dt(`${MP}/loadBillingInformation`),cancelSubscription:DP.cancelSubscription,renewSubscription:DP.renewSubscription},NP),GP={loading:!1,error:null,fetching:!0},$P=M({},uP(),{setState:{prepare:e=>({payload:e}),reducer:(e,t)=>M({},e,t.payload)}}),{reducer:xP,actions:VP,name:jP}=yt({name:"subscriptions/billing/payment",initialState:GP,reducers:$P}),BP=M({loadPaymentMethod:dt(`${jP}/loadPaymentMethod`),submitPaymentMethod:dt(`${jP}/submitPaymentMethod`),submitPaymentMethodError:dt(`${jP}/submitPaymentMethodError`),submitPaymentMethodSuccess:dt(`${jP}/submitPaymentMethodSuccess`),updatePaymentMethodBillingDetails:dt(`${jP}/updateBillingDetails`,(e=>({payload:e})))},VP),WP={loading:!1,error:null,fetching:!0,invoices:[],invoiceDownload:{loading:!1,error:null}},zP=M({},uP(),{setInvoiceDownloadState:{prepare:e=>({payload:e}),reducer:(e,t)=>M({},e,{invoiceDownload:M({},e.invoiceDownload,t.payload)})}}),{reducer:KP,actions:HP,name:qP}=yt({name:"subscriptions/billing/invoices",initialState:WP,reducers:zP}),JP=M({loadInvoices:dt(`${qP}/loadInvoices`),downloadInvoice:dt(`${qP}/downloadInvoice`,(e=>({payload:e})))},HP),YP={information:UP,invoices:WP,paymentMethod:GP,subscription:OP},XP={invoices:JP,information:FP,paymentMethod:BP,subscription:DP},QP=We({invoices:KP,information:CP,paymentMethod:xP,subscription:_P}),ZP={fetching:!0,loading:!1,error:null,confirmed:!1},e_=M({},uP()),{actions:t_,reducer:n_,name:a_}=yt({name:"subscriptions/checkout",initialState:ZP,reducers:e_}),i_=M({loadCheckout:dt(`${a_}/loadCheckout`),resetCheckout:dt(`${a_}/resetCheckout`),submitCheckout:dt(`${a_}/submitCheckout`),confirmCheckout:dt(`${a_}/confirmCheckout`,(e=>({payload:e}))),errorCheckout:dt(`${a_}/errorCheckout`,(e=>({payload:e})))},t_),o_={loading:!1,error:null,cardSetupIntentSecret:null},r_=M({},uP()),{reducer:s_,actions:l_,name:c_}=yt({name:"subscriptions/stripe",initialState:o_,reducers:r_}),d_=M({loadCustomer:dt(`${c_}/loadCustomer`),createCardSetupIntentSecret:dt(`${c_}/createCardSetupIntentSecret`)},l_),u_={loading:!1,fetching:!0,vendorPublicConfig:null},{actions:y_,reducer:f_,name:p_}=yt({name:"subscriptions/vendorPublicConfig",initialState:u_,reducers:M({},uP())}),g_=M({loadVendorPublicConfiguration:dt(`${p_}/loadVendorPublicConfiguration`)},y_),S_={config:bP,plans:gP,checkout:ZP,billing:YP,stripe:o_,vendorPublicConfig:u_},v_={config:IP,billing:XP,plans:mP,checkout:i_,stripe:d_,vendorPublicConfig:g_},h_=We({config:EP,billing:QP,plans:vP,checkout:n_,stripe:s_,vendorPublicConfig:f_});let m_,b_,A_;function T_({policy:e}){return{policy:A_.AT_PERIOD_END}}function E_(e){switch(e){case Qy.ACTIVE:return b_.ACTIVE;case Qy.INCOMPLETE:return b_.INCOMPLETE;case Qy.CANCELED:return b_.CANCELED;case Qy.EXPIRED:return b_.EXPIRED;case Qy.TRIALING:return b_.TRIALING;default:return b_.EXPIRED}}!function(e){e.STRIPE="Stripe"}(m_||(m_={})),function(e){e.ACTIVE="ACTIVE",e.CANCELED="CANCELED",e.INCOMPLETE="INCOMPLETE",e.EXPIRED="EXPIRED",e.TRIALING="TRIALING"}(b_||(b_={})),function(e){e.AT_PERIOD_END="atPeriodEnd"}(A_||(A_={}));const k_={id:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",externalId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",startDate:"2021-09-20T08:08:51.000Z",status:Qy.ACTIVE,externallyManaged:!1,cancellation:null,currentPeriodStart:"2021-09-20T08:08:51.000Z",currentPeriodEnd:"2021-10-20T08:08:51.000Z",plan:{slug:"test"}},I_=[{id:"prod_J60fUEvI7qV1eL",externalId:"prod_J60fUEvI7qV1eL",name:"Premium",description:"",price:{id:"price_1IToe8Ewsu4qiqnndAV76J69",externalId:"price_1IToe8Ewsu4qiqnndAV76J69",currency:"usd",amount:1e4},slug:"premium"},{id:"prod_J60duauCpXfcur",externalId:"prod_J60duauCpXfcur",name:"Free",description:"Totally free plan. Nothing to pay.",price:{id:"price_1ITocfEwsu4qiqnnnBHDx9fQ",externalId:"price_1ITocfEwsu4qiqnnnBHDx9fQ",currency:"usd",amount:0},slug:"free"}],O_=[{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-09-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""},{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-08-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""}],P_=[{id:"id",externalId:"externalId",type:Zy.CARD,isDefault:!0,last4:"4242",expMonth:11,expYear:25,brand:"visa",billingDetails:{name:"Dummy",email:"dummy@email.com"}}],__={allowPlanDowngrade:!0,allowPlanCancellation:!0};function*L_(){yield Fi(DP.setLoading(!0));try{const[e]=yield xi(lp.subscriptions.getManagedSubscriptions);yield Fi(DP.setState({subscription:e,fetching:!1,loading:!1,error:null}))}catch(e){yield Fi(DP.setError(e))}}function*w_(){yield Mo(FP.loadBillingInformation,D_)}function*D_(){yield function*(e){const t=yield Bi((e=>{var t;return null==(t=e.subscriptions.config.config)?void 0:t.paymentProvider})),n=yield Bi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));t&&n?yield U_(n,!1):yield Fi(FP.setError(t?"Not authorized":"Internal feature failure"))}()}function*U_(e,t){yield Fi(FP.setLoading(!0));try{var n,a;const i=yield xi(lp.subscriptions.getSubscriptionSummaries,e),{currentPlanId:o,externallyManaged:r}=i;let s,l=null;r?s=yield xi(lp.subscriptions.getSubscriptionPlan,o):([,s]=yield Gi([xi(L_),xi(lp.subscriptions.getSubscriptionPlan,o)]),l=yield Bi((e=>e.subscriptions.billing.subscription.subscription||null))),yield Fi(FP.setState(M({loading:!1,fetching:!1,summary:i},l?{subscription:{id:l.id,externalId:l.externalId,startDate:l.startDate,currentPeriodStart:l.currentPeriodStart,currentPeriodEnd:l.currentPeriodEnd,status:t?b_.ACTIVE:E_(l.status),cancellation:l.cancellation&&T_(l.cancellation),trialEnd:l.trialEnd?l.trialEnd:null}}:{},s?{plan:{id:s.id,name:s.name,description:s.description,price:(null==(n=s.price)?void 0:n.amount)||0,currency:(null==(a=s.price)?void 0:a.currency)||"usd",recurringInterval:"month",slug:s.slug}}:{})))}catch(e){yield Fi(FP.setError(Og(e)))}}function*R_(){yield function*(){var e,t;yield Fi(FP.setLoading(!0)),yield Wi(500),yield Fi(FP.setState({loading:!1,fetching:!1,summary:{subscriptionId:k_.id,paymentMethodId:"mockPaymentMethodId",tenantConfigurationId:"mockTenantConfigurationId",providerType:tf.Stripe,externallyManaged:!1,currentPlanId:I_[0].id,defaultPlanId:I_[0].id},plan:M({},I_[0],{price:null==(e=I_[0].price)?void 0:e.amount,currency:null==(t=I_[0].price)?void 0:t.currency,recurringInterval:"month"})}))}()}function*C_(){yield Mo(FP.loadBillingInformation,R_)}function*N_(){yield Mo(BP.loadPaymentMethod,M_),yield Mo(BP.submitPaymentMethod,G_),yield Mo(BP.submitPaymentMethodError,$_),yield Mo(BP.submitPaymentMethodSuccess,x_),yield Mo(BP.updatePaymentMethodBillingDetails,F_)}function*M_(){yield Fi(BP.setLoading(!0));try{const e=(yield xi(lp.subscriptions.getPaymentMethods))[0];yield Fi(BP.setState({paymentMethod:e,loading:!1,fetching:!1}))}catch(e){yield Fi(BP.setError(Og(e)))}}function*F_({payload:e}){yield Fi(BP.setLoading(!0));const{id:t,email:n,address:a,callback:i}=e;try{yield xi(lp.subscriptions.updatePaymentMethodBillingDetails,t,M({email:n},a)),yield xi(M_),null==i||i(!0)}catch(e){yield Fi(BP.setError(Og(e))),null==i||i(!1)}yield Fi(BP.setLoading(!1))}function*G_(){yield Fi(BP.setLoading(!0))}function*$_({payload:e}){yield Fi(BP.setError(e))}function*x_(){yield Fi(BP.loadPaymentMethod())}function*V_(){yield Fi(BP.setLoading(!0)),yield Wi(500);const e=P_[0];yield Fi(BP.setState({paymentMethod:e,loading:!1,fetching:!1}))}function*j_(){yield Mo(BP.loadPaymentMethod,V_)}function*B_(){yield Mo(JP.loadInvoices,W_),yield Mo(JP.downloadInvoice,z_)}function*W_(){yield Fi(JP.setLoading(!0));try{const e=(yield xi(lp.subscriptions.getSubscriptionInvoices)).map((e=>({id:e.id,externalId:e.externalId,subscriptionId:e.subscriptionId,paymentDate:new Date(Date.parse(e.paymentDate)),totalAmount:+((e.totalAmount||0)/100).toFixed(2),currency:e.currency||"usd",paid:e.paid||!1,receiptNumber:e.receiptNumber})));yield Fi(JP.setState({loading:!1,fetching:!1,invoices:e}))}catch(e){yield Fi(JP.setError(Og(e)))}}function*z_({payload:e}){yield Fi(JP.setInvoiceDownloadState({loading:!0,error:null}));try{yield xi(lp.subscriptions.getSubscriptionInvoicePdf,e.invoiceId,e.filename),yield Fi(JP.setInvoiceDownloadState({loading:!1,error:null}))}catch(e){yield Fi(JP.setInvoiceDownloadState({loading:!1,error:Og(e,null)}))}}function*K_(){yield Fi(JP.setLoading(!0)),yield Wi(500),yield Fi(JP.setState({loading:!1,fetching:!1,invoices:O_.map((e=>M({},e,{selectedPlan:"Premium",paymentDate:new Date(Date.parse(e.paymentDate)),totalAmount:+((e.totalAmount||0)/100).toFixed(2)})))})),yield Fi(JP.setLoading(!1))}function*H_(){yield Mo(JP.loadInvoices,K_)}function*q_(){yield Mo(DP.load,J_),yield Mo(DP.cancelSubscription,Y_),yield Mo(DP.renewSubscription,X_)}function*J_(){const e=yield Bi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));yield U_(e)}function*Y_(){const{subscription:e}=yield Bi((e=>e.subscriptions.billing.subscription));if(!e)return void(yield Fi(DP.setCancellationError("Subscription not found.")));if(null!=e&&e.externallyManaged)return void(yield Fi(DP.setCancellationError("Billing is externally managed.")));const{id:t,cancellation:n,status:a}=e||{};if(!n&&a===Qy.ACTIVE)try{yield Fi(DP.setCancellationLoading(!0)),yield xi(lp.subscriptions.cancelManagedSubscription,t),yield L_(),yield Fi(DP.setCancellationLoading(!1))}catch(e){yield Fi(DP.setCancellationError(Og(e)))}}function*X_(){const{subscription:e}=yield Bi((e=>e.subscriptions.billing.subscription));if(!e)return void(yield Fi(DP.setCancellationError("Subscription not found.")));if(null!=e&&e.externallyManaged)return void(yield Fi(DP.setCancellationError("Billing is externally managed")));const{id:t,cancellation:n}=e||{};if((null==n?void 0:n.policy)===ef.AT_PERIOD_END)try{yield Fi(DP.setRenewalLoading(!0)),yield xi(lp.subscriptions.renewManagedSubscription,t),yield L_(),yield Fi(DP.setRenewalLoading(!1))}catch(e){yield Fi(DP.setCancellationError(Og(e)))}}function*Q_(){yield Fi(DP.setLoading(!0)),yield Wi(500),yield Fi(DP.setState({subscription:k_,fetching:!1,loading:!1,error:null}))}function*Z_(){yield Mo(DP.load,Q_)}function*eL(){yield Gi([xi(w_),xi(N_),xi(B_),xi(q_)])}function*tL(){yield Gi([xi(C_),xi(j_),xi(H_),xi(Z_)])}function*nL(){yield Mo(i_.loadCheckout,aL),yield Mo(i_.resetCheckout,iL),yield Mo(i_.submitCheckout,oL),yield Mo(i_.confirmCheckout,rL),yield Mo(i_.errorCheckout,lL)}function*aL(){yield Fi(i_.setState({fetching:!1,loading:!1,error:null,confirmed:!1}))}function*iL(){yield Fi(i_.setState({loading:!1,error:null,confirmed:!1}))}function*oL(){yield Fi(i_.setState({loading:!0,error:null}))}function*rL({payload:{paymentMethodId:e,planId:t}}){const n=yield Bi((e=>e.subscriptions.billing.subscription.subscription)),a=yield Bi((e=>e.subscriptions.billing.information.summary)),i=(null==n?void 0:n.status)===Qy.TRIALING,o=!(null==a||!a.paymentMethodId);if(n){if(yield Fi(i_.setState({loading:!0,error:null})),i&&o)return yield sL(),void(yield Fi(DP.setState({subscription:M({},n,{status:Qy.ACTIVE})})));try{yield xi(lp.subscriptions.updateManagedSubscription,n.id,{paymentMethodId:e,planId:t}),yield Gi([D_(),M_(),W_()]),yield sL()}catch(e){yield Fi(i_.setState({loading:!1,error:Og(e)}))}}else yield Fi(i_.setState({loading:!1,error:"Subscription not found"}))}function*sL(){yield Fi(i_.setState({loading:!1,error:null,confirmed:!0}))}function*lL({payload:e}){yield Fi(i_.setState({loading:!1,error:e}))}function*cL(){yield Mo(i_.resetCheckout,iL)}function*dL(){yield Mo(mP.loadPlans,uL)}function*uL(){yield Fi(mP.setLoading(!0));try{const e=(yield xi(lp.subscriptions.getSubscriptionPlans)).map((e=>{var t,n;return{id:e.id,name:e.name,description:e.description,price:(null==(t=e.price)?void 0:t.amount)||0,currency:(null==(n=e.price)?void 0:n.currency)||"usd",recurringInterval:"month",slug:e.slug}}));yield Fi(mP.setState({fetching:!1,loading:!1,plans:e}))}catch(e){yield Fi(mP.setError(Og(e)))}}function*yL(){yield Fi(mP.setLoading(!0)),yield Wi(500),yield Fi(mP.setState({fetching:!1,loading:!1,plans:I_.map((e=>{var t,n;return M({},e,{price:(null==(t=e.price)?void 0:t.amount)||0,currency:(null==(n=e.price)?void 0:n.currency)||"usd",recurringInterval:"month"})}))}))}function*fL(){yield Mo(mP.loadPlans,yL)}function*pL(){yield Mo(IP.loadPaymentConfiguration,gL)}function*gL(){yield Fi(IP.setLoading(!0));try{(yield xi(lp.subscriptions.getPaymentProviders)||[]).find((e=>"1"===e.status&&e.providerType===tf.Stripe))?yield function*(){yield Fi(IP.setLoading(!0));try{const e=yield xi(lp.subscriptions.getStripePaymentProviderConfiguration);yield Fi(IP.setState({loading:!1,fetching:!1,config:{paymentProvider:m_.STRIPE,apiKey:e.publishableKey}}))}catch(e){yield Fi(IP.setError(Og(e)))}}():yield Fi(IP.setError("Payment provider not configured"))}catch(e){yield Fi(IP.setError(Og(e)))}}function*SL(){yield Fi(IP.setLoading(!0)),yield Wi(500),yield Fi(IP.setState({loading:!1,fetching:!1,config:{paymentProvider:m_.STRIPE,apiKey:""}}))}function*vL(){yield Mo(IP.loadPaymentConfiguration,SL)}function*hL(){yield Mo(d_.createCardSetupIntentSecret,mL)}function*mL({payload:e}){yield Fi(d_.setState({loading:!0,error:null,cardSetupIntentSecret:null}));try{const t={};e&&(t.paymentMethodId=e);const{setupIntentSecret:n}=yield xi(lp.subscriptions.createStripePaymentMethodSetupIntentSecret,t);yield Fi(d_.setState({cardSetupIntentSecret:n,loading:!1}))}catch(e){yield Fi(d_.setError(Og(e)))}}function*bL(){yield Mo(g_.loadVendorPublicConfiguration,AL)}function*AL(){yield Fi(g_.setLoading(!0));try{const e=yield xi(lp.subscriptions.getVendorPublicConfigurations);yield Fi(g_.setState({fetching:!1,loading:!1,vendorPublicConfig:e}))}catch(e){yield Fi(g_.setError(Og(e)))}}function*TL(){yield Fi(g_.setLoading(!0)),yield Wi(500),yield Fi(g_.setState({fetching:!1,loading:!1,vendorPublicConfig:__}))}function*EL(){yield Mo(g_.loadVendorPublicConfiguration,TL)}const kL={sagas:function*(){yield Gi([xi(eL),xi(nL),xi(dL),xi(pL),xi(hL),xi(bL)])},mockSagas:function*(){yield Gi([xi(tL),xi(cL),xi(fL),xi(vL),xi(EL)])},reducer:h_,actions:v_,initialState:S_,storeName:"subscriptions"},IL={sagas:function*(){yield Mo(JS.loadVendorPublicInfo,YS)},storeName:Nt,initialState:KS,reducer:HS,actions:JS},{reducer:OL}=yt({name:"root",initialState:{context:void 0,urlStrategy:"path",previewMode:!1,appName:"default"},reducers:{setContext:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>($o.setContext(t),M({},e,{context:t}))}}}),PL=(e,t,n=!1,a,i,o=!1,r="path")=>{const s="undefined"==typeof window;let l=t;if(s&&null==t)throw Error("createFronteggStore(initState, storeHolder) failed, storeHolder must not be null in Server-Side rendering");if(l||(l=window),!l.store){var c,d,u,y,f,p,g,S,v,h;n||o||$o.setContext(e.context);const t=Po(),s=[...lt({thunk:!1,immutableCheck:!1,serializableCheck:!1}),t];l.store=ct({middleware:s,preloadedState:{root:M({},e,{previewMode:n,urlStrategy:r}),[YI.storeName]:M({},YI.initialState,a,null!=(c=null==i?void 0:i.auth)?c:{},{routes:M({},YI.initialState.routes,null!=(d=null==a?void 0:a.routes)?d:{},null!=(u=null==i||null==(y=i.auth)?void 0:y.routes)?u:{})}),[TO.storeName]:M({},TO.initialState,null!=(f=null==i?void 0:i.auditLogs)?f:{},{auditLogsState:M({},TO.initialState.auditLogsState,null!=(p=null==i||null==(g=i.auditLogs)?void 0:g.auditLogsState)?p:{}),auditsMetadataState:M({},TO.initialState.auditsMetadataState,null!=(S=null==i||null==(v=i.auditLogs)?void 0:v.auditsMetadataState)?S:{})}),[kO]:M({},EO,null!=(h=null==i?void 0:i.audits)?h:{}),[dP.storeName]:dP.initialState,[kL.storeName]:kL.initialState,[IL.storeName]:IL.initialState},reducer:We({root:OL,[YI.storeName]:YI.reducer,[TO.storeName]:TO.reducer,[kO]:OO,[dP.storeName]:dP.reducer,[kL.storeName]:kL.reducer,[IL.storeName]:IL.reducer})});const m=function*(){yield Gi([xi(YI.sagas),xi(TO.sagas),xi(FO),xi(dP.sagas),xi(kL.sagas),xi(IL.sagas)])},b=function*(){yield Gi([xi(YI.mockSagas),xi(TO.mockSagas),xi(kL.mockSagas)])};n?(l.store.destroy=t.run(b).cancel,l.store.dispatch(xa.requestAuthorize(!0))):l.store.destroy=t.run(m).cancel,l.store.subscribeStateChanged=e=>{let t=l.store.getState();return l.store.subscribe((()=>{const n=l.store.getState();t!=n&&(t=n,e(n))}))}}return l.store};var _L=n(9314);const LL=()=>{if(!$o.shouldLoadEntitlements())throw new Error("You must first enable entitlements via Frontegg options to use this function")};var wL=n(9714),DL=n.n(wL);function UL(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function RL(e){if(e.type)return e;if("#"===e.charAt(0))return RL(function(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const a=e.substring(t+1,e.length-1);let i,o;if("color"===n){if(o=a.split(" "),i=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].substr(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i))throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020."+i)}else o=a.split(",");return{type:n,values:o.map((e=>parseFloat(e))),colorSpace:i}}function CL(e){const{type:t,colorSpace:n}=e;let{values:a}=e;return-1!==t.indexOf("rgb")?a=a.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(a[1]=`${a[1]}%`,a[2]=`${a[2]}%`),a=-1!==t.indexOf("color")?`${n} ${a.join(" ")}`:`${a.join(", ")}`,`${t}(${a})`}function NL(e){if(0===e.indexOf("#"))return e;const{values:t}=RL(e);return`#${t.map(((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e))).join("")}`}function ML(e,t){return e=RL(e),t=UL(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,CL(e)}function FL(e,t){if(e=RL(e),t=UL(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return CL(e)}function GL(e,t){if(e=RL(e),t=UL(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return CL(e)}const $L=e=>{if(e)return{main:e,light:NL(GL(e,.4)),dark:NL(FL(e,.15)),hover:NL(FL(e,.15)),active:NL(FL(e,.2))}},xL=e=>{if(e)return{main:e,light:GL(e,.7),dark:FL(e,.2)}},VL=(e,t)=>{var n,a,i,o,r,s,l,c,d,u,y,f;return null!=e&&e.palette&&"string"==typeof(null==e||null==(n=e.palette)?void 0:n.primary)?M({},t,{palette:{primary:M({},$L(null==e||null==(a=e.palette)?void 0:a.primary),{contrastText:null!=(i=null==e||null==(o=e.palette)?void 0:o.primaryText)?i:"#000000"}),secondary:M({},$L(null==e||null==(r=e.palette)?void 0:r.secondary),{contrastText:null!=(s=null==e||null==(l=e.palette)?void 0:l.secondaryText)?s:"#000000"}),danger:M({},$L(null==e||null==(c=e.palette)?void 0:c.error),{contrastText:"#FFF"}),success:M({},xL(null==e||null==(d=e.palette)?void 0:d.success),{contrastText:"#FFF"}),error:M({},xL(null==e||null==(u=e.palette)?void 0:u.error),{contrastText:"#FFF"}),warning:M({},xL(null==e||null==(y=e.palette)?void 0:y.warning),{contrastText:"#FFF"}),info:M({},xL(null==e||null==(f=e.palette)?void 0:f.info),{contrastText:"#FFF"})}}):{}},jL={theme:{},themeV2:{},localizations:{},navigation:{usage:{visibility:"hidden",permissions:["fe.usage.read"],featureFlag:"fe-usage-page"},webhooks:{visibility:"hidden",permissions:["fe.connectivity.read.webhooks"]},roles:{visibility:"hidden",permissions:["fe.secure.read.roles"]},users:{visibility:"always",permissions:["fe.secure.read.users"],inviteDialog:{phoneNumberField:"optional"}},personalApiTokens:{visibility:"hidden",permissions:["fe.secure.read.userApiTokens"]},apiTokens:{visibility:"hidden",permissions:["fe.secure.read.tenantApiTokens"]},profile:{visibility:"always"},privacy:{visibility:"always",permissions:["fe.secure.read.securityPolicy"]},account:{visibility:"always",permissions:["fe.secure.read.accountSettings"]},security:{visibility:"always",permissions:["fe.secure.read.securityPolicy"]},sso:{visibility:"hidden",permissions:["fe.secure.read.samlConfiguration"]},provisioning:{visibility:"hidden",permissions:["fe.secure.read.provisioningConfiguration"]},audits:{visibility:"always",permissions:["fe.secure.read.audits"]},subscriptions:{visibility:"hidden",permissions:["fe.subscriptions.*"]},allAccounts:{visibility:"byPermissions",permissions:["fe.account-hierarchy.read.subAccount"]},groups:{visibility:"hidden",permissions:["fe.secure.read.groups"]}}};class BL{constructor(){this._theme=jL.theme,this._themeV2=jL.themeV2,this._navigation=jL.navigation,this._localizations=jL.localizations,this._integrations=jL.integrations}static getInstance(e="default"){return this._instances[e]}static set(e,t="default"){const n=new BL;return n.set(e),BL._instances[t]=n,n}get theme(){var e;return null!=(e=this._theme)?e:{}}get themeV2(){var e;return null!=(e=this._themeV2)?e:{}}get navigation(){var e;return null!=(e=this._navigation)?e:{}}get localizations(){var e;return null!=(e=this._localizations)?e:{}}get integrations(){var e;return null!=(e=this._integrations)?e:{}}set(e){try{var t,n,a,i,o,r,s,l,c;this._navigation=DL().all([null!=(t=jL.navigation)?t:{},null!=(n=null==e?void 0:e.navigation)?n:{}]),this._theme=DL().all([null!=(a=jL.theme)?a:{},VL(null==e?void 0:e.theme,jL.theme)]),this._themeV2=DL().all([null!=(i=jL.themeV2)?i:{},null!=(o=null==e?void 0:e.themeV2)?o:{}]),this._localizations=DL().all([null!=(r=jL.localizations)?r:{},null!=(s=null==e?void 0:e.localizations)?s:{}]),this._integrations=DL().all([null!=(l=jL.integrations)?l:{},null!=(c=null==e?void 0:e.integrations)?c:{}])}catch(e){this._navigation=jL.navigation,this._theme=jL.theme,this._themeV2=jL.themeV2,this._localizations=jL.localizations,this._integrations=jL.integrations}}}BL._instances={};var WL=function(e){return e.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("")},zL=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=document.createElement(t);return Object.keys(n).forEach((function(e){return a.setAttribute(e,n[e])})),e.appendChild(a),a},KL=function(e){return new Promise((function(t,n){var a=4e3,i=setInterval((function(){return null!=e.themeSetter?(clearInterval(i),void t(!0)):a<0?(n("Failed to load Renderer with themeSetter"),void clearInterval(i)):void(a-=50)}),50)}))},HL=function(e){var t=e.toString();if(t){var n=new URL(window.location.href);n.search=t,window.history.pushState(null,"",n.toString())}};let qL,JL,YL,XL,QL,ZL,ew,tw,nw,aw,iw,ow;!function(e){e.phoneNumber="phoneNumber"}(qL||(qL={})),function(e){e.Name="name",e.PhoneNumber="phoneNumber",e.Address="address",e.JobTitle="jobTitle"}(JL||(JL={})),function(e){e.LoginSessions="loginSessions",e.Mfa="mfa"}(YL||(YL={})),function(e){e.Name="name",e.PhoneNumber="phoneNumber"}(XL||(XL={})),function(e){e.CompanyName="companyName",e.Address="address",e.Website="website",e.Timezone="timezone",e.Currency="currency"}(QL||(QL={})),function(e){e.Invoices="invoices"}(ZL||(ZL={})),function(e){e.SessionManagement="sessionManagement",e.GeneralSettings="generalSettings",e.IpRestrictions="ipRestrictions",e.DomainRestrictions="domainRestrictions"}(ew||(ew={})),function(e){e.IdleSessionTimeout="idleSessionTimeout",e.ForceReLogin="forceReLogin",e.MaximumConcurrentSessions="maximumConcurrentSessions"}(tw||(tw={})),function(e){e.Mfa="mfa",e.UserLockout="userLockout",e.PasswordHistory="passwordHistory"}(nw||(nw={})),function(e){e.IpAddressRestrictions="ipAddressRestrictions"}(aw||(aw={})),function(e){e.RestrictSignupByEmailDomain="restrictSignupByEmailDomain"}(iw||(iw={})),function(e){e.Settings="settings",e.CustomLogin="customLogin"}(ow||(ow={}));const rw={hidden:"hidden",viewOnly:"viewOnly",edit:"edit"},sw={hidden:"hidden",edit:"edit"},lw="6.185.0-alpha.0";var cw={admin_portal_ip_restrictions:"on",admin_portal_domain_restrictions:"on","new-mfa-pages":"on","show-passkeys-new":"on","groups-admin-box-new":"on","msp-all-accounts-new":"on","temporary-users":"on"},dw=function(){function e(t,n){var a,i,o=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];O(this,e),this.name=void 0,this.iframeRendering=void 0,this.options=void 0,this.loading=!0,this.cdnUrl="https://assets.frontegg.com/admin-box/".concat(lw),this.customElementName="",this.adminPortalEl=void 0,this.adminPortalRenderer=void 0,this.loginBoxEl=void 0,this.checkoutDialogEl=void 0,this.checkoutDialogRenderer=void 0,this.adminPortalContainer=void 0,this.loginBoxContainer=void 0,this.checkoutDialogContainer=void 0,this.loginBoxRenderer=void 0,this.store=void 0,this.loadingListeners=[],this.updateLocalizations=void 0,this.loadAdminBoxMetadata=R(N().mark((function e(){var t,n,a,i,r;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Dr,o.options.metadata){e.next=12;break}return e.prev=2,e.next=5,t("/metadata",{entityName:"adminBox"});case 5:r=e.sent,o.options.metadata=null!=(n=null==r||null==(a=r.rows)||null==(i=a[0])?void 0:i.configuration)?n:{},e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("failed to get admin portal metadata",e.t0);case 12:BL.set(o.options.metadata,o.name);case 13:case"end":return e.stop()}}),e,null,[[2,9]])}))),this.requestAuthorize=R(N().mark((function e(){var t,n,a;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=null==(t=o.options.authOptions)||null==(n=t.hostedLoginOptions)?void 0:n.loadUserOnFirstLoad,o.options.builderMode||"nextjs"===o.options.framework||(o.options.hostedLoginBox&&!o.options.customLoginBox?a&&o.store.dispatch({type:"auth/requestHostedLoginAuthorizeV2",payload:{shouldRedirectToLogin:!1,firstTime:!0}}):o.store.dispatch({type:"auth/requestAuthorize",payload:!0}));case 2:case"end":return e.stop()}}),e)}))),this.loadFeatureFlags=R(N().mark((function e(){var t;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.options.previewMode&&!o.options.builderMode){e.next=4;break}Vr.set(cw,o.name),e.next=15;break;case 4:return e.prev=4,e.next=7,jr();case 7:t=e.sent,o.options.overrideFeatureFlags&&Object.assign(t,o.options.overrideFeatureFlags),Vr.set(t,o.name),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("failed to get admin portal feature flags",e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])}))),this.setFeatureFlagsForPreview=function(e){Vr.set(Object.assign({},cw,e),o.name)},this.queryFeatureFlags=function(e){return Vr.getFeatureFlags(e,o.name)},this.updateLocalizationsSetter=function(e){o.updateLocalizations=e},this.getEntitlementsFromStore=function(){var e;return null==(e=o.store.getState().auth.user)?void 0:e.entitlements},this.getUserFromStore=function(){return o.store.getState().auth.user},this.getEntitlementsQueryData=function(e){var t=o.getUserFromStore();return{entitlements:o.getEntitlementsFromStore(),attributes:{custom:e,jwt:t}}};var l=WL(n),c="frontegg-app-".concat(l);this.iframeRendering=r,this.name=l,this.options=Object.assign({},t,{contextOptions:Object.assign({requestCredentials:"include"},t.contextOptions)}),this.options.cdnUrl&&(this.cdnUrl=this.options.cdnUrl),this.customElementName=c;var d,u,y=this.options.authOptions?Object.assign({},this.options.authOptions,{hostedLoginBox:this.options.hostedLoginBox}):{hostedLoginBox:this.options.hostedLoginBox};if(y.disableSilentRefresh=null==(a=this.options.authOptions)?void 0:a.disableSilentRefresh,this.options.store){if(this.store=this.options.store,!s&&this.options.store.getState().root.appName!==n)throw Error("Mismatch in store names")}else this.store=PL({context:this.options.contextOptions,appName:this.name},this,this.options.previewMode,y,{auth:null!=(d=this.options.authOptions)?d:{},audits:null!=(u=this.options.auditsOptions)?u:{}},!1,this.options.urlStrategy);D.setInstance(l,this),this.setEntitlementsOptions(t.entitlementsOptions),this.setSessionContext({enableSessionPerTenant:null==(i=t.authOptions)?void 0:i.enableSessionPerTenant}),$o.setAppName(l)}var t,n,a,i;return w(e,[{key:"setEntitlementsOptions",value:function(e){$o.setEntitlementsOptions(Object.assign({},e))}},{key:"setSessionContext",value:function(e){$o.setSessionContext(Object.assign({},e))}},{key:"initContainers",value:(i=R(N().mark((function e(t){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.adminPortalEl=t.adminPortalEl,this.loginBoxEl=t.loginBoxEl,this.checkoutDialogEl=t.checkoutDialogEl,this.adminPortalContainer=t.adminPortalContainer,this.loginBoxContainer=t.loginBoxContainer,this.checkoutDialogContainer=t.checkoutDialogContainer;try{"nextjs"!==this.options.framework&&document.body.classList.add("frontegg-loading")}catch(e){console.error("Failed to add frontegg-loading to body classList")}return e.next=9,this.loadFeatureFlags();case 9:return e.next=11,Promise.all([this.loadAdminBoxMetadata(),this.requestAuthorize()]);case 11:this.options.previewMode||this.options.customLoginBox||(this.loadLoginBox(),n=this.name,a=void 0,void 0,o=void 0,null==(o=null==(i=BL.getInstance(n))||null==(a=i.integrations)?void 0:a.gtm)||o.filter((function(e){var t=e.id;return e.enabled&&function(e){return/^GTM-[a-zA-Z0-9]+$/.test(e)}(t)})).forEach((function(e){var t=e.id,n=document.createElement("script");n.innerHTML="\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(t,"');\n "),document.body.appendChild(n)}))),this.options.lazyLoadAdminPortal||this.loadScript("FronteggAdminPortal");case 13:case"end":return e.stop()}var n,a,i,o}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"updateMetadata",value:function(e){var t;BL.set(e,this.name),null!=e&&e.localizations&&(null==(t=this.updateLocalizations)||t.call(this,e.localizations))}},{key:"addOnLoadedListener",value:function(e){this.loading?this.loadingListeners.push(e):e()}},{key:"ready",value:function(e){this.loading?e():this.addOnLoadedListener(e)}},{key:"loginWithRedirect",value:function(){this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/requestHostedLoginAuthorize"})}},{key:"logout",value:function(){this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/logout"})}},{key:"loadScript",value:function(e){var t=this;return new Promise((function(n,a){if(window[e])n(window[e]);else{var i=document.createElement("script");i.src="".concat(t.cdnUrl,"/").concat({FronteggLoginBox:"login-box/index.js",FronteggAdminPortal:"admin-portal/index.js"}[e]),i.setAttribute("id","".concat(e,"Script")),i.setAttribute("cdn-url",t.cdnUrl),i.onload=function(){window["".concat(e,"Init")]?n(window["".concat(e,"Init")]({FronteggRestApi:k,FronteggTypes:I})):n(window[e])},i.onerror=function(e){console.log("Profile page error",e),a(e)},document.body.append(i)}}))}},{key:"loadLoginBox",value:(a=R(N().mark((function e(){return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadScript("FronteggLoginBox");case 2:e.sent.render(this.loginBoxEl,{injector:this,options:this.options}),this.loading=!1,this.loadingListeners.forEach((function(e){try{e()}catch(e){console.error("Failed to call loadLoginBoxListener",e)}})),this.loadingListeners=[];case 7:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"showAdminPortal",value:(n=R(N().mark((function e(){var t;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $o.setRequestSource(la.AdminPortal),e.next=3,this.loadScript("FronteggAdminPortal");case 3:t=e.sent,this.adminPortalRenderer=t.render(this.adminPortalEl,{injector:this,options:this.options});case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"hideAdminPortal",value:function(){try{var e,t=new URLSearchParams(window.location.search);null==(e=this.adminPortalRenderer)||e.unmount(),HL(t),$o.setRequestSource(null)}catch(e){console.error("Failed to unmount admin portal",e)}}},{key:"showCheckoutDialog",value:(t=R(N().mark((function e(t){var n;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadScript("FronteggAdminPortal");case 2:n=e.sent,this.checkoutDialogRenderer=n.renderCheckoutDialog(this.checkoutDialogEl,Object.assign({injector:this},t,{options:this.options}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"hideCheckoutDialog",value:function(){try{var e;null==(e=this.checkoutDialogRenderer)||e.unmount()}catch(e){console.error("Failed to unmount checkout dialog",e)}}},{key:"getFeatureEntitlements",value:function(e,t){var n=this.getEntitlementsQueryData(t);return((e,t,n,a)=>(LL(),(0,_L.tE)(t,e,n)))(n.entitlements,e,n.attributes)}},{key:"getPermissionEntitlements",value:function(e,t){var n=this.getEntitlementsQueryData(t);return((e,t,n,a)=>(LL(),(0,_L.wJ)(t,e,n)))(n.entitlements,e,n.attributes)}},{key:"getEntitlements",value:function(e,t){return"permissionKey"in e?this.getPermissionEntitlements(e.permissionKey,t):this.getFeatureEntitlements(e.featureKey,t)}},{key:"loadEntitlements",value:function(e){this.store.dispatch({type:"auth/loadEntitlements",payload:{callback:e}})}},{key:"stepUp",value:function(e){var t=this.store.getState(),n=(null==t?void 0:t.auth)||{},a=n.hostedLoginBox,i=n.routes.stepUpUrl;a?this.store.dispatch({type:"auth/stepUpHostedLogin",payload:e}):((e,t,n)=>{cv();const a=new URLSearchParams(window.location.search);n&&a.set("maxAge",n.toString()),t(`${e}${a?`?${a}`:""}`,{refresh:!1})})(i,t.auth.onRedirectTo,null==e?void 0:e.maxAge)}},{key:"isSteppedUp",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(null==(e=this.store.getState())?void 0:e.auth)||{},a=n.user;return lv(a,t)}},{key:"close",value:function(){this.hideAdminPortal(),this.hideCheckoutDialog()}}]),e}(),uw=function(){function e(){O(this,e)}return w(e,null,[{key:"setAuthentication",value:function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"default",i=D.getInstance(a);e&&t?($o.setAccessToken(t),$o.setUser(Object.assign({},n,{accessToken:t})),i.store.dispatch(xa.setState({isLoading:!1,isAuthenticated:e,user:n})),i.store.dispatch(xa.loadTenants())):($o.setAccessToken(null),$o.setUser(null),i.store.dispatch(xa.setState({isLoading:!1,isAuthenticated:!1,user:null})))}}]),e}(),yw=function(){function e(){O(this,e)}return w(e,null,[{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";D.getInstance(e).showAdminPortal()}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";D.getInstance(e).hideAdminPortal()}}]),e}(),fw=function(){function e(){O(this,e)}return w(e,null,[{key:"show",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";D.getInstance(t).showCheckoutDialog(e)}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";D.getInstance(e).hideCheckoutDialog()}}]),e}(),pw=function(e){var t;return null!=(t=window.FronteggAdminPortal.adminPortalStaticThemesDefaults[e])?t:void 0},gw=function(){function e(t,n,a,i){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];O(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.setRoute=function(){},this.themeSetter=void 0,this.themeOptions={};var r={baseUrl:"preview"};if(a){if(this.store=a,!o&&a.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=PL({context:r,appName:t},this,!0,void 0,void 0,!0);this.options=Object.assign({themeOptions:n,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:r},i),this.app=new dw(this.options,t,!0),BL.set({},t)}var t;return w(e,[{key:"render",value:(t=R(N().mark((function e(t){var n,a,i,o,r=this;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.querySelector("#root"))||((n=t.ownerDocument.createElement("div")).setAttribute("id","root"),t.appendChild(n)),this.app.adminPortalContainer=t,this.app.adminPortalEl=n,a=function(e){r.themeSetter=e},i=function(e){r.setRoute=e},e.next=8,this.app.loadScript("FronteggAdminPortal");case 8:return o=e.sent,this.app.adminPortalRenderer=o.renderPage(n,{options:this.options,injector:this.app,setThemeSetter:a,setStaticRouteSetter:i}),this.app.loading=!1,e.next=13,KL(this);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setStaticRoute",value:function(e){var t;null==(t=this.setRoute)||t.call(this,e)}},{key:"unmount",value:function(){try{var e;null==(e=this.app.adminPortalRenderer)||e.unmount()}catch(e){console.error("Failed to unmount admin Portal renderer",e)}}},{key:"setTheme",value:function(e){var t;this.themeOptions=e,this.themeSetter||console.warn("this.themeSetter is not defined yet"),null==(t=this.themeSetter)||t.call(this,this.themeOptions)}}]),e}(),Sw="modern",vw=function(e){var t,n=window.FronteggAdminPortal.themes;return null!=(t=n[e])?t:n[Sw]},hw=function(){function e(t,n,a,i){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];O(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.themeSetter=void 0,this.setRoute=function(){},this.themeOptions={};var r={baseUrl:"preview"};if(a){if(this.store=a,!o&&a.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=PL({context:r,appName:t},this,!0,void 0,void 0,!0);this.options=Object.assign({themeOptions:n,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:r,onRedirectTo:function(){console.debug("path")}},i),this.app=new dw(this.options,t,!0,o),BL.set({},t)}var t;return w(e,[{key:"render",value:(t=R(N().mark((function e(t){var n,a,i,o,r=this;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.querySelector("#root"))||((n=t.ownerDocument.createElement("div")).setAttribute("id","root"),t.appendChild(n)),this.app.loginBoxContainer=t,this.app.loginBoxEl=n,a=function(e){r.themeSetter=e},i=function(e){r.setRoute=e},e.next=8,this.app.loadScript("FronteggLoginBox");case 8:return o=e.sent,this.app.loginBoxRenderer=o.renderPage(n,{options:this.options,injector:this.app,setThemeSetter:a,setStaticRouteSetter:i,staticRoute:"/account/login"}),e.next=12,KL(this);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){try{var e;null==(e=this.app.loginBoxRenderer)||e.unmount()}catch(e){console.error("Failed to unmount login box renderer",e)}}},{key:"setTheme",value:function(e){var t;this.themeOptions=e,this.themeSetter||console.warn("this.themeSetter is not defined yet"),null==(t=this.themeSetter)||t.call(this,this.themeOptions)}},{key:"setStaticRoute",value:function(e){var t;this.setRoute||console.warn("this.setRoute is not defined yet"),null==(t=this.setRoute)||t.call(this,e)}},{key:"setStore",value:function(e){this.store.dispatch({type:"auth/setState",payload:e})}}]),e}();function mw(e,t){return mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mw(e,t)}function bw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mw(e,t)}function Aw(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tw(e){return Tw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tw(e)}function Ew(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function kw(e,t,n){return kw=Ew()?Reflect.construct.bind():function(e,t,n){var a=[null];a.push.apply(a,t);var i=new(Function.bind.apply(e,a));return n&&mw(i,n.prototype),i},kw.apply(null,arguments)}function Iw(e){var t="function"==typeof Map?new Map:void 0;return Iw=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return kw(e,arguments,Tw(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),mw(n,e)},Iw(e)}function Ow(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=Tw(e);if(t){var i=Tw(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return Aw(this,n)}}var Pw=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=new dw(e,t);if("undefined"!=typeof document){var a;if(!e.contextOptions.baseUrl){var i=new Error('Edit <FronteggProvider/> options { ContextOptions: { baseUrl: "" } } in order to connect your application');throw document.body.innerHTML="",alert(i.message),i}if(!customElements.get("frontegg-app")){var o=function(e){bw(n,e);var t=Ow(n);function n(){var e;O(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).app=null,e}return w(n,[{key:"connectedCallback",value:function(){this.updateContent()}},{key:"attributeChangedCallback",value:function(e,t,n){if("app-name"===e){if(null===t)return;if(t===n)return;this.innerHTML="",null===n?this.remove():this.updateContent()}console.debug("attributeChangedCallback",e,t,n)}},{key:"updateContent",value:function(){var e,t=null!=(e=this.getAttribute("app-name"))?e:"default",n=D.getInstance(t);if(null===n)throw Error("FronteggApp not found for appName: '".concat(t,"'"));this.setAttribute("id","frontegg-app-".concat(n.name));var a=zL(this,"div",{id:"frontegg-admin-portal-container-".concat(n.name)}),i=zL(this,"div",{id:"frontegg-login-box-container-".concat(n.name)}),o=zL(this,"div",{id:"frontegg-checkout-dialog-container-".concat(n.name)}),r=a.attachShadow({mode:"open"}),s=i.attachShadow({mode:"open"}),l=o.attachShadow({mode:"open"}),c=zL(r,"div",{id:"frontegg-admin-portal-".concat(n.name),class:"frontegg-root-content"}),d=zL(s,"div",{id:"frontegg-login-box-".concat(n.name),class:"frontegg-root-content"}),u=zL(l,"div",{id:"frontegg-checkout-dialog-".concat(n.name),class:"frontegg-root-content"});n.initContainers({adminPortalEl:c,loginBoxEl:d,adminPortalContainer:a,loginBoxContainer:i,checkoutDialogContainer:o,checkoutDialogEl:u})}}],[{key:"observedAttributes",get:function(){return["app-name"]}}]),n}(Iw(HTMLElement));customElements.define("frontegg-app",o)}null==(a=document.querySelector('frontegg-app[app-name="'.concat(n.name,'"]')))||a.remove();var r=document.createElement("frontegg-app");r.setAttribute("app-name",n.name),document.body.appendChild(r)}return n}})(),a})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Frontegg=t():e.Frontegg=t()}(window,(()=>(()=>{var e={6987:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConditionEvaluator=void 0;const a=n(3651),i=n(9082);t.createConditionEvaluator=function(e){const t=(0,i.useSanitizer)(e.condition.op);if(!t)return()=>!1;const{isSanitized:n,sanitizedValue:o}=t(e.condition.value);if(!n||void 0===o)return()=>!1;const r=(0,a.useOperation)(e.condition.op,o);return t=>{const n=t[e.condition.attribute];if(void 0===n||!r)return!1;const{isValid:a}=r(n);return e.condition.negate?!a:a}}},2898:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6987),t),i(n(7371),t)},7371:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3840:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFeatureFlag=void 0;const a=n(2380);t.evaluateFeatureFlag=function(e,t){if(!e.on)return{treatment:e.offTreatment};const n=function(e,t){var n;return null===(n=e.rules)||void 0===n?void 0:n.find((e=>(0,a.createRuleEvaluator)({rule:e})(t)===a.RuleEvaluationResultEnum.Treatable))}(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}},6095:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3840),t)},9314:(e,t,n)=>{"use strict";t.wJ=t.tE=void 0;n(6095),n(521),n(2380),n(2379);var a=n(5535);Object.defineProperty(t,"tE",{enumerable:!0,get:function(){return a.evaluateIsEntitledToFeature}}),Object.defineProperty(t,"wJ",{enumerable:!0,get:function(){return a.evaluateIsEntitledToPermissions}})},195:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanOperationsMapper=void 0;const o=n(2379),r=n(6610);i(n(6610),t),i(n(7226),t),t.BooleanOperationsMapper={[o.OperationEnum.Is]:e=>(0,r.useIsOperation)(e)}},6610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useIsOperation=void 0,t.useIsOperation=function(e){return t=>({isValid:t===e.boolean})}},7226:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizersMapper=t.singleBooleanSanitizer=void 0;const a=n(2379);t.singleBooleanSanitizer=e=>{const t=void 0!==e.boolean&&(e=>"boolean"==typeof e)(e.boolean)?{boolean:e.boolean}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.BooleanSanitizersMapper={[a.OperationEnum.Is]:t.singleBooleanSanitizer}},3651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOperation=void 0;const a=n(5943),i=n(1610),o=n(9004),r=n(195),s={...a.StringOperationsMapper,...i.NumericOperationsMapper,...o.DateOperationsMapper,...r.BooleanOperationsMapper};t.useOperation=function(e,t){const n=s[e];return n?n(t):void 0}},9082:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSanitizer=void 0;const a=n(195),i=n(2903),o=n(6886),r=n(1610),s={...i.StringSanitizersMapper,...r.NumericSanitizersMapper,...o.DateSanitizersMapper,...a.BooleanSanitizersMapper};t.useSanitizer=function(e){return s[e]}},9004:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateOperationsMapper=void 0;const o=n(2379),r=n(4569);i(n(4569),t),i(n(5931),t),t.DateOperationsMapper={[o.OperationEnum.On]:e=>(0,r.useDateOnOperation)(e),[o.OperationEnum.OnOrAfter]:e=>(0,r.useDateOnOrAfterOperation)(e),[o.OperationEnum.OnOrBefore]:e=>(0,r.useDateOnOrBeforeOperation)(e),[o.OperationEnum.BetweenDate]:e=>(0,r.useDateBetweenOperation)(e)}},4569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDateBetweenOperation=t.useDateOnOrBeforeOperation=t.useDateOnOrAfterOperation=t.useDateOnOperation=void 0,t.useDateOnOperation=function(e){return t=>({isValid:t.getTime()===e.date.getTime()})},t.useDateOnOrAfterOperation=function(e){return t=>({isValid:t.getTime()>=e.date.getTime()})},t.useDateOnOrBeforeOperation=function(e){return t=>({isValid:t.getTime()<=e.date.getTime()})},t.useDateBetweenOperation=function(e){return t=>({isValid:t.getTime()>=e.start.getTime()&&t.getTime()<=e.end.getTime()})}},6886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateSanitizersMapper=t.sanitizeDateRange=t.sanitizeSingleDate=t.isValidDate=t.sanitizeDateValue=void 0;const a=n(2379);t.sanitizeDateValue=e=>new Date(e),t.isValidDate=e=>e instanceof Date&&!isNaN(e),t.sanitizeSingleDate=e=>{const n=e.date?(0,t.sanitizeDateValue)(e.date):void 0,a=n&&(0,t.isValidDate)(n)?{date:n}:void 0;return{isSanitized:!!a,sanitizedValue:a}},t.sanitizeDateRange=e=>{const n=e.start?(0,t.sanitizeDateValue)(e.start):void 0,a=e.end?(0,t.sanitizeDateValue)(e.end):void 0,i=n&&a&&(0,t.isValidDate)(n)&&(0,t.isValidDate)(a)?{start:n,end:a}:void 0;return{isSanitized:!!i,sanitizedValue:i}},t.DateSanitizersMapper={[a.OperationEnum.On]:t.sanitizeSingleDate,[a.OperationEnum.OnOrAfter]:t.sanitizeSingleDate,[a.OperationEnum.OnOrBefore]:t.sanitizeSingleDate,[a.OperationEnum.BetweenDate]:t.sanitizeDateRange}},5931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1610:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.NumericOperationsMapper=void 0;const o=n(2379),r=n(9217);t.NumericOperationsMapper={[o.OperationEnum.Equal]:e=>(0,r.useEqualsOperation)(e),[o.OperationEnum.GreaterThan]:e=>(0,r.useGreaterThanOperation)(e),[o.OperationEnum.GreaterThanEqual]:e=>(0,r.useGreaterThanEqualOperation)(e),[o.OperationEnum.LesserThan]:e=>(0,r.useLesserThanOperation)(e),[o.OperationEnum.LesserThanEqual]:e=>(0,r.useLesserThanEqualOperation)(e),[o.OperationEnum.BetweenNumeric]:e=>(0,r.useBetweenNumericOperation)(e)},i(n(9217),t),i(n(9326),t),i(n(1764),t)},9217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useBetweenNumericOperation=t.useLesserThanEqualOperation=t.useLesserThanOperation=t.useGreaterThanEqualOperation=t.useGreaterThanOperation=t.useEqualsOperation=void 0,t.useEqualsOperation=function(e){return t=>({isValid:t===e.number})},t.useGreaterThanOperation=function(e){return t=>({isValid:t>e.number})},t.useGreaterThanEqualOperation=function(e){return t=>({isValid:t>=e.number})},t.useLesserThanOperation=function(e){return t=>({isValid:t<e.number})},t.useLesserThanEqualOperation=function(e){return t=>({isValid:t<=e.number})},t.useBetweenNumericOperation=function(e){return t=>({isValid:t>=e.start&&t<=e.end})}},9326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumericSanitizersMapper=t.sanitizeNumericRange=t.sanitizeSingleNumber=void 0;const a=n(2379),i=e=>"number"==typeof e;t.sanitizeSingleNumber=e=>{const t=void 0!==e.number&&i(e.number)?{number:e.number}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.sanitizeNumericRange=e=>{const t=void 0!==e.start&&void 0!==e.end&&i(e.start)&&i(e.end)?{start:e.start,end:e.end}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.NumericSanitizersMapper={[a.OperationEnum.Equal]:t.sanitizeSingleNumber,[a.OperationEnum.GreaterThan]:t.sanitizeSingleNumber,[a.OperationEnum.GreaterThanEqual]:t.sanitizeSingleNumber,[a.OperationEnum.LesserThan]:t.sanitizeSingleNumber,[a.OperationEnum.LesserThanEqual]:t.sanitizeSingleNumber,[a.OperationEnum.BetweenNumeric]:t.sanitizeNumericRange}},1764:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5943:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.StringOperationsMapper=void 0;const o=n(2379),r=n(2431);i(n(2431),t),i(n(2097),t),t.StringOperationsMapper={[o.OperationEnum.StartsWith]:e=>(0,r.useStartsWithOperation)(e),[o.OperationEnum.EndsWith]:e=>(0,r.useEndsWithOperation)(e),[o.OperationEnum.Contains]:e=>(0,r.useContainsOperation)(e),[o.OperationEnum.InList]:e=>(0,r.useInListOperation)(e),[o.OperationEnum.Matches]:e=>(0,r.useMatchesOperation)(e)}},2431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useMatchesOperation=t.useInListOperation=t.useContainsOperation=t.useEndsWithOperation=t.useStartsWithOperation=void 0,t.useStartsWithOperation=function(e){return t=>({isValid:e.list.some((e=>t.startsWith(e)))})},t.useEndsWithOperation=function(e){return t=>({isValid:e.list.some((e=>t.endsWith(e)))})},t.useContainsOperation=function(e){return t=>({isValid:e.list.some((e=>t.includes(e)))})},t.useInListOperation=function(e){return t=>({isValid:e.list.includes(t)})},t.useMatchesOperation=function(e){return t=>{let n;try{n=new RegExp(e.string)}catch(e){return{isValid:!1}}return{isValid:n.test(t)}}}},2903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringSanitizersMapper=t.sanitizeListString=t.sanitizeSingleString=void 0;const a=n(2379),i=e=>"string"==typeof e;t.sanitizeSingleString=e=>{const t=void 0!==e.string&&i(e.string)?{string:e.string}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.sanitizeListString=e=>{const t=void 0!==e.list&&e.list.every((e=>i(e)))?{list:e.list}:void 0;return{isSanitized:!!t,sanitizedValue:t}},t.StringSanitizersMapper={[a.OperationEnum.Matches]:t.sanitizeSingleString,[a.OperationEnum.Contains]:t.sanitizeListString,[a.OperationEnum.StartsWith]:t.sanitizeListString,[a.OperationEnum.EndsWith]:t.sanitizeListString,[a.OperationEnum.InList]:t.sanitizeListString}},2097:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2379:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3982),t)},3982:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.OperationEnum=void 0,(n=t.OperationEnum||(t.OperationEnum={})).InList="in_list",n.StartsWith="starts_with",n.EndsWith="ends_with",n.Contains="contains",n.Matches="matches",n.Equal="equal",n.GreaterThan="greater_than",n.GreaterThanEqual="greater_than_equal",n.LesserThan="lower_than",n.LesserThanEqual="lower_than_equal",n.BetweenNumeric="between_numeric",n.Is="is",n.On="on",n.BetweenDate="between_date",n.OnOrAfter="on_or_after",n.OnOrBefore="on_or_before"},521:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3603),t)},3603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluatePlan=void 0;const a=n(2380);t.evaluatePlan=function(e,t){const n=function(e,t){var n;return null===(n=e.rules)||void 0===n?void 0:n.find((e=>(0,a.createRuleEvaluator)({rule:e})(t)===a.RuleEvaluationResultEnum.Treatable))}(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}},2380:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(2930),t),i(n(1304),t)},1304:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRuleEvaluator=void 0;const a=n(2930),i=n(2898);t.createRuleEvaluator=function(e){return t=>e.rule.conditions.every((e=>(0,i.createConditionEvaluator)({condition:e})(t)))?a.RuleEvaluationResultEnum.Treatable:a.RuleEvaluationResultEnum.Insufficient}},2930:(e,t)=>{"use strict";var n,a;Object.defineProperty(t,"__esModule",{value:!0}),t.RuleEvaluationResultEnum=t.TreatmentEnum=t.ConditionLogicEnum=void 0,(t.ConditionLogicEnum||(t.ConditionLogicEnum={})).And="and",(a=t.TreatmentEnum||(t.TreatmentEnum={})).True="true",a.False="false",(n=t.RuleEvaluationResultEnum||(t.RuleEvaluationResultEnum={})).Treatable="treatable",n.Insufficient="insufficient"},5535:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3779),t),i(n(1038),t),i(n(5113),t),i(n(4848),t)},5640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.directEntitlementEvalutor=void 0;const a=n(5113);t.directEntitlementEvalutor=function(e,t,n={}){const i=t.features[e];let o=!1;return i&&null!==i.expireTime&&(o=i.expireTime!==a.NO_EXPIRATION_TIME&&i.expireTime<Date.now(),!o)?{isEntitled:!0}:{isEntitled:!1,justification:o?a.NotEntitledJustification.BUNDLE_EXPIRED:a.NotEntitledJustification.MISSING_FEATURE}}},9838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.featureFlagEvaluator=void 0;const a=n(5113),i=n(6095),o=n(4668),r=n(2380);t.featureFlagEvaluator=function(e,t,n={}){const s=t.features[e];if(s&&s.featureFlag){const e=(0,o.prepareAttributes)(n),{treatment:t}=(0,i.evaluateFeatureFlag)(s.featureFlag,e);if(t===r.TreatmentEnum.True)return{isEntitled:!0}}return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE}}},4529:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIsEntitledEvaluators=void 0;const a=n(5640),i=n(9838),o=n(3751);t.getIsEntitledEvaluators=function(){return[a.directEntitlementEvalutor,i.featureFlagEvaluator,o.planTargetingRulesEvalutor]}},3751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.planTargetingRulesEvalutor=void 0;const a=n(5113),i=n(4668),o=n(2380),r=n(521);t.planTargetingRulesEvalutor=function(e,t,n={}){const s=t.features[e];if(s&&s.planIds&&s.planIds.length>0){const e=(0,i.prepareAttributes)(n),a=t.plans;for(const t of s.planIds){const n=a[t];if(n){const{treatment:t}=(0,r.evaluatePlan)(n,e);if(t===o.TreatmentEnum.True)return{isEntitled:!0}}}}return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE}}},3779:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7850),t)},7850:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateIsEntitledToFeature=void 0;const a=n(5113),i=n(4848),o=n(4529);t.evaluateIsEntitledToFeature=function(e,t,n={}){if(!t)return{isEntitled:!1,justification:a.NotEntitledJustification.MISSING_FEATURE};const r=[];for(const a of(0,o.getIsEntitledEvaluators)())if(r.push(a(e,t,n)),!(0,i.shouldContinue)(r))break;return(0,i.getResult)(r)}},1038:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(519),t)},519:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateIsEntitledToPermissions=void 0;const a=n(7850),i=n(5113),o=n(4848),r=n(4852);t.evaluateIsEntitledToPermissions=function(e,t,n){if(!t)return{isEntitled:!1,justification:i.NotEntitledJustification.MISSING_PERMISSION};if(!(0,r.checkPermission)(t.permissions,e))return{isEntitled:!1,justification:i.NotEntitledJustification.MISSING_PERMISSION};const s=function(e,t){return Object.keys(t.features).filter((n=>t.features[n].linkedPermissions.includes(e)))}(e,t);if(!s.length)return{isEntitled:!0};const l=[];for(const e of s)if(l.push((0,a.evaluateIsEntitledToFeature)(e,t,n)),!(0,o.shouldContinue)(l))break;return(0,o.getResult)(l)}},5113:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NO_EXPIRATION_TIME=t.NotEntitledJustification=void 0,(n=t.NotEntitledJustification||(t.NotEntitledJustification={})).MISSING_FEATURE="MISSING_FEATURE",n.MISSING_PERMISSION="MISSING_PERMISSION",n.BUNDLE_EXPIRED="BUNDLE_EXPIRED",t.NO_EXPIRATION_TIME=-1},4668:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modifyObjectKeysWithPrefix=t.defaultFronteggAttributesMapper=t.prepareAttributes=void 0;const a=n(193);function i(e){return{email:e.email,emailVerified:e.email_verified,tenantId:e.tenantId,userId:e.id}}function o(e,t){return Object.keys(e).reduce(((n,a)=>(n[`${t}${a}`]=e[a],n)),{})}t.prepareAttributes=function(e={},t){const{custom:n={},jwt:r={}}=e,s=(0,a.flatten)(r);return{...n,...o(t?t(r):i(r),"frontegg."),...o(s,"jwt.")}},t.defaultFronteggAttributesMapper=i,t.modifyObjectKeysWithPrefix=o},1882:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldContinue=t.getResult=void 0;const a=n(5113);t.getResult=function(e){let t=!1;for(const n of e){if(n.isEntitled)return n;n.justification===a.NotEntitledJustification.BUNDLE_EXPIRED&&(t=!0)}return{isEntitled:!1,justification:t?a.NotEntitledJustification.BUNDLE_EXPIRED:a.NotEntitledJustification.MISSING_FEATURE}},t.shouldContinue=function(e){return e.every((({isEntitled:e})=>!e))}},193:(e,t)=>{"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.flatten=void 0,t.flatten=function(e,t){const a=(null==(t=t||{})?void 0:t.delimiter)||".",i=null==t?void 0:t.maxDepth,o=(null==t?void 0:t.transformKey)||n,r={};return function e(n,s,l){l=l||1,Object.keys(n).forEach((function(c){const d=n[c],u=(null==t?void 0:t.safe)&&Array.isArray(d),y=Object.prototype.toString.call(d),f=(p=d)&&p.constructor&&"function"==typeof p.constructor.isBuffer&&p.constructor.isBuffer(p);var p;const g="[object Object]"===y||"[object Array]"===y,S=s?s+a+o(c):o(c);if(!u&&!f&&g&&Object.keys(d).length&&(!(null==t?void 0:t.maxDepth)||i&&l<i))return e(d,S,l+1);r[S]=d}))}(e),r}},4848:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,i)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4852),t),i(n(4668),t),i(n(1882),t)},4852:(e,t)=>{"use strict";function n(e){return new RegExp("^"+e.replace(/\./g,"\\.").replace(/\*/g,".*")+"$","gs")}Object.defineProperty(t,"__esModule",{value:!0}),t.createPermissionCheckRegex=t.checkPermission=void 0,t.checkPermission=function(e,t){return Object.keys(e).some((e=>n(e).test(t)))},t.createPermissionCheckRegex=n},9714:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function r(e,t){try{return t in e}catch(e){return!1}}function s(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=a;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=a(e[t],n)})),o(t).forEach((function(o){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(r(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,n)(e[o],t[o],n):i[o]=a(t[o],n))})),i}(e,n,l):a(n,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var l=s;e.exports=l},9378:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var a,i,o;if(Array.isArray(t)){if((a=t.length)!=n.length)return!1;for(i=a;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((a=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=a;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=a;0!=i--;){var r=o[i];if(!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}},7609:(e,t,n)=>{var a=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function y(e,t,n,a){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),s=new L(a||[]);return r(o,"_invoke",{value:I(e,n,s)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=y;var p={};function g(){}function S(){}function v(){}var h={};u(h,l,(function(){return this}));var m=Object.getPrototypeOf,A=m&&m(m(w([])));A&&A!==n&&o.call(A,l)&&(h=A);var b=v.prototype=g.prototype=Object.create(h);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,r,s,l){var c=f(e[i],e,r);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==a(u)&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var i;r(this,"_invoke",{value:function(e,a){function o(){return new t((function(t,i){n(e,a,t,i)}))}return i=i?i.then(o,o):o()}})}function I(e,t,n){var a="suspendedStart";return function(i,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var r=n.delegate;if(r){var s=k(r,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var l=f(e,t,n);if("normal"===l.type){if(a=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a="completed",n.method="throw",n.arg=l.arg)}}}function k(e,t){var n=t.method,a=e.iterator[n];if(void 0===a)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(a,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function w(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:D}}function D(){return{value:void 0,done:!0}}return S.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:S,configurable:!0}),S.displayName=u(v,d,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,d,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},T(E.prototype),u(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,a,i,o){void 0===o&&(o=Promise);var r=new E(y(e,n,a,i),o);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},T(b),u(b,d,"Generator"),u(b,l,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var a in t)n.push(a);return n.reverse(),function e(){for(;n.length;){var a=n.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},t.values=w,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,a){return r.type="throw",r.arg=e,t.next=n,a&&(t.method="next",t.arg=void 0),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],r=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&o.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var r=i?i.completion:{};return r.type=e,r.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var i=a.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var a=n(7609)();e.exports=a;try{regeneratorRuntime=a}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{AdminPortal:()=>FD,AdminPortalRenderer:()=>VD,AppHolder:()=>C,CheckoutDialog:()=>GD,FronteggApp:()=>ND,HostedLogin:()=>MD,LoginBoxRenderer:()=>WD,createElement:()=>SD,defaultTheme:()=>jD,formatName:()=>gD,getThemeAdminByName:()=>xD,getThemeByName:()=>BD,initialize:()=>QD,mockFlagsList:()=>_D,restoreSearchParams:()=>hD,waitThemeSetter:()=>vD});var e={};n.r(e),n.d(e,{Delete:()=>Wr,Get:()=>xr,Patch:()=>jr,Post:()=>Vr,PostDownload:()=>zr,Put:()=>Br,extractHeadersFromOptions:()=>$r,getBaseUrl:()=>Nr,getMetadataHeaders:()=>Mr,getScopedTenant:()=>Fr});var t={};n.r(t),n.d(t,{FeatureFlags:()=>Jr,loadFeatureFlags:()=>Yr});var i={};n.r(i),n.d(i,{GetUserJwt:()=>Xr,getCurrentUserTenantsV1:()=>as,getCurrentUserTenantsV3:()=>ns,getUsersGroups:()=>ts,getUsersRoles:()=>es,getUsersV2:()=>Qr,getUsersV3:()=>Zr,sendResetBreachedPasswordEmails:()=>is,updateUserProfileV2:()=>os});var o={};n.r(o),n.d(o,{getHierarchyMetadata:()=>hs,getParentTenants:()=>ps,getParentTenantsById:()=>gs,getSubTenants:()=>ys,getSubTenantsAsTree:()=>fs,getTenants:()=>us,getTenantsUsersCount:()=>Ss,searchSubTenants:()=>vs,switchTenant:()=>ds});var r={};n.r(r),n.d(r,{loadEntitlements:()=>Qs,loadEntitlementsV2:()=>Zs});var s={};n.r(s),n.d(s,{AuthStrategyEnum:()=>Oa,MachineToMachineAuthStrategy:()=>Pa,OAuthLogout:()=>Dl,SocialLoginProviders:()=>ka,acceptInvitation:()=>kl,activateAccount:()=>Al,activateAccountV2:()=>bl,bulkCreateIPRestriction:()=>xs,changePhoneNumber:()=>Rd,changePhoneNumberWithVerification:()=>Ud,checkIfAllowToRememberMfaDevice:()=>td,createDomainRestriction:()=>Rs,createIPRestriction:()=>Gs,createOrUpdateSessionConfigrations:()=>xc,createSSOConfiguration:()=>sd,createSSOConfigurationByMetadata:()=>dd,createSSOConfigurationByMetadataUrl:()=>yd,createSSODomain:()=>pd,createSSOGroup:()=>md,createSamlGroup:()=>Ec,createTenantAccessToken:()=>Hc,createUserAccessToken:()=>Kc,deleteAllSessionsForUser:()=>jc,deleteDomainRestriction:()=>Ns,deleteIPRestriction:()=>js,deleteSSOConfiguration:()=>cd,deleteSSODomain:()=>gd,deleteSSOGroup:()=>bd,deleteSamlGroup:()=>kc,deleteSessionForUser:()=>Vc,deleteTenantAccessToken:()=>zc,deleteTenantApiToken:()=>Qc,deleteUserAccessToken:()=>$c,deleteUserApiToken:()=>Zc,deleteWebAuthnDevice:()=>xd,disableMFAAuthenticatorApp:()=>zl,disableMFASMS:()=>Kl,disableMFAWebAuthn:()=>ql,disableMfa:()=>Wl,enrollMFAAuthenticatorApp:()=>Fl,enrollMFAAuthenticatorAppForLogin:()=>Xl,enrollMFAAuthenticatorAppForLoginV2:()=>Ql,enrollMFASMS:()=>xl,enrollMFASMSForLogin:()=>ic,enrollMFASMSForLoginV2:()=>oc,enrollMFAWebAuthn:()=>jl,enrollMFAWebAuthnForLogin:()=>dc,enrollMFAWebAuthnForLoginV2:()=>uc,enrollMfa:()=>Nl,exchangeOAuthTokens:()=>Pd,exchangeOAuthTokensV2:()=>kd,forgotPassword:()=>Ul,generateLoginResponse:()=>ol,generateLoginResponseFromOAuthResponse:()=>dl,generateLoginResponseFromOAuthResponseV2:()=>ul,generateLoginResponseV2:()=>rl,generateLoginResponseV3:()=>cl,generateStepupSession:()=>qd,getActivateAccountStrategy:()=>Tl,getCaptchaPolicy:()=>Os,getCurrentUserSession:()=>Mc,getCurrentUserSessions:()=>Nc,getCurrentUserTenantsFunction:()=>cs,getCustomSocialLoginProvidersV1:()=>Uc,getDomainRestrictions:()=>Us,getDomainRestrictionsConfig:()=>Cs,getGlobalSecurityPolicy:()=>ms,getIPRestrictions:()=>Ms,getIPRestrictionsConfig:()=>Fs,getLockoutPolicy:()=>Es,getMFADevices:()=>Jl,getMFAStrategiesConfig:()=>Wd,getMeAndEntitlements:()=>Hd,getMeV2:()=>$d,getMfaPolicy:()=>As,getOidcConfiguration:()=>Oc,getPasswordConfigPolicy:()=>Ds,getPasswordHistoryPolicy:()=>Ps,getPublicAuthStrategiesConfigForAuthenticatedUser:()=>Bd,getSSOConfigurations:()=>rd,getSSODefaultRoles:()=>vd,getSSOGroups:()=>Td,getSSOPublicConfiguration:()=>Pc,getSamlConfiguration:()=>gc,getSamlRoles:()=>Ac,getSamlRolesGroups:()=>bc,getSamlVendorConfiguration:()=>vc,getSessionConfigurations:()=>Gc,getSocialLoginProviders:()=>Lc,getSocialLoginProvidersV2:()=>wc,getSocialLoginProvidersV2ForAuthenticatedUser:()=>Dc,getTabTenantFromSessionStorage:()=>ls,getTenantAccessTokensData:()=>Wc,getTenantApiTokensData:()=>Jc,getUserAccessTokensData:()=>Bc,getUserApiTokensData:()=>qc,getUserAuthorization:()=>zd,getUserById:()=>ed,getVendorConfig:()=>Rc,getVendorLockoutPolicy:()=>Is,getVendorMfaPolicy:()=>bs,getVendorPasswordHistoryPolicy:()=>Ls,getVendorPublicAuthStrategiesConfig:()=>jd,getWebAuthnDevices:()=>Gd,loadPasswordConfig:()=>Rl,login:()=>Sl,loginViaSocialLogin:()=>Cc,loginWithMfa:()=>hl,loginWithMfaV2:()=>ml,loginv2:()=>vl,logout:()=>wl,oidcPostLogin:()=>gl,oidcPostLoginV2:()=>Id,passwordlessPostLogin:()=>id,passwordlessPostLoginV2:()=>ad,passwordlessPreLogin:()=>nd,postLogin:()=>pl,preDisableMFASMS:()=>$l,preDisableMFAWebAuthn:()=>Hl,preEnrollMFAAuthenticatorApp:()=>Ml,preEnrollMFAAuthenticatorAppForLogin:()=>Yl,preEnrollMFASMS:()=>Gl,preEnrollMFASMSForLogin:()=>ac,preEnrollMFAWebAuthn:()=>Vl,preEnrollMFAWebAuthnForLogin:()=>cc,preLogin:()=>yl,preLoginV2:()=>Ed,preLoginWithIdpType:()=>fl,preVerifyMFAEmailCode:()=>ec,preVerifyMFASMSForLogin:()=>rc,preVerifyMFAWebAuthnForLogin:()=>yc,recoverMfaToken:()=>_l,refreshToken:()=>Ol,refreshTokenV2:()=>Pl,refreshTokenV3:()=>Ll,removeTabTenantFromSessionStorage:()=>ss,resendActivationEmail:()=>El,resendInvitationEmail:()=>Il,resetPassword:()=>Cl,resetPhoneNumber:()=>wd,revokeSessionsForUser:()=>Fc,saveLockoutPolicy:()=>ks,saveMfaPolicy:()=>Ts,savePasswordHistoryPolicy:()=>ws,setSSODefaultRoles:()=>hd,setTabTenantInSessionStorage:()=>rs,signUpUser:()=>_c,silentOAuthRefreshToken:()=>Ld,silentOAuthRefreshTokenV2:()=>Od,testCurrentIp:()=>Bs,testCurrentIpInAllowList:()=>Ws,updateDomainRestrictionConfig:()=>_s,updateIPRestrictionConfig:()=>Vs,updateSSOConfiguration:()=>ld,updateSSOConfigurationByMetadata:()=>ud,updateSSOConfigurationByMetadataUrl:()=>fd,updateSSOGroup:()=>Ad,updateSamlConfiguration:()=>Sc,updateSamlGroup:()=>Ic,updateSamlRoles:()=>Tc,updateSamlVendorMetadata:()=>hc,updateTenantApiTokensData:()=>Xc,updateUserApiTokensData:()=>Yc,validateSSODomain:()=>Sd,validateSamlDomain:()=>mc,verifyChangePhoneNumber:()=>Cd,verifyInviteToken:()=>od,verifyMFAAuthenticatorAppForLogin:()=>Zl,verifyMFAEmailCode:()=>tc,verifyMFAEmailCodeV2:()=>nc,verifyMFASMSForLogin:()=>sc,verifyMFASMSForLoginV2:()=>lc,verifyMFAWebAuthnForLogin:()=>fc,verifyMFAWebAuthnForLoginV2:()=>pc,verifyMfa:()=>Bl,verifyNewDeviceSession:()=>Vd,verifyResetPhoneNumber:()=>Dd,webAuthnCreateNewDeviceSession:()=>Fd,webAuthnPostLogin:()=>Nd,webAuthnPostLoginV2:()=>Md,webAuthnPreLogin:()=>_d});var l={};n.r(l),n.d(l,{addUser:()=>eu,changePassword:()=>Qd,createInviteUserLink:()=>ru,deleteInviteUserLink:()=>lu,deleteUser:()=>tu,getInviteLinkConfiguration:()=>du,getInviteUserLink:()=>cu,getProfile:()=>Jd,getTemporaryUserConfiguration:()=>ou,loadAvailablePermissions:()=>yu,loadAvailableRoles:()=>uu,loadStats:()=>fu,loadUsers:()=>Zd,resendActivationLink:()=>pu,resendInvitationLink:()=>gu,resendInvitationLinkToAllTenants:()=>Su,setPermanentUser:()=>iu,updateInviteUserLink:()=>su,updateProfile:()=>Yd,updateProfileImage:()=>Xd,updateUser:()=>nu,updateUserExpirationTime:()=>au});var c={};n.r(c),n.d(c,{getAdminBoxMetadata:()=>hu,getAuditsMetadata:()=>Eu,getCurrentUserIpMetadata:()=>Au,getIpAdressMetadata:()=>Iu,getNotificationsMetadata:()=>bu,getSamlMetadata:()=>Tu,updateAdminBoxMetadata:()=>mu});var d={};n.r(d),n.d(d,{downloadReport:()=>Cu,getReport:()=>wu,getReports:()=>Lu,renderReport:()=>Du,scheduleReport:()=>Uu,sendReport:()=>Ru});var u={};n.r(u),n.d(u,{getNotifications:()=>_u,markAllAsRead:()=>Fu,updateNotificationIsPinned:()=>Mu,updateNotificationStatus:()=>Nu});var y={};n.r(y),n.d(y,{exportAudits:()=>ju,getAudits:()=>xu,getAuditsStats:()=>Vu});var f={};n.r(f),n.d(f,{deleteEmailConfiguration:()=>ty,deleteEmailSubscriptions:()=>Zu,deleteSMSConfiguration:()=>sy,deleteSMSSubscriptions:()=>oy,deleteSlackConfiguration:()=>qu,deleteWebhooksConfiguration:()=>dy,getCategories:()=>py,getChannelMaps:()=>gy,getEmailConfiguration:()=>Yu,getSMSConfiguration:()=>ny,getSlackChannels:()=>Ku,getSlackConfiguration:()=>zu,getSlackScope:()=>$u,getWebhookLog:()=>uy,getWebhooksConfigurations:()=>ly,patchEmailConfiguration:()=>Qu,patchSMSConfiguration:()=>iy,postEmailConfiguration:()=>Xu,postSMSConfiguration:()=>ay,postSlackCode:()=>Ju,postSlackConfiguration:()=>Hu,postWebhookRetry:()=>fy,postWebhookTest:()=>yy,postWebhooksConfiguration:()=>cy,putEmailSubscriptions:()=>ey,putSMSSubscriptions:()=>ry});var p={};n.r(p),n.d(p,{getPublicSettings:()=>hy,getSettings:()=>vy,updateSettings:()=>Sy});var g={};n.r(g),n.d(g,{addRole:()=>Ey,addRoleV2:()=>Dy,attachPermissionToRoles:()=>Ly,attachPermissionsToRole:()=>Oy,deleteRole:()=>Iy,getPermissionCategories:()=>wy,getPermissions:()=>Py,getRoles:()=>Ty,updateRole:()=>ky});var S={};n.r(S),n.d(S,{ISubscriptionCancellationPolicy:()=>cf,ISubscriptionStatus:()=>sf,PaymentMethodType:()=>lf,ProviderType:()=>df,TenantCreatedAction:()=>yf,TrialEndAction:()=>uf,cancelManagedSubscription:()=>Gy,cancelSubscription:()=>Ry,createStripeCustomer:()=>Qy,createStripePaymentMethodSetupIntentSecret:()=>ef,createSubscription:()=>Yy,createTenantConfiguration:()=>af,getManagedSubscription:()=>My,getManagedSubscriptions:()=>Fy,getPaymentMethod:()=>qy,getPaymentMethods:()=>Hy,getPaymentProviders:()=>of,getStripeCustomer:()=>Xy,getStripePaymentProviderConfiguration:()=>Zy,getSubscription:()=>Cy,getSubscriptionInvoice:()=>zy,getSubscriptionInvoicePdf:()=>$y,getSubscriptionInvoices:()=>Wy,getSubscriptionPlan:()=>By,getSubscriptionPlans:()=>jy,getSubscriptionSummaries:()=>tf,getSubscriptions:()=>Uy,getTenantConfiguration:()=>nf,getVendorPublicConfigurations:()=>rf,renewManagedSubscription:()=>xy,renewSubscription:()=>_y,updateManagedSubscription:()=>Vy,updatePaymentMethodBillingDetails:()=>Jy,updateSubscription:()=>Ny});var v={};n.r(v),n.d(v,{assignUserToApplications:()=>vf,getApplicationsData:()=>Sf,getTenantsApplications:()=>gf,getUserApplicationsId:()=>ff,getUsersApplicationsId:()=>pf,getUsersOfApplications:()=>mf,unassignUserFromApplications:()=>hf});var h={};n.r(h),n.d(h,{getVendorPublicInfo:()=>Af});var m={};n.r(m),n.d(m,{addUserRolesForSubTenants:()=>If,addUserToTenantAndSubTenants:()=>Tf,addUsersToSubTenant:()=>Uf,createSubTenant:()=>Pf,deleteSubTenant:()=>Lf,loadAllUsers:()=>bf,removeUserFromTenantAndSubTenants:()=>Ef,removeUserRolesFromSubTenants:()=>kf,setUserRolesForSubTenants:()=>Of,updateSubAccountAccess:()=>Df,updateSubTenant:()=>wf});var A={};n.r(A),n.d(A,{countConfigurationUsers:()=>Mf,createConfiguration:()=>_f,deleteConfiguration:()=>Nf,getConfigs:()=>Cf,updateConfiguration:()=>Rf});var b={};n.r(b),n.d(b,{impersonate:()=>Ff});var T={};n.r(T),n.d(T,{addRolesToGroup:()=>$f,addUsersToGroup:()=>Hf,createGroup:()=>Bf,deleteGroup:()=>zf,deleteRolesFromGroup:()=>Kf,deleteUsersFromGroup:()=>qf,getGroupById:()=>xf,getGroupConfiguration:()=>Jf,getGroups:()=>Vf,getGroupsByIds:()=>jf,updateGroup:()=>Wf,updateGroupConfiguration:()=>Yf});var E={};n.r(E),n.d(E,{getInsights:()=>Qf,getRecommendations:()=>Xf});var I={};n.r(I),n.d(I,{createPhoneNumber:()=>ep,deletePhoneNumber:()=>tp,getUserPhoneNumbers:()=>Zf,preVerifyPhoneNumber:()=>np,verifyDeletePhoneNumber:()=>ip,verifyPhoneNumber:()=>ap});var k={};n.r(k),n.d(k,{ADMIN_PORTAL_ENTITLEMENTS_FF:()=>tl,ApplicationAccessType:()=>Ep,AuthStrategyEnum:()=>Oa,ContextHolder:()=>zo,FeatureFlags:()=>Jr,FronteggApiError:()=>Ko,FronteggContext:()=>$o,FronteggFrameworks:()=>ya,GetUsersFilterPreset:()=>ga,GroupManagedByEnum:()=>vp,GroupRelations:()=>Sp,ISubscriptionCancellationPolicy:()=>cf,ISubscriptionStatus:()=>sf,InsightCode:()=>mp,LOAD_AUTHORIZATION_FF:()=>Xs,MFAStrategyEnum:()=>Ys,MachineToMachineAuthStrategy:()=>Pa,NotEntitledJustification:()=>el,PaginationOrderEnum:()=>fa,PaymentMethodType:()=>lf,PermissionAssignmentTypeEnum:()=>lp,ProviderType:()=>df,RecommendationActionKey:()=>Ap,RecommendationCode:()=>hp,RecommendationSeverity:()=>bp,RequestSource:()=>ua,RestrictionType:()=>Kn,ScimConnectionSource:()=>gp,SecondaryAuthStrategy:()=>qs,SecurityCategory:()=>Tp,SocialLoginProviders:()=>ka,SortByEnum:()=>pa,TenantSortByEnum:()=>rp,TenantType:()=>sp,USE_ENTITLEMENTS_V2_ENDPOINT_FF:()=>Hr,UserManagedByEnum:()=>op,WebAuthnDeviceType:()=>Js,api:()=>Ip,countConfigurationUsers:()=>Mf,createConfiguration:()=>_f,default:()=>kp,deleteConfiguration:()=>Nf,fetch:()=>e,fronteggAuthApiRoutesRegex:()=>cp,fronteggHeaders:()=>da,fronteggRefreshTokenUrl:()=>dp,fronteggSilentRefreshTokenUrl:()=>up,fronteggTenantsUrl:()=>fp,fronteggTenantsV3Url:()=>pp,fronteggUsersUrl:()=>yp,getConfigs:()=>Cf,getCurrentUserTenantsFunction:()=>cs,getTabTenantFromSessionStorage:()=>ls,loadFeatureFlags:()=>Yr,providersArray:()=>Sa,setTabTenantInSessionStorage:()=>rs,updateConfiguration:()=>Rf});var O={};function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function w(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t);if("object"!==L(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===L(t)?t:String(t)}function D(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,w(a.key),a)}}function U(e,t,n){return t&&D(e.prototype,t),n&&D(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.r(O),n.d(O,{AccountDetailsPageTabs:()=>DD,AccountPageFields:()=>ED,DomainRestrictionsTabFields:()=>wD,GeneralSettingsTabFields:()=>PD,InviteUserModalFields:()=>TD,IpRestrictionsTabFields:()=>LD,Metadata:()=>pD,PrivacyPageFields:()=>bD,ProfilePageFields:()=>AD,SecurityPageTabs:()=>kD,SessionManagementTabFields:()=>OD,SignupFields:()=>mD,SubscriptionsPageFields:()=>ID,alpha:()=>sD,fieldAppearance:()=>UD,tabAppearance:()=>CD});var C=function(){function e(){P(this,e)}return U(e,null,[{key:"setInstance",value:function(t,n){e._apps[t]=n}},{key:"getInstance",value:function(t){var n=e._apps[t];if(!n)throw Error("[".concat(t,"] FronteggApp not found"));return n}}]),e}();function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,o,r,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t,n,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,i)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function r(e){N(o,a,i,r,s,"next",e)}function s(e){N(o,a,i,r,s,"throw",e)}r(void 0)}))}}C._apps={};var F=n(2841),G=n.n(F);function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},x.apply(this,arguments)}function V(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function j(e){return!!e&&!!e[Pe]}function B(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Le}(e)||Array.isArray(e)||!!e[Oe]||!!e.constructor[Oe]||q(e)||J(e))}function W(e,t,n){void 0===n&&(n=!1),0===z(e)?(n?Object.keys:we)(e).forEach((function(a){n&&"symbol"==typeof a||t(a,e[a],e)})):e.forEach((function(n,a){return t(a,n,e)}))}function z(e){var t=e[Pe];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:q(e)?2:J(e)?3:0}function $(e,t){return 2===z(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function K(e,t,n){var a=z(e);2===a?e.set(t,n):3===a?(e.delete(t),e.add(n)):e[t]=n}function H(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function q(e){return Te&&e instanceof Map}function J(e){return Ee&&e instanceof Set}function Y(e){return e.o||e.t}function X(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=De(e);delete t[Pe];for(var n=we(t),a=0;a<n.length;a++){var i=n[a],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function Q(e,t){return void 0===t&&(t=!1),ee(e)||j(e)||!B(e)||(z(e)>1&&(e.set=e.add=e.clear=e.delete=Z),Object.freeze(e),t&&W(e,(function(e,t){return Q(t,!0)}),!0)),e}function Z(){V(2)}function ee(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function te(e){var t=Ue[e];return t||V(18,e),t}function ne(){return Ae}function ae(e,t){t&&(te("Patches"),e.u=[],e.s=[],e.v=t)}function ie(e){oe(e),e.p.forEach(se),e.p=null}function oe(e){e===Ae&&(Ae=e.l)}function re(e){return Ae={p:[],l:Ae,h:e,m:!0,_:0}}function se(e){var t=e[Pe];0===t.i||1===t.i?t.j():t.O=!0}function le(e,t){t._=t.p.length;var n=t.p[0],a=void 0!==e&&e!==n;return t.h.g||te("ES5").S(t,e,a),a?(n[Pe].P&&(ie(t),V(4)),B(e)&&(e=ce(t,e),t.l||ue(t,e)),t.u&&te("Patches").M(n[Pe].t,e,t.u,t.s)):e=ce(t,n,[]),ie(t),t.u&&t.v(t.u,t.s),e!==ke?e:void 0}function ce(e,t,n){if(ee(t))return t;var a=t[Pe];if(!a)return W(t,(function(i,o){return de(e,a,t,i,o,n)}),!0),t;if(a.A!==e)return t;if(!a.P)return ue(e,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var i=4===a.i||5===a.i?a.o=X(a.k):a.o;W(3===a.i?new Set(i):i,(function(t,o){return de(e,a,i,t,o,n)})),ue(e,i,!1),n&&e.u&&te("Patches").R(a,n,e.u,e.s)}return a.o}function de(e,t,n,a,i,o){if(j(i)){var r=ce(e,i,o&&t&&3!==t.i&&!$(t.D,a)?o.concat(a):void 0);if(K(n,a,r),!j(r))return;e.m=!1}if(B(i)&&!ee(i)){if(!e.h.F&&e._<1)return;ce(e,i),t&&t.A.l||ue(e,i)}}function ue(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Q(t,n)}function ye(e,t){var n=e[Pe];return(n?Y(n):e)[t]}function fe(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Object.getPrototypeOf(n)}}function pe(e){e.P||(e.P=!0,e.l&&pe(e.l))}function ge(e){e.o||(e.o=X(e.t))}function Se(e,t,n){var a=q(t)?te("MapSet").N(t,n):J(t)?te("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),a={i:n?1:0,A:t?t.A:ne(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=a,o=Ce;n&&(i=[a],o=Re);var r=Proxy.revocable(i,o),s=r.revoke,l=r.proxy;return a.k=l,a.j=s,l}(t,n):te("ES5").J(t,n);return(n?n.A:ne()).p.push(a),a}function ve(e){return j(e)||V(22,e),function e(t){if(!B(t))return t;var n,a=t[Pe],i=z(t);if(a){if(!a.P&&(a.i<4||!te("ES5").K(a)))return a.t;a.I=!0,n=he(t,i),a.I=!1}else n=he(t,i);return W(n,(function(t,i){a&&function(e,t){return 2===z(e)?e.get(t):e[t]}(a.t,t)===i||K(n,t,e(i))})),3===i?new Set(n):n}(e)}function he(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return X(e)}var me,Ae,be="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Te="undefined"!=typeof Map,Ee="undefined"!=typeof Set,Ie="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ke=be?Symbol.for("immer-nothing"):((me={})["immer-nothing"]=!0,me),Oe=be?Symbol.for("immer-draftable"):"__$immer_draftable",Pe=be?Symbol.for("immer-state"):"__$immer_state",Le=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),we="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,De=Object.getOwnPropertyDescriptors||function(e){var t={};return we(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Ue={},Ce={get:function(e,t){if(t===Pe)return e;var n=Y(e);if(!$(n,t))return function(e,t,n){var a,i=fe(t,n);return i?"value"in i?i.value:null===(a=i.get)||void 0===a?void 0:a.call(e.k):void 0}(e,n,t);var a=n[t];return e.I||!B(a)?a:a===ye(e.t,t)?(ge(e),e.o[t]=Se(e.A.h,a,e)):a},has:function(e,t){return t in Y(e)},ownKeys:function(e){return Reflect.ownKeys(Y(e))},set:function(e,t,n){var a=fe(Y(e),t);if(null==a?void 0:a.set)return a.set.call(e.k,n),!0;if(!e.P){var i=ye(Y(e),t),o=null==i?void 0:i[Pe];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(H(n,i)&&(void 0!==n||$(e.t,t)))return!0;ge(e),pe(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ye(e.t,t)||t in e.t?(e.D[t]=!1,ge(e),pe(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Y(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:a.enumerable,value:n[t]}:a},defineProperty:function(){V(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){V(12)}},Re={};W(Ce,(function(e,t){Re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Re.deleteProperty=function(e,t){return Re.set.call(this,e,t,void 0)},Re.set=function(e,t,n){return Ce.set.call(this,e[0],t,n,e[0])};var _e=function(){function e(e){var t=this;this.g=Ie,this.F=!0,this.produce=function(e,n,a){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var o=t;return function(e){var t=this;void 0===e&&(e=i);for(var a=arguments.length,r=Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return o.produce(e,(function(e){var a;return(a=n).call.apply(a,[t,e].concat(r))}))}}var r;if("function"!=typeof n&&V(6),void 0!==a&&"function"!=typeof a&&V(7),B(e)){var s=re(t),l=Se(t,e,void 0),c=!0;try{r=n(l),c=!1}finally{c?ie(s):oe(s)}return"undefined"!=typeof Promise&&r instanceof Promise?r.then((function(e){return ae(s,a),le(e,s)}),(function(e){throw ie(s),e})):(ae(s,a),le(r,s))}if(!e||"object"!=typeof e){if(void 0===(r=n(e))&&(r=e),r===ke&&(r=void 0),t.F&&Q(r,!0),a){var d=[],u=[];te("Patches").M(e,r,d,u),a(d,u)}return r}V(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var a=arguments.length,i=Array(a>1?a-1:0),o=1;o<a;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))};var a,i,o=t.produce(e,n,(function(e,t){a=e,i=t}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(e){return[e,a,i]})):[o,a,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){B(e)||V(8),j(e)&&(e=ve(e));var t=re(this),n=Se(this,e,void 0);return n[Pe].C=!0,oe(t),n},t.finishDraft=function(e,t){var n=(e&&e[Pe]).A;return ae(n,t),le(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Ie&&V(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var a=t[n];if(0===a.path.length&&"replace"===a.op){e=a.value;break}}n>-1&&(t=t.slice(n+1));var i=te("Patches").$;return j(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),Ne=new _e,Me=Ne.produce;Ne.produceWithPatches.bind(Ne),Ne.setAutoFreeze.bind(Ne),Ne.setUseProxies.bind(Ne),Ne.applyPatches.bind(Ne),Ne.createDraft.bind(Ne),Ne.finishDraft.bind(Ne);const Fe=Me;function Ge(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){Ge(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function je(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Be="function"==typeof Symbol&&Symbol.observable||"@@observable",We=function(){return Math.random().toString(36).substring(7).split("").join(".")},ze={INIT:"@@redux/INIT"+We(),REPLACE:"@@redux/REPLACE"+We(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+We()}};function $e(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ke(e,t,n){var a;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(je(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(je(1));return n(Ke)(e,t)}if("function"!=typeof e)throw new Error(je(2));var i=e,o=t,r=[],s=r,l=!1;function c(){s===r&&(s=r.slice())}function d(){if(l)throw new Error(je(3));return o}function u(e){if("function"!=typeof e)throw new Error(je(4));if(l)throw new Error(je(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(je(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),r=null}}}function y(e){if(!$e(e))throw new Error(je(7));if(void 0===e.type)throw new Error(je(8));if(l)throw new Error(je(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=r=s,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(je(10));i=e,y({type:ze.REPLACE})}function p(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(je(11));function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[Be]=function(){return this},e}return y({type:ze.INIT}),(a={dispatch:y,subscribe:u,getState:d,replaceReducer:f})[Be]=p,a}function He(e){for(var t=Object.keys(e),n={},a=0;a<t.length;a++){var i=t[a];"function"==typeof e[i]&&(n[i]=e[i])}var o,r=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:ze.INIT}))throw new Error(je(12));if(void 0===n(void 0,{type:ze.PROBE_UNKNOWN_ACTION()}))throw new Error(je(13))}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var a=!1,i={},s=0;s<r.length;s++){var l=r[s],c=n[l],d=e[l],u=c(d,t);if(void 0===u)throw t&&t.type,new Error(je(14));i[l]=u,a=a||u!==d}return(a=a||r.length!==Object.keys(e).length)?i:e}}function qe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),a=function(){throw new Error(je(15))},i={getState:n.getState,dispatch:function(){return a.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return a=qe.apply(void 0,o)(n.dispatch),Ve(Ve({},n),{},{dispatch:a})}}}function Ye(e){return function(t){var n=t.dispatch,a=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,a,e):t(i)}}}}var Xe=Ye();Xe.withExtraArgument=Ye;const Qe=Xe;var Ze,et=(Ze=function(e,t){return Ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ze(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ze(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),tt=function(e,t){for(var n=0,a=t.length,i=e.length;n<a;n++,i++)e[i]=t[n];return e},nt=Object.defineProperty,at=(Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols),it=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,rt=function(e,t,n){return t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},st=function(e,t){for(var n in t||(t={}))it.call(t,n)&&rt(e,n,t[n]);if(at)for(var a=0,i=at(t);a<i.length;a++)n=i[a],ot.call(t,n)&&rt(e,n,t[n]);return e},lt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?qe:qe.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var ct=function(e){function t(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return et(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,tt([void 0],e[0].concat(this)))):new(t.bind.apply(t,tt([void 0],e.concat(this))))},t}(Array);function dt(e){return B(e)?Fe(e,(function(){})):e}function ut(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,a=(e.immutableCheck,e.serializableCheck,new ct);return n&&(function(e){return"boolean"==typeof e}(n)?a.push(Qe):a.push(Qe.withExtraArgument(n.extraArgument))),a}function yt(e){var t,n=function(e){return ut(e)},a=e||{},i=a.reducer,o=void 0===i?void 0:i,r=a.middleware,s=void 0===r?n():r,l=a.devTools,c=void 0===l||l,d=a.preloadedState,u=void 0===d?void 0:d,y=a.enhancers,f=void 0===y?void 0:y;if("function"==typeof o)t=o;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=He(o)}var p=s;"function"==typeof p&&(p=p(n));var g=Je.apply(void 0,p),S=qe;c&&(S=lt(st({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=tt([g],f):"function"==typeof f&&(v=f(v)),Ke(t,u,S.apply(void 0,v))}function ft(e,t){function n(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return st(st({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function pt(e){var t,n={},a=[],i={addCase:function(e,t){var a="string"==typeof e?e:e.type;if(a in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[a]=t,i},addMatcher:function(e,t){return a.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,a,t]}function gt(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,a="function"==typeof e.initialState?e.initialState:dt(e.initialState),i=e.reducers||{},o=Object.keys(i),r={},s={},l={};function c(){var t="function"==typeof e.extraReducers?pt(e.extraReducers):[e.extraReducers],n=t[0],i=void 0===n?{}:n,o=t[1],r=void 0===o?[]:o,l=t[2],c=void 0===l?void 0:l,d=st(st({},i),s);return function(e,t,n,a){void 0===n&&(n=[]);var i,o="function"==typeof t?pt(t):[t,n,a],r=o[0],s=o[1],l=o[2];if(function(e){return"function"==typeof e}(e))i=function(){return dt(e())};else{var c=dt(e);i=function(){return c}}function d(e,t){void 0===e&&(e=i());var n=tt([r[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[l]),n.reduce((function(e,n){if(n){var a;if(j(e))return void 0===(a=n(e,t))?e:a;if(B(e))return Fe(e,(function(e){return n(e,t)}));if(void 0===(a=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return a}return e}),e)}return d.getInitialState=i,d}(a,d,r,c)}return o.forEach((function(e){var n,a,o=i[e],c=t+"/"+e;"reducer"in o?(n=o.reducer,a=o.prepare):n=o,r[e]=n,s[c]=n,l[e]=a?ft(c,a):ft(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:l,caseReducers:r,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}Object.assign;var St="listenerMiddleware";ft(St+"/add"),ft(St+"/removeAll"),ft(St+"/remove"),function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Pe];return Ce.get(t,e)},set:function(t){var n=this[Pe];Ce.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][Pe];if(!i.P)switch(i.i){case 5:a(i)&&pe(i);break;case 4:n(i)&&pe(i)}}}function n(e){for(var t=e.t,n=e.k,a=we(n),i=a.length-1;i>=0;i--){var o=a[i];if(o!==Pe){var r=t[o];if(void 0===r&&!$(t,o))return!0;var s=n[o],l=s&&s[Pe];if(l?l.t!==r:!H(s,r))return!0}}var c=!!t[Pe];return a.length!==we(t).length+(c?0:1)}function a(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var a=0;a<t.length;a++)if(!t.hasOwnProperty(a))return!0;return!1}var i={};!function(e,t){Ue[e]||(Ue[e]=t)}("ES5",{J:function(t,n){var a=Array.isArray(t),i=function(t,n){if(t){for(var a=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(a,""+i,e(i,!0));return a}var o=De(n);delete o[Pe];for(var r=we(o),s=0;s<r.length;s++){var l=r[s];o[l]=e(l,t||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(a,t),o={i:a?5:4,A:n?n.A:ne(),P:!1,I:!1,D:{},l:n,t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Pe,{value:o,writable:!0}),i},S:function(e,n,i){i?j(n)&&n[Pe].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Pe];if(n){var i=n.t,o=n.k,r=n.D,s=n.i;if(4===s)W(o,(function(t){t!==Pe&&(void 0!==i[t]||$(i,t)?r[t]||e(o[t]):(r[t]=!0,pe(n)))})),W(i,(function(e){void 0!==o[e]||$(o,e)||(r[e]=!1,pe(n))}));else if(5===s){if(a(n)&&(pe(n),r.length=!0),o.length<i.length)for(var l=o.length;l<i.length;l++)r[l]=!1;else for(var c=i.length;c<o.length;c++)r[c]=!0;for(var d=Math.min(o.length,i.length),u=0;u<d;u++)o.hasOwnProperty(u)||(r[u]=!0),void 0===r[u]&&e(o[u])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):a(e)}})}();const vt=(e,t)=>n=>x({},n,{[e]:t[e]}),ht=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>x({},t,{[e]:x({},t[e],n)})}),mt=(e,t)=>({prepare:e=>({payload:e}),reducer:(n,{payload:a})=>{var i;return x({},n,{[e]:x({},n[e],{[t]:x({},null==n||null==(i=n[e])?void 0:i[t],a)})})}}),At=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>{var a,i;return x({},t,{[e]:x({},t[e],{loaders:x({},null==(a=t[e])?void 0:a.loaders,{[n.key]:null==(i=n.value)||i})})})}}),bt=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>{var a;return x({},t,{[e]:x({},t[e],{errors:x({},t[e].errors,{[n.key]:null==(a=n.value)||a})})})}}),Tt=(e,t,n)=>({prepare:e=>({payload:e}),reducer:(a,{payload:i})=>{var o;return x({},a,{[e]:x({},a[e],{[t]:x({},null==a||null==(o=a[e])?void 0:o[t],i,n)})})}}),Et=(e,t,n)=>a=>{var i;return x({},a,{[e]:x({},a[e],{[t]:x({},null==a||null==(i=a[e])?void 0:i[t],n)})})},It=(e=500)=>new Promise((t=>setTimeout(t,e))),kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Ot=new Uint8Array(256);for(let e=0;e<kt.length;e++)Ot[kt.charCodeAt(e)]=e;const Pt=e=>{const t=.75*e.length,n=e.length;let a,i,o,r,s,l=0;const c=new Uint8Array(t);for(a=0;a<n;a+=4)i=Ot[e.charCodeAt(a)],o=Ot[e.charCodeAt(a+1)],r=Ot[e.charCodeAt(a+2)],s=Ot[e.charCodeAt(a+3)],c[l++]=i<<2|o>>4,c[l++]=(15&o)<<4|r>>2,c[l++]=(3&r)<<6|63&s;return c.buffer},Lt=e=>{if(e instanceof Array){const t=[];for(const n of e)t.push(Lt(n));return t}if(e instanceof ArrayBuffer)return(e=>{const t=new Uint8Array(e),n=t.length;let a,i="";for(a=0;a<n;a+=3)i+=kt[t[a]>>2],i+=kt[(3&t[a])<<4|t[a+1]>>4],i+=kt[(15&t[a+1])<<2|t[a+2]>>6],i+=kt[63&t[a+2]];return n%3==2?i=i.substring(0,i.length-1):n%3==1&&(i=i.substring(0,i.length-2)),i})(e);if(e instanceof Object){const t={};for(const n in e)t[n]=Lt(e[n]);return t}return e};let wt,Dt,Ut,Ct;!function(e){e.preLogin="preLogin",e.magicLinkPreLoginSuccess="magicLinkPreLoginSuccess",e.loginWithSmsOtc="loginWithSmsOtc",e.loginWithQuickSmsOtc="loginWithQuickSmsOtc",e.loginWithOtc="loginWithOtc",e.loginWithPassword="loginWithPassword",e.loginWithTwoFactor="loginWithTwoFactor",e.redirectToSSO="redirectToSSO",e.loginWithSSOFailed="loginWithSSOFailed",e.success="success",e.forceTwoFactor="forceTwoFactor",e.recoverTwoFactor="recoverTwoFactor",e.promptPasskeys="promptPasskeys",e.breachedPassword="breachedPassword",e.breachedPasswordSuccess="breachedPasswordSuccess"}(wt||(wt={})),function(e){e.Login="login",e.RegisterQuickLogin="registerQuickLogin"}(Dt||(Dt={})),function(e){e.Internal="internal",e.UsbKey="usb-key",e.Android="android",e.Sms="sms"}(Ut||(Ut={})),function(e){e["social-login"]="social-login",e["custom-social-login"]="custom-social-login",e.direct="direct"}(Ct||(Ct={}));const Rt="FRONTEGG_AFTER_AUTH_REDIRECT_URL",_t="HOSTED_LOGIN_VERIFIER_KEY",Nt="auth",Mt="connectivity",Ft="auditLogs",Gt="vendor",xt={flow:Dt.Login,step:wt.preLogin,loading:!1,email:"",tenants:[]},Vt={setLoginState:ht("loginState"),resetLoginState:vt("loginState",{loginState:xt})},jt={requestAuthorize:ft("auth/requestAuthorize",((e=!1)=>({payload:e}))),requestAuthorizeSSR:ft("auth/requestAuthorizeSSR",(e=>({payload:e}))),requestHostedLoginAuthorize:ft("auth/requestHostedLoginAuthorize",(e=>({payload:e}))),requestHostedLoginAuthorizeV2:ft("auth/requestHostedLoginAuthorizeV2",(e=>({payload:e}))),handleHostedLoginCallback:ft("auth/handleHostedLoginCallback",(e=>({payload:e}))),afterAuthNavigation:ft("auth/afterAuthNavigation"),preLogin:ft("auth/preLogin",(e=>({payload:e}))),postLogin:ft("auth/postLogin",(e=>({payload:e}))),login:ft("auth/login",(e=>({payload:e}))),loginWithMfa:ft("auth/loginWithMfa",(e=>({payload:e}))),recoverMfa:ft("auth/recoverMfa",(e=>({payload:e}))),logout:ft("auth/logout",(e=>({payload:e}))),silentLogout:ft("auth/silentLogout",(e=>({payload:e}))),checkIfAllowToRememberMfaDevice:ft("auth/checkIfAllowToRememberMfaDevice",(e=>({payload:e}))),changePhoneNumberWithVerification:ft("auth/changePhoneNumberWithVerification",(e=>({payload:e}))),verifyChangePhoneNumber:ft("auth/verifyChangePhoneNumber",(e=>({payload:e}))),quickSmsPasswordlessPreLogin:ft("auth/quickSmsPasswordlessPreLogin",(e=>({payload:e}))),passwordlessPreLogin:ft("auth/passwordlessPreLogin",(e=>({payload:e}))),passwordlessPostLogin:ft("auth/passwordlessPostLogin",(e=>({payload:e}))),verifyInviteToken:ft("auth/verifyInviteToken",(e=>({payload:e}))),webAuthnPrelogin:ft("auth/webAuthnPrelogin",(e=>({payload:e}))),webAuthnPostLogin:ft("auth/webAuthnPostLogin",(e=>({payload:e}))),webAuthnCreateNewDeviceSession:ft("auth/webAuthnCreateNewDeviceSession",(e=>({payload:e}))),webAuthnVerifyNewDeviceSession:ft("auth/webAuthnVerifyNewDeviceSession",(e=>({payload:e}))),getUserIP:ft("auth/getUserIP",(e=>({payload:e}))),preEnrollMFAWebAuthnForLogin:ft("auth/preEnrollWebAuthNForLogin",(e=>({payload:e}))),enrollMFAWebAuthnForLogin:ft("auth/enrollWebAuthNForLogin",(e=>({payload:e}))),enrollMFAAuthenticatorAppForLogin:ft("auth/enrollMFAAuthenticatorAppForLogin",(e=>({payload:e}))),preEnrollMFASMSForLogin:ft("auth/preEnrollMFASMSForLogin",(e=>({payload:e}))),enrollMFASMSForLogin:ft("auth/enrollMFASMSForLogin",(e=>({payload:e}))),preVerifyMFAWebAuthnForLogin:ft("auth/preVerifyMFAWebAuthnForLogin",(e=>({payload:e}))),verifyMFAWebAuthnForLogin:ft("auth/verifyMFAWebAuthnForLogin",(e=>({payload:e}))),preVerifyMFASMSForLogin:ft("auth/preVerifyMFASMSForLogin",(e=>({payload:e}))),verifyMFASMSForLogin:ft("auth/verifyMFASMSForLogin",(e=>({payload:e}))),preVerifyMFAEmailCode:ft("auth/preVerifyMFAEmailCode",(e=>({payload:e}))),verifyMFAEmailCode:ft("auth/verifyMFAEmailCode",(e=>({payload:e}))),resetBreachedPassword:ft("auth/resetBreachedPassword",(e=>({payload:e})))};let Bt;!function(e){e.activating="activating",e.success="success",e.resend="resend",e.activatingForm="activatingForm"}(Bt||(Bt={}));const Wt={step:Bt.activating,loading:!1,resentEmail:!1,activationStrategy:{loading:!1}},zt={setActivateState:ht("activateState"),resetActivateState:vt("activateState",{activateState:Wt}),setActivateStrategyState:mt("activateState","activationStrategy")},$t={activateAccount:ft("auth/activateAccount",(e=>({payload:e}))),preActivateAccount:ft("auth/preActivateAccount",(e=>({payload:e}))),getActivateAccountStrategy:ft("auth/getActivateAccountStrategy",(e=>({payload:e}))),resendActivationEmail:ft("auth/resendActivationEmail",(e=>({payload:e})))};let Kt;!function(e){e.validate="validate",e.invalid="invalid",e.pending="pending",e.success="success",e.failed="failed"}(Kt||(Kt={}));const Ht={step:Kt.validate},qt={setAcceptInvitationState:ht("acceptInvitationState"),resetAcceptInvitationState:vt("acceptInvitationState",{acceptInvitationState:Ht})},Jt={acceptInvitation:ft("auth/acceptInvitation",(e=>({payload:e})))};let Yt;!function(e){e.forgotPassword="forgotPassword",e.success="success"}(Yt||(Yt={}));const Xt={step:Yt.forgotPassword,loading:!1,email:"",passwordConfig:null},Qt={setForgotPasswordState:ht("forgotPasswordState"),resetForgotPasswordState:vt("forgotPasswordState",{forgotPasswordState:Xt})},Zt={forgotPassword:ft("auth/forgotPassword",(e=>({payload:e}))),resetPassword:ft("auth/resetPassword",(e=>({payload:e}))),loadPasswordConfig:ft("auth/loadPasswordConfig",(e=>({payload:e})))};let en;!function(e){e.ResetPhoneNumber="ResetPhoneNumber",e.VerifyResetPhoneNumber="VerifyResetPhoneNumber",e.ChangePhoneNumber="ChangePhoneNumber"}(en||(en={}));const tn={step:en.ResetPhoneNumber,loading:!1},nn={setResetPhoneNumberState:ht("resetPhoneNumberState"),resetResetPhoneNumberState:vt("resetPhoneNumberState",{resetPhoneNumberState:tn})},an={resetPhoneNumber:ft("auth/resetPhoneNumber",(e=>({payload:e}))),verifyResetPhoneNumber:ft("auth/verifyResetPhoneNumber",(e=>({payload:e}))),changePhoneNumber:ft("auth/changePhoneNumber",(e=>({payload:e})))},on={firstLoad:!0,loading:!0,saving:!1,errors:{},loaders:{},ssoConfigurations:[]},rn={setSSOLoader:At("ssoState"),setSSOError:bt("ssoState"),setSSOState:ht("ssoState"),resetSSOState:vt("ssoState",{ssoState:on})},sn={loadSSOConfigurationsV2:ft("auth/loadSSOConfigurationsV2"),saveSSOConfigurationV2:ft("auth/saveSSOConfigurationV2",(e=>({payload:e}))),updateSSOConfiguration:ft("auth/updateSSOConfiguration",(e=>({payload:e}))),deleteSSOConfiguration:ft("auth/deleteSSOConfiguration",(e=>({payload:e}))),saveSSODomain:ft("auth/saveSSODomain",(e=>({payload:e}))),deleteSSODomain:ft("auth/deleteSSODomain",(e=>({payload:e}))),validateSSODomainV2:ft("auth/validateSSODomainV2",(e=>({payload:e}))),setSSODefaultRoles:ft("auth/setSSODefaultRoles",(e=>({payload:e}))),setSSOGroups:ft("auth/setSSOGroups",(e=>({payload:e}))),updateSSOGroups:ft("auth/updateSSOGroups",(e=>({payload:e}))),saveSSOConfigurationByMetadata:ft("auth/saveSSOConfigurationByMetadata",(e=>({payload:e}))),updateSSOConfigurationByMetadata:ft("auth/updateSSOConfigurationByMetadata",(e=>({payload:e}))),loadSSOConfigurations:ft("auth/loadSSOConfigurations"),loadSSOAuthorizationRoles:ft("auth/loadSSOAuthorizationRoles"),saveSSOConfigurations:ft("auth/saveSSOConfigurations",(e=>({payload:e}))),saveSSOConfigurationsFile:ft("auth/saveSSOConfigurationsFile",(e=>({payload:e}))),saveSSOConfigurationByData:ft("auth/saveSSOConfigurationByData",(e=>({payload:e}))),saveSSOConfigurationByUrl:ft("auth/saveSSOConfigurationByUrl",(e=>({payload:e}))),saveSSOConfigurationsFileWithCallback:ft("auth/saveSSOConfigurationsFileWithCallback",(e=>({payload:e}))),validateSSODomain:ft("auth/validateSSODomain",(e=>({payload:e}))),updateSSOAuthorizationRoles:ft("auth/updateSSOAuthorizationRoles",(e=>({payload:e}))),deleteSamlGroup:ft("auth/deleteSamlGroup",(e=>({payload:e}))),createSamlGroup:ft("auth/createSamlGroup",(e=>({payload:e}))),oidcPostlogin:ft("auth/oidcPostlogin",(e=>({payload:e})))},ln={loading:!1,error:null},cn={setProfileState:ht("profileState"),resetProfileState:vt("profileState",{profileState:ln})},dn={loadProfile:ft("auth/loadProfile"),saveProfile:ft("auth/saveProfile",(e=>({payload:e}))),changePassword:ft("auth/changePassword",(e=>({payload:e})))};let un;!function(e){e.verify="verify",e.recoveryCode="recoveryCode",e.authenticatorApp="authenticatorApp",e.smsSetPhoneNumber="smsSetPhoneNumber",e.smsVerifyCode="smsVerifyCode",e.emailVerifyCode="emailVerifyCode",e.noMFAEnrolledStepUp="noMFAEnrolledStepUp"}(un||(un={}));const yn={step:un.verify,loading:!1,saving:!1},fn={setMfaState:ht("mfaState"),resetMfaState:vt("mfaState",{mfaState:yn})},pn={enrollMfa:ft("auth/enrollMfa"),getMFADevices:ft("auth/getMFADevices"),getMFAStrategies:ft("auth/getMFAStrategies"),verifyMfa:ft("auth/verifyMfa",(e=>({payload:e}))),verifyMfaAfterForce:ft("auth/verifyMfaAfterForce",(e=>({payload:e}))),disableMfa:ft("auth/disableMfa",(e=>({payload:e}))),preDisableMfaSms:ft("auth/preDisableMfaSms",(e=>({payload:e}))),disableMfaSms:ft("auth/disableMfaSms",(e=>({payload:e}))),preEnrollMfaSms:ft("auth/preEnrollMfaSms",(e=>({payload:e}))),enrollMfaSms:ft("auth/enrollMfaSms",(e=>({payload:e}))),preEnrollMfaWebAuthn:ft("auth/preEnrollMfaWebAuthn",(e=>({payload:e}))),enrollMfaWebAuthn:ft("auth/enrollMfaWebAuthn",(e=>({payload:e}))),preDisableMfaWebAuthn:ft("auth/preDisableMfaWebAuthn",(e=>({payload:e}))),disableMfaWebAuthn:ft("auth/disableMfaWebAuthn",(e=>({payload:e})))},gn={loaders:{},pageOffset:0,pageSize:20,errors:{},users:[],allUsers:[],roles:[],permissions:[],totalPages:0,shouldShowSubTenantUsersIfReseller:!1,allUsersQueryParams:{_filter:null,_offset:0,_limit:20,_order:"DESC",_sortBy:"name"},addUserDialogState:{loading:!1,open:!1},deleteUserDialogState:{loading:!1,open:!1},lockUserDialogState:{loading:!1,open:!1}},Sn={setTeamLoader:At("teamState"),setTeamError:bt("teamState"),setTeamState:ht("teamState"),resetTeamState:vt("teamState",{teamState:gn})},vn={loadUsersV2:ft("auth/loadUsersV2",(e=>({payload:e}))),loadUsers:ft("auth/loadUsers",(e=>({payload:e}))),loadAllSubTenantsUsers:ft("auth/loadAllSubTenantsUsers",(e=>({payload:e}))),loadRoles:ft("auth/loadRoles",(e=>({payload:e}))),addUser:ft("auth/addUser",(e=>({payload:e}))),addUsersBulk:ft("auth/addUsersBulk",(e=>({payload:e}))),addUserToSubTenants:ft("auth/addUserToSubTenants",(e=>({payload:e}))),updateUser:ft("auth/updateUser",(e=>({payload:e}))),deleteUser:ft("auth/deleteUser",(e=>({payload:e}))),setUserRolesForSubTenants:ft("auth/setUserRolesForSubTenants",(e=>({payload:e}))),deleteUserFromSubTenants:ft("auth/deleteUserFromSubTenants",(e=>({payload:e}))),lockUser:ft("auth/lockUser",(e=>({payload:e}))),resendActivationLink:ft("auth/resendActivationLink",(e=>({payload:e}))),resendInvitationLink:ft("auth/resendInvitationLink",(e=>({payload:e}))),resendInvitationEmail:ft("auth/resendInvitationEmail",(e=>({payload:e}))),resendInvitationLinkToAllSubTenants:ft("auth/resendInvitationLinkToAllSubTenants",(e=>({payload:e}))),getTemporaryUsersConfig:ft("auth/getTemporaryUsersConfig"),updateUserExpirationTime:ft("auth/updateUserExpirationTime",(e=>({payload:e}))),setUserAsPermanent:ft("auth/setUserAsPermanent",(e=>({payload:e}))),getInvitationLink:ft("auth/getInvitationLink"),createInvitationLink:ft("auth/createInvitationLink",(e=>({payload:e}))),updateInvitationLink:ft("auth/updateInvitationLink",(e=>({payload:e}))),deleteInvitationLink:ft("auth/deleteInvitationLink",(e=>({payload:e}))),openAddUserDialog:ft("auth/openAddUserDialog",(e=>({payload:e}))),closeAddUserDialog:ft("auth/closeAddUserDialog",(e=>({payload:e}))),openDeleteUserDialog:ft("auth/openDeleteUserDialog",(e=>({payload:e}))),closeDeleteUserDialog:ft("auth/closeDeleteUserDialog",(e=>({payload:e}))),openLockUserDialog:ft("auth/openLockUserDialog",(e=>({payload:e}))),closeLockUserDialog:ft("auth/closeLockUserDialog",(e=>({payload:e})))},hn={firstLoad:!0,loading:!1,error:""},mn={setSocialLoginsState:ht("socialLoginState"),resetSocialLoginsState:vt("socialLoginState",{socialLoginState:hn})},An={loadSocialLoginsConfiguration:ft("auth/loadSocialLoginsConfiguration"),loadSocialLoginsConfigurationV2:ft("auth/loadSocialLoginsConfigurationV2",(e=>({payload:e}))),loginViaSocialLogin:ft("auth/loginViaSocialLogin",(e=>({payload:e}))),setSocialLoginError:ft("auth/setSocialLoginError",(e=>({payload:e})))};let bn;!function(e){e.SignUp="SignUp",e.SignUpSuccess="SignUpSuccess"}(bn||(bn={}));const Tn={loading:!1,allowSignUps:!1,allowNotVerifiedUsersLogin:!1,firstLoad:!0,stage:bn.SignUp},En={setSignUpState:ht("signUpState"),resetSignUpState:vt("signUpState",{signUpState:Tn})},In={signUpUser:ft("auth/signUpUser",(e=>({payload:e}))),resetSignUpStateSoft:ft("auth/resetSignUpStateSoft")},kn={apiTokenType:null,searchValue:"",showAddTokenDialog:!1,createdByUserIdColumn:"show",deleteTokenDialog:{open:!1,clientId:""},successDialog:{open:!1,secret:"",clientId:""},loaders:{},apiTokensDataTenant:[],apiTokensDataUser:[],roles:[],permissions:[],errors:{}},On={setApiTokensLoader:At("apiTokensState"),setApiTokensError:bt("apiTokensState"),setApiTokensState:ht("apiTokensState"),resetApiTokensState:vt("apiTokensState",{apiTokensState:kn})},Pn={loadApiTokens:ft("auth/loadApiTokens",(e=>({payload:e}))),loadUserApiTokens:ft("auth/loadUserApiTokens",(e=>({payload:e}))),loadTenantApiTokens:ft("auth/loadTenantApiTokens",(e=>({payload:e}))),initApiTokensData:ft("auth/initApiTokensData",(e=>({payload:e}))),addTenantApiToken:ft("auth/addTenantApiToken",(e=>({payload:e}))),addUserApiToken:ft("auth/addUserApiToken",(e=>({payload:e}))),deleteUserApiToken:ft("auth/deleteUserApiToken",(e=>({payload:e}))),deleteTenantApiToken:ft("auth/deleteTenantApiToken",(e=>({payload:e})))},Ln={globalPolicy:{loading:!0},publicPolicy:{loading:!1},vendorMfaPolicy:{loading:!0},mfaPolicy:{loading:!0},vendorLockoutPolicy:{loading:!0},lockoutPolicy:{loading:!0},captchaPolicy:{loading:!0},passwordHistoryPolicy:{loading:!0},passwordPolicy:{loading:!0},vendorPasswordHistoryPolicy:{loading:!0},publicAuthStrategyPolicy:{loading:!0}},wn={setSecurityPolicyState:ht("securityPolicyState"),setSecurityPolicyGlobalState:mt("securityPolicyState","globalPolicy"),setSecurityPolicyPublicState:mt("securityPolicyState","publicPolicy"),setSecurityPolicyAuthStrategyPublicState:mt("securityPolicyState","publicAuthStrategyPolicy"),setSecurityPolicyMfaState:mt("securityPolicyState","mfaPolicy"),setSecurityPolicyVendorMfaState:mt("securityPolicyState","vendorMfaPolicy"),setSecurityPolicyVendorLockoutState:mt("securityPolicyState","vendorLockoutPolicy"),setSecurityPolicyVendorPasswordHistoryState:mt("securityPolicyState","vendorPasswordHistoryPolicy"),setSecurityPolicyLockoutState:mt("securityPolicyState","lockoutPolicy"),setSecurityPolicyCaptchaState:mt("securityPolicyState","captchaPolicy"),setSecurityPolicyPasswordHistoryState:mt("securityPolicyState","passwordHistoryPolicy"),setSecurityPolicyPasswordState:mt("securityPolicyState","passwordPolicy"),resetSecurityPolicyState:vt("securityPolicyState",{securityPolicyState:Ln})},Dn={loadSecurityPolicy:ft("auth/loadSecurityPolicy"),loadPublicSecurityPolicy:ft("auth/loadPublicSecurityPolicy"),loadSecurityPolicyMfa:ft("auth/loadSecurityPolicyMfa"),loadSecurityPolicyVendorMfa:ft("auth/loadSecurityPolicyVendorMfa"),saveSecurityPolicyMfa:ft("auth/saveSecurityPolicyMfa",(e=>({payload:e}))),loadSecurityPolicyLockout:ft("auth/loadSecurityPolicyLockout"),loadSecurityPolicyVendorLockout:ft("auth/loadSecurityPolicyVendorLockout"),saveSecurityPolicyLockout:ft("auth/saveSecurityPolicyLockout",(e=>({payload:e}))),loadSecurityPolicyCaptcha:ft("auth/loadSecurityPolicyCaptcha"),loadSecurityPolicyPasswordHistory:ft("auth/loadSecurityPolicyPasswordHistory"),loadSecurityPolicyVendorPasswordHistory:ft("auth/loadSecurityPolicyVendorPasswordHistory"),saveSecurityPolicyPasswordHistory:ft("auth/saveSecurityPolicyPasswordHistory",(e=>({payload:e}))),loadVendorPasswordConfig:ft("auth/loadVendorPasswordConfig"),loadPublicAuthStrategiesPolicy:ft("auth/loadPublicAuthStrategiesPolicy")},Un={loading:!1},Cn={setAccountSettingsState:ht("accountSettingsState"),resetAccountSettingsState:vt("accountSettingsState",{accountSettingsState:Un})},Rn={loadAccountSettings:ft("auth/loadAccountSettings",(e=>({payload:e}))),saveAccountSettings:ft("auth/saveAccountSettings",(e=>({payload:e})))},_n={tenants:[],subTenants:[],loading:!0,tenantTree:null},Nn={setTenantsState:ht("tenantsState"),resetTenantsState:vt("tenantsState",{tenantsState:_n})},Mn={switchTenant:ft("auth/switchTenant",(e=>({payload:e}))),loadTenants:ft("auth/loadTenants",(e=>({payload:e}))),loadSubTenants:ft("auth/loadSubTenants",(e=>({payload:e}))),loadSubTenantsTree:ft("auth/loadSubTenantsTree",(e=>({payload:e})))},Fn={loaders:{},errors:{},roles:[],permissions:[],permissionCategories:[]},Gn={setRolesState:ht("rolesState"),resetRolesState:vt("rolesState",{rolesState:Fn}),setRolesStateLoader:At("rolesState"),setRolesStateError:bt("rolesState")},xn={loadRolesAndPermissions:ft("auth/loadRoles",(e=>({payload:e}))),addRole:ft("auth/addRole",(e=>({payload:e}))),addRoleV2:ft("auth/addRoleV2",(e=>({payload:e}))),updateRole:ft("auth/updateRole",(e=>({payload:e}))),deleteRole:ft("auth/deleteRole",(e=>({payload:e}))),attachPermissionsToRole:ft("auth/attachPermissionsToRole",(e=>({payload:e})))},Vn={loading:!1,sessions:[]},jn={setSessionsState:ht("sessionsState"),resetSessionsState:vt("sessionsState",{sessionsState:Vn})},Bn={loadUserSessions:ft("auth/loadUserSessions"),loadCurrentUserSession:ft("auth/loadCurrentUserSession"),deleteUserSession:ft("auth/deleteUserSession",(e=>({payload:e}))),deleteAllUserSessions:ft("auth/deleteAllUserSessions"),revokeUserSessions:ft("auth/revokeUserSessions",(e=>({payload:e})))},Wn={loading:!1,configurations:{}},zn={setSessionsPolicyState:ht("sessionsPolicyState"),resetSessionsPolicyState:vt("sessionsPolicyState",{sessionsPolicyState:Wn})},$n={loadSessionsPolicy:ft("auth/loadSessionsPolicy"),createOrUpdateSessionsPolicy:ft("auth/createOrUpdateSessionsPolicy",(e=>({payload:e})))};let Kn;!function(e){e.ALLOW="ALLOW",e.BLOCK="BLOCK"}(Kn||(Kn={}));const Hn={ipRestrictions:{loading:!1,pagination:{_offset:0,_limit:4,_filter:Kn.ALLOW},totalPages:1,userIpValid:!1},emailDomainRestrictions:{loading:!0}},qn={setRestrictionsState:ht("restrictionsState"),setIpRestrictionsState:mt("restrictionsState","ipRestrictions"),setEmailDomainRestrictionsState:mt("restrictionsState","emailDomainRestrictions")},Jn={checkIfUserIpValid:ft("auth/checkIfUserIpValid"),addCurrentUserIpAndActivate:ft("auth/addCurrentUserIpAndActivate",(e=>({payload:e}))),loadIpRestrictions:ft("auth/loadIpRestrictions"),saveIpRestriction:ft("auth/saveIpRestriction",(e=>({payload:e}))),saveIpRestrictionsConfig:ft("auth/saveIpRestrictionsConfig",(e=>({payload:e}))),deleteIpRestriction:ft("auth/deleteIpRestriction",(e=>({payload:e}))),loadEmailDomainRestrictions:ft("auth/loadEmailDomainRestrictions"),saveEmailDomainRestriction:ft("auth/saveEmailDomainRestriction",(e=>({payload:e}))),saveEmailDomainRestrictionsConfig:ft("auth/saveEmailDomainRestrictionsConfig",(e=>({payload:e}))),deleteEmailDomainRestriction:ft("auth/deleteEmailDomainRestriction",(e=>({payload:e})))},Yn={loading:!1},Xn={setProvisioningState:ht("provisioningState"),resetProvisioningState:vt("provisioningState",{provisioningState:Yn})},Qn={loadProvisionConnections:ft("auth/loadProvisionConnections"),createProvisionConnection:ft("auth/createProvisionConnection",(e=>({payload:e}))),deleteProvisionConnection:ft("auth/deleteProvisionConnection",(e=>({payload:e}))),updateProvisionConnection:ft("auth/updateProvisionConnection",(e=>({payload:e})))},Zn={devices:[],loading:!1,error:null},ea={setPasskeysState:ht("passkeysState"),resetPasskeysState:vt("passkeysState",{passkeysState:Zn})},ta={loadWebAuthnDevices:ft("auth/loadWebAuthnDevices"),deleteWebAuthnDevice:ft("auth/deleteWebAuthnDevice",(e=>({payload:e})))},na={loaders:{},errors:{},groups:[],groupsConfiguration:{}},aa={setUsersGroupsLoader:At("groupsState"),setUsersGroupsError:bt("groupsState"),setGroupsState:ht("groupsState"),resetUsersGroupsState:vt("groupsState",{groupsState:na})},ia={loadGroups:ft("auth/loadUsersGroups"),getGroupById:ft("auth/getGroupById",(e=>({payload:e}))),createGroup:ft("auth/createGroup",(e=>({payload:e}))),updateGroup:ft("auth/updateGroup",(e=>({payload:e}))),deleteGroup:ft("auth/deleteGroup",(e=>({payload:e}))),addRolesToGroup:ft("auth/addRolesToGroup",(e=>({payload:e}))),deleteRolesFromGroup:ft("auth/deleteRolesFromGroup",(e=>({payload:e}))),addUsersToGroup:ft("auth/addUsersToGroup",(e=>({payload:e}))),deleteUsersFromGroup:ft("auth/deleteUsersFromGroup",(e=>({payload:e}))),getGroupConfiguration:ft("auth/getGroupConfiguration"),updateGroupConfiguration:ft("auth/updateGroupConfiguration",(e=>({payload:e}))),getTeamUsers:ft("auth/getUsers",(e=>({payload:e})))},oa={addGroupDialogState:{loading:!1,open:!1},editGroupDialogState:{loading:!1,open:!1},deleteGroupDialogState:{loading:!1,open:!1},addMembersToGroupDialogState:{loading:!1,open:!1,userIds:[]},deleteMemberFromGroupDialogState:{loading:!1,open:!1}},ra={setGroupsDialogsState:ht("groupsDialogsState"),resetGroupsDialogsState:vt("groupsState",{groupsDialogsState:oa}),openAddGroupDialog:Et("groupsDialogsState","addGroupDialogState",{open:!0}),closeAddGroupDialog:Et("groupsDialogsState","addGroupDialogState",{open:!1}),openEditGroupDialog:Tt("groupsDialogsState","editGroupDialogState",{open:!0}),closeEditGroupDialog:Et("groupsDialogsState","editGroupDialogState",{open:!1,loading:!1,group:void 0}),openDeleteGroupDialog:Tt("groupsDialogsState","deleteGroupDialogState",{open:!0}),closeDeleteGroupDialog:Et("groupsDialogsState","deleteGroupDialogState",{open:!1,loading:!1,group:void 0}),openAddMembersToGroupDialog:Et("groupsDialogsState","addMembersToGroupDialogState",{open:!0}),closeAddMembersToGroupDialog:Et("groupsDialogsState","addMembersToGroupDialogState",{open:!1,userIds:[]}),openDeleteMemberFromGroupDialog:Tt("groupsDialogsState","deleteMemberFromGroupDialogState",{open:!0}),closeDeleteMemberFromGroupDialog:Et("groupsDialogsState","deleteMemberFromGroupDialogState",{open:!1,userId:void 0})},sa={loading:!0,error:null},la={setCustomLoginState:ht("customLoginState"),resetCustomLoginState:vt("customLoginState",{customLoginState:sa})},ca={loadTenantMetadata:ft("auth/loadTenantMetadata"),updateTenantMetadata:ft("auth/updateTenantMetadata",(e=>({payload:e})))},da={frameWork:"x-frontegg-framework",fronteggSdkVersion:"x-frontegg-sdk",contentType:"Content-Type",source:"frontegg-source",scopedTenant:"frontegg-scoped-tenant"};let ua,ya,fa,pa,ga;!function(e){e.AdminPortal="admin-portal",e.LoginBox="login-box"}(ua||(ua={})),function(e){e.Nextjs="nextjs",e.React="react",e.Angular="angular",e.Vuejs="vuejs",e.Flutter="flutter",e.Ios="ios",e.Android="android",e.Vanillajs="vanillajs"}(ya||(ya={})),function(e){e.ASC="ASC",e.DESC="DESC"}(fa||(fa={})),function(e){e.createdAt="createdAt",e.name="name",e.email="email",e.id="id",e.verified="verified",e.isLocked="isLocked",e.provider="provider",e.tenantId="tenantId"}(pa||(pa={})),function(e){e.MFA_UNENROLLED="mfa-unenrolled",e.BREACHED_PASSWORDS="breached-passwords",e.INACTIVE="inactive"}(ga||(ga={}));const Sa=["local","saml","google","github","facebook","microsoft","scim2","slack"],va={loaders:{},errors:{},accounts:{tenantId:"",children:[]},accountsQueryParams:{_limit:50,_offset:0,_filter:"",_subTenantId:""},searchAccountsData:[],rootAccount:{tenantId:""},selectedAccount:{tenantId:"",userJwt:{accessToken:"",expiresIn:0,expires:""},users:[],usersQueryParams:{_offset:0,_limit:10,_order:fa.DESC,_sortBy:pa.name},usersPageOffset:0,accountSettings:{}}},ha={setAllAccountsLoader:At("allAccountsState"),setAllAccountsError:bt("allAccountsState"),setAllAccountsState:ht("allAccountsState"),setSelectedAccountState:mt("allAccountsState","selectedAccount"),resetAllAccountsState:vt("allAccountsState",{allAccountsState:va})},ma={loadAccounts:ft("auth/loadAccounts",(e=>({payload:e}))),searchAccounts:ft("auth/searchAccounts",(e=>({payload:e}))),updateSubAccountAccessForUser:ft("auth/updateSubAccountAccessForUser",(e=>({payload:e}))),createSubAccount:ft("auth/createSubAccount",(e=>({payload:e}))),updateSubAccount:ft("auth/updateAccount",(e=>({payload:e}))),deleteSubAccount:ft("auth/deleteAccount",(e=>({payload:e}))),updateSubAccountSettings:ft("auth/updateSubAccountSettings",(e=>({payload:e}))),addUsersToAccount:ft("auth/addUsersToAccount",(e=>({payload:e}))),getAccountUsers:ft("auth/getAccountUsers",(e=>({payload:e}))),deleteUsersFromAccount:ft("auth/deleteUsersFromAccount",(e=>({payload:e}))),setUserRolesForSubAccount:ft("auth/setUserRolesForSubAccount",(e=>({payload:e}))),getUserJwtForSubAccount:ft("auth/getUserJwtForSubAccount",(e=>({payload:e}))),setRootAccountData:ft("auth/setRootAccountData"),setSelectedSubAccountData:ft("auth/setSelectedSubAccountData",(e=>({payload:e}))),loadNumberOfUsersForSelectedSubAccount:ft("auth/loadNumberOfUsersForSelectedSubAccount",(e=>({payload:e})))},Aa={createSubAccountDialog:{loading:!1,open:!1,error:!1,jwt:"",canSelectParentAccount:!1},updateSubAccountDialog:{accountId:"",accountName:"",loading:!1,open:!1,error:!1,jwt:""},deleteSubAccountDialog:{accountId:"",accountName:"",isParentAccount:!1,loading:!1,open:!1,error:!1,jwt:""},addUsersToAccountDialog:{loading:!1,open:!1,accountName:"",accountId:"",permissionToGiveAccessToSubAccounts:!1,jwt:""},deleteUserFromAccountDialog:{userId:"",userName:"",accountId:"",loading:!1,open:!1,jwt:""},editUserRolesDialog:{loading:!1,open:!1,jwt:"",accountId:"",userId:"",userName:"",userRoles:[]}},ba={setAllAccountDialogsState:ht("allAccountsDialogsState"),resetAllAccountDialogsState:vt("allAccountsDialogsState",{allAccountsDialogsState:Aa}),openCreateSubAccountDialog:Tt("allAccountsDialogsState","createSubAccountDialog",{open:!0}),closeCreateSubAccountDialog:Et("allAccountsDialogsState","createSubAccountDialog",Aa.createSubAccountDialog),openUpdateSubAccountDialog:Tt("allAccountsDialogsState","updateSubAccountDialog",{open:!0}),closeUpdateSubAccountDialog:Et("allAccountsDialogsState","updateSubAccountDialog",Aa.updateSubAccountDialog),openDeleteSubAccountDialog:Tt("allAccountsDialogsState","deleteSubAccountDialog",{open:!0}),closeDeleteSubAccountDialog:Et("allAccountsDialogsState","deleteSubAccountDialog",Aa.deleteSubAccountDialog),openAddUsersToAccountDialog:Tt("allAccountsDialogsState","addUsersToAccountDialog",{open:!0}),closeAddUsersToAccountDialog:Et("allAccountsDialogsState","addUsersToAccountDialog",Aa.addUsersToAccountDialog),openDeleteUserFromAccountDialog:Tt("allAccountsDialogsState","deleteUserFromAccountDialog",{open:!0}),closeDeleteUserFromAccountDialog:Et("allAccountsDialogsState","deleteUserFromAccountDialog",Aa.deleteUserFromAccountDialog),openEditUserRolesDialog:Tt("allAccountsDialogsState","editUserRolesDialog",{open:!0}),closeEditUserRolesDialog:Et("allAccountsDialogsState","editUserRolesDialog",Aa.editUserRolesDialog)},Ta={loaders:{},errors:{},recommendations:void 0,insights:void 0,score:0,breachedPasswordUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},unenrolledMfaUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},inactiveUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10,_maxInactiveSeconds:7776e3}}},Ea={setSecurityCenterState:ht("securityCenterState"),resetSecurityCenterState:vt("securityCenterState",{securityCenterState:Ta}),setSecurityCenterStateLoader:At("securityCenterState"),setSecurityCenterStateError:bt("securityCenterState")},Ia={loadRecommendations:ft("auth/loadRecommendations"),loadInsights:ft("auth/loadInsights"),sendResetBreachedPasswordEmail:ft("auth/sendResetBreachedPasswordEmail",(e=>({payload:e}))),sendBulkResetBreachedPasswordEmails:ft("auth/sendBulkResetBreachedPasswordEmails",(e=>({payload:e}))),loadBreachedPasswordUsers:ft("auth/loadBreachedPasswordUsers",(e=>({payload:e}))),loadUnenrolledMfaUsers:ft("auth/loadUnenrolledMfaUsers",(e=>({payload:e}))),loadInactiveUsers:ft("auth/loadInactiveUsers",(e=>({payload:e})))};let ka,Oa,Pa;!function(e){e.Microsoft="microsoft",e.Facebook="facebook",e.Google="google",e.Github="github",e.Slack="slack",e.Apple="apple",e.Linkedin="linkedin"}(ka||(ka={})),function(e){e.EmailAndPassword="EmailAndPassword",e.MagicLink="MagicLink",e.Code="Code",e.NoLocalAuthentication="NoLocalAuthentication",e.SmsCode="SmsCode"}(Oa||(Oa={})),function(e){e.ClientCredentials="ClientCredentials",e.AccessToken="AccessToken"}(Pa||(Pa={}));const La={[Oa.Code]:wt.loginWithOtc,[Oa.EmailAndPassword]:wt.loginWithPassword,[Oa.MagicLink]:wt.magicLinkPreLoginSuccess,[Oa.SmsCode]:wt.loginWithSmsOtc},wa={loading:!1,error:null,phoneNumbers:void 0},Da={setSmsState:ht("smsState"),resetSmsState:vt("smsState",{smsState:wa})},Ua={loadPhoneNumbers:ft("auth/loadPhoneNumbers"),setUpPhoneNumber:ft("auth/setUpPhoneNumber",(e=>({payload:e}))),verifyPhoneNumber:ft("auth/verifyPhoneNumber",(e=>({payload:e}))),deletePhoneNumber:ft("auth/deletePhoneNumber",(e=>({payload:e}))),verifyDeletePhoneNumber:ft("auth/verifyDeletePhoneNumber",(e=>({payload:e}))),preVerifyPhoneNumber:ft("auth/preVerifyPhoneNumber",(e=>({payload:e})))},Ca={loading:!1,mfaDevices:void 0,mfaToken:""},Ra={setStepUpState:ht("stepUpState"),resetStepUpState:vt("stepUpState",{stepUpState:Ca})},_a={stepUpHostedLogin:ft("auth/stepUpHostedLogin",(e=>({payload:e}))),generateStepUpSession:ft("auth/generateStepUpSession",(e=>({payload:e}))),stepUpWithAuthenticator:ft("auth/stepUpWithAuthenticator",(e=>({payload:e}))),preVerifyMFASMSForStepUp:ft("auth/preVerifyMFASMSForStepUp",(e=>({payload:e}))),verifyMFASMSForStepUp:ft("auth/verifyMFASMSForStepUp",(e=>({payload:e}))),preVerifyMFAWebAuthnForStepUp:ft("auth/preVerifyMFAWebAuthnForStepUp",(e=>({payload:e}))),verifyMFAWebAuthnForStepUp:ft("auth/verifyMFAWebAuthnForStepUp",(e=>({payload:e}))),preVerifyMFAEmailCodeForStepUp:ft("auth/preVerifyMFAEmailCodeForStepUp",(e=>({payload:e}))),verifyMFAEmailCodeForStepUp:ft("auth/verifyMFAEmailCodeForStepUp",(e=>({payload:e})))},Na={setApplicationsState:ht("applicationsState")},Ma={loadUserApplications:ft("auth/loadUserApplications"),loadAccountApplications:ft("auth/loadAccountApplications"),assignUserToApps:ft("auth/assignUserToApps",(e=>({payload:e}))),unassignUserFromApps:ft("auth/unassignUserFromApps",(e=>({payload:e})))},Fa={isAuthenticated:!1,isLoading:!0,isSSOAuth:!1,user:null,signUpState:Tn,loginState:xt,stepUpState:Ca,activateState:Wt,acceptInvitationState:Ht,forgotPasswordState:Xt,ssoState:on,profileState:ln,customLoginState:sa,applicationsState:{loading:!0,error:null,userApplications:[],accountApplications:[]},mfaState:yn,teamState:gn,groupsState:na,groupsDialogsState:oa,socialLoginState:hn,apiTokensState:kn,securityPolicyState:Ln,accountSettingsState:Un,tenantsState:_n,rolesState:Fn,resetPhoneNumberState:tn,sessionsState:Vn,sessionsPolicyState:Wn,restrictionsState:Hn,provisioningState:Yn,passkeysState:Zn,allAccountsState:va,allAccountsDialogsState:Aa,securityCenterState:Ta,smsState:wa},Ga=x({routes:{authenticatedUrl:"/",loginUrl:"/account/login",stepUpUrl:"/account/step-up",logoutUrl:"/account/logout",activateUrl:"/account/activate",impersonationUrl:"/account/impersonate",acceptInvitationUrl:"/account/invitation/accept",forgetPasswordUrl:"/account/forget-password",resetPhoneNumberUrl:"/account/reset-phone-number",resetPasswordUrl:"/account/reset-password",socialLoginCallbackUrl:"/account/social/success",signUpUrl:"/account/sign-up",oidcRedirectUrl:"/account/oidc/callback",samlCallbackUrl:"/account/saml/callback",magicLinkCallbackUrl:"/account/login/magic-link",hostedLoginRedirectUrl:"/oauth/callback",openAppUrl:"/account/redirect"},onRedirectTo:()=>{}},Fa);let xa;!function(e){e.impersonating="impersonating",e.success="success"}(xa||(xa={}));const Va={step:xa.impersonating,loading:!1},ja={setImpersonateState:ht("impersonateState"),resetImpersonateState:vt("impersonateState",{impersonateState:Va})},Ba={impersonate:ft("impersonation/impersonate",(e=>({payload:e})))},{reducer:Wa,actions:za}=gt({name:Nt,initialState:Ga,reducers:x({resetState:e=>x({},e,Fa),setState:(e,{payload:t})=>x({},e,t),setUser:("user",(e,{payload:t})=>x({},e,{user:t})),setEntitlements:mt("user","entitlements")},Vt,Ra,mn,zt,ja,qt,Qt,nn,En,cn,Na,la,rn,fn,Sn,aa,ra,On,wn,Cn,Nn,Gn,jn,zn,qn,Xn,ea,ha,ba,Ea,Da)});const $a=x({loadEntitlements:ft("auth/loadEntitlements",(e=>({payload:e})))},za,jt,_a,An,$t,Jt,Zt,an,In,dn,ca,Ma,sn,pn,vn,ia,{},Pn,Dn,Rn,Mn,xn,Bn,$n,Jn,Qn,Ba,ta,ma,Ia,Ua);var Ka=function(e){return"@@redux-saga/"+e},Ha=Ka("CANCEL_PROMISE"),qa=Ka("CHANNEL_END"),Ja=Ka("IO"),Ya=Ka("MATCH"),Xa=Ka("MULTICAST"),Qa=Ka("SAGA_ACTION"),Za=Ka("SELF_CANCELLATION"),ei=Ka("TASK"),ti=Ka("TASK_CANCEL"),ni=Ka("TERMINATE"),ai=Ka("LOCATION");function ii(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}var oi=function(e){return null==e},ri=function(e){return null!=e},si=function(e){return"function"==typeof e},li=function(e){return"string"==typeof e},ci=Array.isArray,di=function(e){return e&&si(e.then)},ui=function(e){return e&&si(e.next)&&si(e.throw)},yi=function e(t){return t&&(li(t)||gi(t)||si(t)||ci(t)&&t.every(e))},fi=function(e){return e&&si(e.take)&&si(e.close)},pi=function(e){return si(e)&&e.hasOwnProperty("toString")},gi=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};const Si=function(e,t){var n;void 0===t&&(t=!0);var a=new Promise((function(a){n=setTimeout(a,Math.min(2147483647,e),t)}));return a[Ha]=function(){clearTimeout(n)},a};var vi=function(e){return function(){return e}},hi=vi(!0),mi=function(){},Ai=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var bi=function(e,t){x(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function Ti(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ei=function(e){throw e},Ii=function(e){return{value:e,done:!0}};function ki(e,t,n){void 0===t&&(t=Ei),void 0===n&&(n="iterator");var a={meta:{name:n},next:e,throw:t,return:Ii,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(a[Symbol.iterator]=function(){return a}),a}function Oi(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var Pi=function(e){return Array.apply(null,new Array(e))},Li=function(e){return function(t){return e(Object.defineProperty(t,Qa,{value:!0}))}},wi=function(e){return e===ni},Di=function(e){return e===ti},Ui=function(e){return wi(e)||Di(e)};function Ci(e,t){var n,a=Object.keys(e),i=a.length,o=0,r=ci(e)?Pi(i):{},s={};return a.forEach((function(e){var a=function(a,s){n||(s||Ui(a)?(t.cancel(),t(a,s)):(r[e]=a,++o===i&&(n=!0,t(r))))};a.cancel=mi,s[e]=a})),t.cancel=function(){n||(n=!0,a.forEach((function(e){return s[e].cancel()})))},s}function Ri(e){return{name:e.name||"anonymous",location:_i(e)}}function _i(e){return e[ai]}var Ni=function(e){return function(e,t){void 0===e&&(e=10);var n=new Array(e),a=0,i=0,o=0,r=function(t){n[i]=t,i=(i+1)%e,a++},s=function(){if(0!=a){var t=n[o];return n[o]=null,a--,o=(o+1)%e,t}},l=function(){for(var e=[];a;)e.push(s());return e};return{isEmpty:function(){return 0==a},put:function(s){var c;if(a<e)r(s);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[i]=s,o=i=(i+1)%e;break;case 4:c=2*e,n=l(),a=n.length,i=n.length,o=0,n.length=c,e=c,r(s)}},take:s,flush:l}}(e,4)},Mi="TAKE",Fi="CALL",Gi="FORK",xi="SELECT",Vi=function(e,t){var n;return(n={})[Ja]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function ji(e,t){return void 0===e&&(e="*"),yi(e)?(ri(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),Vi(Mi,{pattern:e})):fi(n=e)&&n[Xa]&&ri(t)&&yi(t)?Vi(Mi,{channel:e,pattern:t}):fi(e)?(ri(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),Vi(Mi,{channel:e})):void 0;var n}function Bi(e,t){return oi(t)&&(t=e,e=void 0),Vi("PUT",{channel:e,action:t})}function Wi(e){var t=Vi("ALL",e);return t.combinator=!0,t}function zi(e,t){var n,a=null;return si(e)?n=e:(ci(e)?(a=e[0],n=e[1]):(a=e.context,n=e.fn),a&&li(n)&&si(a[n])&&(n=a[n])),{context:a,fn:n,args:t}}function $i(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Vi(Fi,zi(e,n))}function Ki(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Vi(Gi,zi(e,n))}function Hi(e){return void 0===e&&(e=Za),Vi("CANCEL",e)}function qi(e){void 0===e&&(e=Ai);for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return Vi(xi,{selector:e,args:n})}var Ji=$i.bind(null,Si);const Yi=function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e};var Xi=[],Qi=0;function Zi(e){try{no(),e()}finally{ao()}}function eo(e){Xi.push(e),Qi||(no(),io())}function to(e){try{return no(),e()}finally{io()}}function no(){Qi++}function ao(){Qi--}function io(){var e;for(ao();!Qi&&void 0!==(e=Xi.shift());)Zi(e)}var oo=function(e){return function(t){return e.some((function(e){return uo(e)(t)}))}},ro=function(e){return function(t){return e(t)}},so=function(e){return function(t){return t.type===String(e)}},lo=function(e){return function(t){return t.type===e}},co=function(){return hi};function uo(e){var t="*"===e?co:li(e)?so:ci(e)?oo:pi(e)?so:si(e)?ro:gi(e)?lo:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var yo={type:qa},fo=function(e){return e&&e.type===qa};function po(){var e,t,n,a,i,o,r=(t=!1,a=n=[],i=function(){a===n&&(a=n.slice())},o=function(){t=!0;var e=n=a;a=[],e.forEach((function(e){e(yo)}))},(e={})[Xa]=!0,e.put=function(e){if(!t)if(fo(e))o();else for(var i=n=a,r=0,s=i.length;r<s;r++){var l=i[r];l[Ya](e)&&(l.cancel(),l(e))}},e.take=function(e,n){var o;void 0===n&&(n=co),t?e(yo):(e[Ya]=n,i(),a.push(e),e.cancel=(o=!1,function(){o||(o=!0,i(),Ti(a,e))}))},e.close=o,e),s=r.put;return r.put=function(e){e[Qa]?s(e):eo((function(){s(e)}))},r}function go(e,t){var n=e[Ha];si(n)&&(t.cancel=n),e.then(t,(function(e){t(e,!0)}))}var So,vo=0,ho=function(){return++vo};function mo(e){e.isRunning()&&e.cancel()}var Ao=((So={}).TAKE=function(e,t,n){var a=t.channel,i=void 0===a?e.channel:a,o=t.pattern,r=t.maybe,s=function(e){e instanceof Error?n(e,!0):!fo(e)||r?n(e):n(ni)};try{i.take(s,ri(o)?uo(o):null)}catch(e){return void n(e,!0)}n.cancel=s.cancel},So.PUT=function(e,t,n){var a=t.channel,i=t.action,o=t.resolve;eo((function(){var t;try{t=(a?a.put:e.dispatch)(i)}catch(e){return void n(e,!0)}o&&di(t)?go(t,n):n(t)}))},So.ALL=function(e,t,n,a){var i=a.digestEffect,o=vo,r=Object.keys(t);if(0!==r.length){var s=Ci(t,n);r.forEach((function(e){i(t[e],o,s[e],e)}))}else n(ci(t)?[]:{})},So.RACE=function(e,t,n,a){var i=a.digestEffect,o=vo,r=Object.keys(t),s=ci(t)?Pi(r.length):{},l={},c=!1;r.forEach((function(e){var t=function(t,a){c||(a||Ui(t)?(n.cancel(),n(t,a)):(n.cancel(),c=!0,s[e]=t,n(s)))};t.cancel=mi,l[e]=t})),n.cancel=function(){c||(c=!0,r.forEach((function(e){return l[e].cancel()})))},r.forEach((function(e){c||i(t[e],o,l[e],e)}))},So.CALL=function(e,t,n,a){var i=t.context,o=t.fn,r=t.args,s=a.task;try{var l=o.apply(i,r);if(di(l))return void go(l,n);if(ui(l))return void Do(e,l,s.context,vo,Ri(o),!1,n);n(l)}catch(e){n(e,!0)}},So.CPS=function(e,t,n){var a=t.context,i=t.fn,o=t.args;try{var r=function(e,t){oi(e)?n(t):n(e,!0)};i.apply(a,o.concat(r)),r.cancel&&(n.cancel=r.cancel)}catch(e){n(e,!0)}},So.FORK=function(e,t,n,a){var i=t.context,o=t.fn,r=t.args,s=t.detached,l=a.task,c=function(e){var t=e.context,n=e.fn,a=e.args;try{var i=n.apply(t,a);if(ui(i))return i;var o=!1;return ki((function(e){return o?{value:e,done:!0}:(o=!0,{value:i,done:!di(i)})}))}catch(e){return ki((function(){throw e}))}}({context:i,fn:o,args:r}),d=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Ri(t)}(c,o);to((function(){var t=Do(e,c,l.context,vo,d,s,void 0);s?n(t):t.isRunning()?(l.queue.addTask(t),n(t)):t.isAborted()?l.queue.abort(t.error()):n(t)}))},So.JOIN=function(e,t,n,a){var i=a.task,o=function(e,t){if(e.isRunning()){var n={task:i,cb:t};t.cancel=function(){e.isRunning()&&Ti(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(ci(t)){if(0===t.length)return void n([]);var r=Ci(t,n);t.forEach((function(e,t){o(e,r[t])}))}else o(t,n)},So.CANCEL=function(e,t,n,a){var i=a.task;t===Za?mo(i):ci(t)?t.forEach(mo):mo(t),n()},So.SELECT=function(e,t,n){var a=t.selector,i=t.args;try{n(a.apply(void 0,[e.getState()].concat(i)))}catch(e){n(e,!0)}},So.ACTION_CHANNEL=function(e,t,n){var a=t.pattern,i=function(e){void 0===e&&(e=Ni());var t=!1,n=[];return{take:function(a){t&&e.isEmpty()?a(yo):e.isEmpty()?(n.push(a),a.cancel=function(){Ti(n,a)}):a(e.take())},put:function(a){if(!t){if(0===n.length)return e.put(a);n.shift()(a)}},flush:function(n){t&&e.isEmpty()?n(yo):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var a=0,i=e.length;a<i;a++)(0,e[a])(yo)}}}}(t.buffer),o=uo(a),r=function t(n){fo(n)||e.channel.take(t,o),i.put(n)},s=i.close;i.close=function(){r.cancel(),s()},e.channel.take(r,o),n(i)},So.CANCELLED=function(e,t,n,a){n(a.task.isCancelled())},So.FLUSH=function(e,t,n){t.flush(n)},So.GET_CONTEXT=function(e,t,n,a){n(a.task.context[t])},So.SET_CONTEXT=function(e,t,n,a){var i=a.task;bi(i.context,t),n()},So);function bo(e,t){return e+"?"+t}function To(e){var t=e.name,n=e.location;return n?t+" "+bo(n.fileName,n.lineNumber):t}function Eo(e){var t,n,a,i=(t=function(e){return e.cancelledTasks},n=e,(a=[]).concat.apply(a,n.map(t)));return i.length?["Tasks cancelled due to error:"].concat(i).join("\n"):""}var Io=null,ko=[],Oo=function(e){e.crashedEffect=Io,ko.push(e)},Po=function(){Io=null,ko.length=0},Lo=function(){var e,t,n=ko[0],a=ko.slice(1),i=n.crashedEffect?(e=n.crashedEffect,(t=_i(e))?t.code+" "+bo(t.fileName,t.lineNumber):""):null;return["The above error occurred in task "+To(n.meta)+(i?" \n when executing effect "+i:"")].concat(a.map((function(e){return" created by "+To(e.meta)})),[Eo(ko)]).join("\n")};function wo(e,t,n,a,i,o,r){var s;void 0===r&&(r=mi);var l,c,d=0,u=null,y=[],f=Object.create(n),p=function(e,t,n){var a,i=[],o=!1;function r(e){y.push.apply(y,p.getTasks().map((function(e){return e.meta.name}))),l(),n(e,!0)}function s(t){i.push(t),t.cont=function(s,l){o||(Ti(i,t),t.cont=mi,l?r(s):(t===e&&(a=s),i.length||(o=!0,n(a))))}}function l(){o||(o=!0,i.forEach((function(e){e.cont=mi,e.cancel()})),i=[])}return s(e),{addTask:s,cancelAll:l,abort:r,getTasks:function(){return i}}}(t,0,g);function g(t,n){if(n){if(d=2,Oo({meta:i,cancelledTasks:y}),S.isRoot){var a=Lo();Po(),e.onError(t,{sagaStack:a})}c=t,u&&u.reject(t)}else t===ti?d=1:1!==d&&(d=3),l=t,u&&u.resolve(t);S.cont(t,n),S.joiners.forEach((function(e){e.cb(t,n)})),S.joiners=null}var S=((s={})[ei]=!0,s.id=a,s.meta=i,s.isRoot=o,s.context=f,s.joiners=[],s.queue=p,s.cancel=function(){0===d&&(d=1,p.cancelAll(),g(ti,!1))},s.cont=r,s.end=g,s.setContext=function(e){bi(f,e)},s.toPromise=function(){return u||(u=Yi(),2===d?u.reject(c):0!==d&&u.resolve(l)),u.promise},s.isRunning=function(){return 0===d},s.isCancelled=function(){return 1===d||0===d&&1===t.status},s.isAborted=function(){return 2===d},s.result=function(){return l},s.error=function(){return c},s);return S}function Do(e,t,n,a,i,o,r){var s=e.finalizeRunEffect((function(t,n,a){di(t)?go(t,a):ui(t)?Do(e,t,c.context,n,i,!1,a):t&&t[Ja]?(0,Ao[t.type])(e,t.payload,a,d):a(t)}));u.cancel=mi;var l={meta:i,cancel:function(){0===l.status&&(l.status=1,u(ti))},status:0},c=wo(e,l,n,a,i,o,r),d={task:c,digestEffect:y};return r&&(r.cancel=c.cancel),u(),c;function u(e,n){try{var i;n?(i=t.throw(e),Po()):Di(e)?(l.status=1,u.cancel(),i=si(t.return)?t.return(ti):{done:!0,value:ti}):i=wi(e)?si(t.return)?t.return():{done:!0}:t.next(e),i.done?(1!==l.status&&(l.status=3),l.cont(i.value)):y(i.value,a,u)}catch(e){if(1===l.status)throw e;l.status=2,l.cont(e,!0)}}function y(t,n,a,i){void 0===i&&(i="");var o,r=ho();function l(n,i){o||(o=!0,a.cancel=mi,e.sagaMonitor&&(i?e.sagaMonitor.effectRejected(r,n):e.sagaMonitor.effectResolved(r,n)),i&&function(e){Io=e}(t),a(n,i))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:r,parentEffectId:n,label:i,effect:t}),l.cancel=mi,a.cancel=function(){o||(o=!0,l.cancel(),l.cancel=mi,e.sagaMonitor&&e.sagaMonitor.effectCancelled(r))},s(t,r,l)}}function Uo(e,t){for(var n=e.channel,a=void 0===n?po():n,i=e.dispatch,o=e.getState,r=e.context,s=void 0===r?{}:r,l=e.sagaMonitor,c=e.effectMiddlewares,d=e.onError,u=void 0===d?Oi:d,y=arguments.length,f=new Array(y>2?y-2:0),p=2;p<y;p++)f[p-2]=arguments[p];var g,S=t.apply(void 0,f),v=ho();if(l&&(l.rootSagaStarted=l.rootSagaStarted||mi,l.effectTriggered=l.effectTriggered||mi,l.effectResolved=l.effectResolved||mi,l.effectRejected=l.effectRejected||mi,l.effectCancelled=l.effectCancelled||mi,l.actionDispatched=l.actionDispatched||mi,l.rootSagaStarted({effectId:v,saga:t,args:f})),c){var h=qe.apply(void 0,c);g=function(e){return function(t,n,a){return h((function(t){return e(t,n,a)}))(t)}}}else g=Ai;var m={channel:a,dispatch:Li(i),getState:o,sagaMonitor:l,onError:u,finalizeRunEffect:g};return to((function(){var e=Do(m,S,s,v,Ri(t),!0,void 0);return l&&l.effectResolved(v,e),e}))}const Co=function(e){var t,n=void 0===e?{}:e,a=n.context,i=void 0===a?{}:a,o=n.channel,r=void 0===o?po():o,s=n.sagaMonitor,l=ii(n,["context","channel","sagaMonitor"]);function c(e){var n=e.getState,a=e.dispatch;return t=Uo.bind(null,x({},l,{context:i,channel:r,dispatch:a,getState:n,sagaMonitor:s})),function(e){return function(t){s&&s.actionDispatched&&s.actionDispatched(t);var n=e(t);return r.put(t),n}}}return c.run=function(){return t.apply(void 0,arguments)},c.setContext=function(e){bi(i,e)},c};var Ro=function(e){return{done:!0,value:e}},_o={};function No(e){return fi(e)?"channel":pi(e)?String(e):si(e)?e.name:String(e)}function Mo(e,t,n){var a,i,o,r=t;function s(t,n){if(r===_o)return Ro(t);if(n&&!i)throw r=_o,n;a&&a(t);var s=n?e[i](n):e[r]();return r=s.nextState,o=s.effect,a=s.stateUpdater,i=s.errorState,r===_o?Ro(t):o}return ki(s,(function(e){return s(null,e)}),n)}function Fo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r={done:!1,value:ji(e)},s=function(e){return{done:!1,value:Ki.apply(void 0,[t].concat(a,[e]))}},l=function(e){return o=e};return Mo({q1:function(){return{nextState:"q2",effect:r,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:s(o)}}},"q1","takeEvery("+No(e)+", "+t.name+")")}function Go(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r,s={done:!1,value:ji(e)},l=function(e){return{done:!1,value:Ki.apply(void 0,[t].concat(a,[e]))}},c=function(e){return{done:!1,value:Hi(e)}},d=function(e){return o=e},u=function(e){return r=e};return Mo({q1:function(){return{nextState:"q2",effect:s,stateUpdater:u}},q2:function(){return o?{nextState:"q3",effect:c(o)}:{nextState:"q1",effect:l(r),stateUpdater:d}},q3:function(){return{nextState:"q1",effect:l(r),stateUpdater:d}}},"q1","takeLatest("+No(e)+", "+t.name+")")}function xo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o,r={done:!1,value:ji(e)},s=function(e){return{done:!1,value:$i.apply(void 0,[t].concat(a,[e]))}},l=function(e){return o=e};return Mo({q1:function(){return{nextState:"q2",effect:r,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:s(o)}}},"q1","takeLeading("+No(e)+", "+t.name+")")}function Vo(e,t,n){for(var a=e,i=arguments.length,o=new Array(i>3?i-3:0),r=3;r<i;r++)o[r-3]=arguments[r];var s={done:!1,value:$i.apply(void 0,[n].concat(o))},l={done:!1,value:Ji(t)};return Mo({q1:function(){return{nextState:"q2",effect:s,errorState:"q10"}},q2:function(){return{nextState:_o}},q10:function(e){if((a-=1)<=0)throw e;return{nextState:"q1",effect:l}}},"q1","retry("+n.name+")")}function jo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Ki.apply(void 0,[Fo,e,t].concat(a))}function Bo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Ki.apply(void 0,[Go,e,t].concat(a))}function Wo(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return Ki.apply(void 0,[xo,e,t].concat(a))}class zo{constructor(){this.context=null,this.accessToken=null,this.user=null,this.requestSource=null,this.onRedirectTo=e=>window.location.href=e,this.logout=()=>window.location.href="/account/logout",this.entitlementsOptions=null,this.appName=null,this.sessionContext=void 0}static getInstance(){return zo.instance||(zo.instance=new zo),zo.instance}static setContext(e){zo.getInstance().context=e}static setAccessToken(e){zo.getInstance().accessToken=e}static setUser(e){zo.getInstance().user=e}static setRequestSource(e){zo.getInstance().requestSource=e}static setOnRedirectTo(e){zo.getInstance().onRedirectTo=e}static setLogout(e,t){zo.getInstance().logout=n=>{n?e(n):zo.onRedirectTo(t)}}static setEntitlementsOptions(e){zo.getInstance().entitlementsOptions=e}static setSessionContext(e){zo.getInstance().sessionContext=e}static setAppName(e){zo.getInstance().appName=e}static getContext(){var e;return null!=(e=zo.getInstance().context)?e:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}}static getAccessToken(){return zo.getInstance().accessToken}static getRequestSource(){return zo.getInstance().requestSource}static getUser(){return zo.getInstance().user}static onRedirectTo(e,t){return zo.getInstance().onRedirectTo(e,t)}static logout(e){return zo.getInstance().logout(e)}static shouldLoadEntitlements(){var e;return(null==(e=zo.getInstance().entitlementsOptions)?void 0:e.enabled)||!1}static isSessionPerTenantEnabled(){var e;return(null==(e=zo.getInstance().sessionContext)?void 0:e.enableSessionPerTenant)||!1}static getAppName(){return zo.getInstance().appName}}zo.instance=void 0;const $o={getContext:()=>zo.getContext(),getAccessToken:()=>zo.getAccessToken(),getUser:()=>zo.getUser(),onRedirectTo:(e,t)=>zo.onRedirectTo(e,t),logout:e=>zo.logout(e)};class Ko extends Error{constructor(e,t){super(e),this._statusCode=void 0,this._statusCode=t}get statusCode(){return this._statusCode}}const Ho={v1:"/identity/resources/users/webauthn/v1/devices"},qo={v1:"/identity/resources/auth/v1",v2:"/identity/resources/auth/v2"},Jo={v1:"/identity/resources/users/v1",v2:"/identity/resources/users/v2",v3:"/identity/resources/users/v3",roles:{v3:"/identity/resources/users/v3/roles"},groups:{v3:"/identity/resources/users/v3/groups"},tenants:{me:{v1:"/identity/resources/users/v1/me/tenants",v3:"/identity/resources/users/v3/me/tenants"}},apiTokens:{v1:"/identity/resources/users/api-tokens/v1"},accessTokens:{v1:"/identity/resources/users/access-tokens/v1"},sessions:{v1:"/identity/resources/users/sessions/v1",currentUser:{v1:"/identity/resources/users/sessions/v1/me"},configurations:{v1:"/identity/resources/configurations/sessions/v1"}},invitation:{resendAll:{v1:"/identity/resources/users/v1/invitation/reset/all"}},passwords:{resetBreachedPasswords:{v1:"/identity/resources/users/v1/passwords/breached/reset/bulk"}},authorization:{v1:"/identity/resources/users/v1/me/authorization"},temporary:{v1:"/identity/resources/users/temporary/v1",configuration:{v1:"/identity/resources/users/temporary/v1/configuration"}}},Yo={v1:"/identity/resources/configurations/v1"},Xo={emailDomain:{v1:"/identity/resources/configurations/restrictions/v1/email-domain"},ip:{v1:"/identity/resources/configurations/v1/restrictions/ip"}},Qo={v1:"/identity/resources/sso/v1",v2:"/identity/resources/sso/v2",custom:{v1:"/identity/resources/sso/custom/v1"}},Zo={v1:"/identity/resources/permissions/v1"},er={apiTokens:{v1:"/identity/resources/tenants/api-tokens/v1",v2:"/identity/resources/tenants/api-tokens/v2"},accessTokens:{v1:"/identity/resources/tenants/access-tokens/v1"},invites:{user:{v1:"/identity/resources/tenants/invites/v1/user"},verify:{v1:"/identity/resources/tenants/invites/v1/verify"},configuration:{v1:"/identity/resources/tenants/invites/v1/configuration"}},users:{v1:"/identity/resources/tenants/users/v1"}},tr={v1:"/identity/resources/roles/v1",v2:"/identity/resources/roles/v2"},nr={v1:"/identity/resources/sub-tenants/users/v1",v2:"/identity/resources/sub-tenants/users/v2"},ar={v1:"/identity/resources/impersonation/v1"},ir={v1:"/identity/resources/applications/v1"},or={v1:"/identity/resources/groups/v1",configurations:{v1:"/identity/resources/groups/v1/config"},getByIds:{v1:"/identity/resources/groups/v1/bulkGet"}},rr={v1:"/identity/resources/users/phone-numbers/v1"},sr={v1:"/team/resources/sso/v1",v2:"/team/resources/sso/v2"},lr={v1:"/team/resources/members/v1"},cr={v1:"/team/resources/roles/v1"},dr={v1:"/team/resources/stats/v1"},ur={v1:"/team/resources/profile"},yr={v1:"/tenants/resources/account-settings/v1"},fr={v1:"/tenants/resources/hierarchy/v1",tree:{v1:"/tenants/resources/hierarchy/v1/tree"},parents:{v1:"/tenants/resources/hierarchy/v1/parents"},v2:"/tenants/resources/hierarchy/v2",metadata:{v2:"/tenants/resources/hierarchy/v2/metadata"}},pr={v1:"/tenants/resources/sub-tenants/v1"},gr={v1:"/integrations/resources/configurations/v1",v2:"/integrations/resources/configurations/v2"},Sr={subscriptions:{v1:"/subscriptions/resources/billing/subscriptions/v1"},plans:{v1:"/subscriptions/resources/billing/plans/v1"},invoices:{v1:"/subscriptions/resources/billing/invoices/v1"},paymentMethods:{v1:"/subscriptions/resources/billing/payment-methods/v1"},summaries:{v1:"/subscriptions/resources/billing/summaries/v1"},tenantConfiguration:{v1:"/subscriptions/resources/billing/tenant-configurations/v1"},configurations:{vendorPublicConfigurations:{v1:"/subscriptions/resources/billing/configurations/vendor-public-configurations/v1"}},paymentProviders:{stripe:{customers:{v1:"/subscriptions/resources/billing/payment-providers/stripe/customers/v1"},publicConfigurations:{v1:"/subscriptions/resources/billing/payment-providers/stripe/public-configurations/v1"},subscriptions:{v1:"/subscriptions/resources/billing/payment-providers/stripe/subscriptions/v1"},setupIntents:{v1:"/subscriptions/resources/billing/payment-providers/stripe/setup-intents/v1"}}}},vr={v1:"/subscriptions/resources/payment-providers/v1"},hr={v1:"/subscriptions/resources/subscriptions/v1"},mr={v1:"/reports/resources/reports/v1",v2:"/reports/resources/reports/v2"},Ar={v1:"/reports/engine/resources/triggers/v1"},br="/notification",Tr="/audits",Er={v1:"/event/resources/configurations/v1"},Ir="/webhook",kr="/oauth",Or="/flags",Pr="/directory/resources/v1/configurations/scim2",Lr="/directory/resources/scim/temp",wr="/entitlements/api/v1/user-entitlements",Dr="/entitlements/api/v2/user-entitlements",Ur={v1:"/security-center/resources/recommendations/v1"},Cr={v1:"/security-center/resources/insights/v1"},Rr="/applications/resources/applications/v1",_r={v1:"/applications/resources/applications/tenant-assignments/v1"};function Nr(e,t,n=!0){let a;a="function"==typeof e.baseUrl?e.baseUrl(t):e.baseUrl;const i=e.urlPrefix||"frontegg",o="frontegg"===i&&!n;return a.endsWith("/")||(a+="/"),a.endsWith(i)||o||(a+=i),a}function Mr(e){var t,n;const a={};return null!=e&&null!=(t=e.metadataHeaders)&&t.fronteggSdkVersion&&(a[da.fronteggSdkVersion]=e.metadataHeaders.fronteggSdkVersion),null!=e&&null!=(n=e.metadataHeaders)&&n.framework&&(a[da.frameWork]=e.metadataHeaders.framework),a}function Fr(){return new URLSearchParams(window.location.search).get("tenantId")||null}const Gr=async e=>{var t,n,a;const i=zo.getContext(),o=await async function(e,t){var n;const a=Mr(e),i=await(null!=(n=null==e?void 0:e.tokenResolver)?n:zo.getAccessToken)(),o=zo.getRequestSource(),r=Fr();t&&(a[da.contentType]=t),o&&(a[da.source]=o),i&&(a.Authorization=`Bearer ${i}`),r&&(a[da.scopedTenant]=r);for(const t of await async function(e){let t=[];if(e.additionalHeadersResolver&&(t=await e.additionalHeadersResolver()),e.tenantResolver){const n=await e.tenantResolver();null!=n&&n.tenant&&t.push({key:"frontegg-login-alias",value:n.tenant})}return e.appId&&t.push({key:"frontegg-requested-application-id",value:e.appId}),t}(e))a[`${t.key}`]=`${t.value}`;return a}(i,e.contentType),r=await async function(e,t,n){const a=Nr(e,t),i=await async function(e,t){t||(t={});const n=await async function(e){let t=[];return e.additionalQueryParamsResolver&&(t=await e.additionalQueryParamsResolver()),t}(e);for(const e of n)t[e.key]=e.value;const a=Object.keys(t);for(const e of a){const n=t[e];t[e]="object"==typeof n?JSON.stringify(n):n}return t}(e,n);let o=t.startsWith("http")?t:`${a}${t}`;const r=Object.keys(i).length>0;return i&&r&&(o+=`?${new URLSearchParams(i)}`),o}(i,e.url,e.params),s=await fetch(r,{body:e.body?"application/json"===e.contentType?JSON.stringify(e.body):e.body:null,method:null!=(t=e.method)?t:"GET",headers:x({},o,e.headers),credentials:null!=(n=null!=(a=e.credentials)?a:i.requestCredentials)?n:"same-origin"});if(302===s.status)return window.location.href=await s.text(),new Promise((()=>{}));if(!s.ok){var l,c;if(413===s.status)throw new Ko("Error request is too large",s.status);let e,t=!0;try{e=await s.text(),e=JSON.parse(e)}catch(e){t=!1}throw e.errors?e=e.errors.join(", "):"string"!=typeof e&&(e=`Error ${s.status} - ${s.statusText}`),s.status>=400&&s.status<500&&["warn"].includes(null!=(l=i.logLevel)?l:"")?console.warn(e):500===s.status&&["warn","error"].includes(null!=(c=i.logLevel)?c:"")&&console.error(e),new Ko(t?e:"We're facing some difficulties, Please try again",s.status)}if(e.responseType&&"json"!==e.responseType){if("blob"===e.responseType){const{outputFileName:t}=e.params;return await s.blob().then((e=>URL.createObjectURL(e))).then((e=>{const n=document.createElement("a");n.href=e,n.setAttribute("download",t||"output"),n.click()}))}return await s.text()}try{return await s.json()}catch(e){return{}}},xr=async(e,t,n)=>Gr(x({url:e,method:"GET",contentType:"application/json",params:t},n)),Vr=async(e,t,n)=>Gr(x({url:e,method:"POST",contentType:"application/json",body:t},n)),jr=async(e,t,n)=>Gr(x({url:e,method:"PATCH",contentType:"application/json",body:t},n)),Br=async(e,t,n)=>Gr(x({url:e,method:"PUT",contentType:"application/json",body:t},n)),Wr=async(e,t,n)=>Gr(x({url:e,method:"DELETE",contentType:"application/json",body:t},n)),zr=async(e,t,n,a)=>Gr(x({url:e,method:"POST",contentType:"application/json",responseType:"blob",body:t,params:n},a)),$r=(e={})=>x({},e.jwt?{Authorization:e.jwt}:{}),Kr="FRONTEGG_SEPARATE_TABS_BY_TENANT",Hr="admin_portal_use_entitlements_v2_endpoint",qr={flags:{}};class Jr{constructor(){var e;this._flags={},this._flags=null!=(e=qr.flags)?e:{}}static getInstance(e="default"){return this._instances[e]}static set(e,t="default"){const n=new Jr;return n.set(e),Jr._instances[t]=n,n}static getFeatureFlags(e,t){const n=this.getInstance(t);return e.map((e=>"on"===(null==n?void 0:n._flags[e])))}get flags(){var e;return null!=(e=this.flags)?e:{}}set(e){var t;this._flags=x({},null!=(t=null==qr?void 0:qr.flags)?t:{},null!=e?e:{})}}async function Yr(){return xr(Or)}async function Xr(e){return Vr(`${Jo.v3}/me/token`,e)}async function Qr(e,t){return xr(Jo.v2,e,{headers:$r(t)})}async function Zr(e,t){return xr(Jo.v3,e,{headers:$r(t)})}async function es(e,t){return xr(Jo.roles.v3,x({},e,{ids:e.ids.join(",")}),{headers:$r(t)})}async function ts(e,t){return xr(Jo.groups.v3,x({},e,{ids:e.ids.join(",")}),{headers:$r(t)})}async function ns(e){return xr(Jo.tenants.me.v3,void 0,{headers:$r(e)})}async function as(e){return xr(Jo.tenants.me.v1,void 0,{headers:$r(e)})}async function is(){return Vr(Jo.passwords.resetBreachedPasswords.v1)}async function os(e){return Br(`${Jo.v2}/me`,e)}function rs(e){e&&sessionStorage.setItem(Kr,e)}function ss(){sessionStorage.removeItem(Kr)}function ls(){return zo.isSessionPerTenantEnabled()?sessionStorage.getItem(Kr):null}function cs(){const[e]=Jr.getFeatureFlags(["admin_portal_use_current_user_tenants_v1_endpoint"],zo.getAppName()||"");return zo.isSessionPerTenantEnabled()||e?as:ns}async function ds(e){return zo.isSessionPerTenantEnabled()&&rs(e.tenantId),Br(`${Jo.v1}/tenant`,e)}async function us(){return xr(`${Jo.v2}/me/tenants`)}async function ys(e){return xr(fr.v1,void 0,{headers:$r(e)})}async function fs(e){return xr(fr.tree.v1,void 0,{headers:$r(e)})}async function ps(e){return xr(fr.parents.v1,void 0,{headers:$r(e)})}async function gs(e,t){return xr(`${fr.parents.v1}/${e}`,void 0,{headers:$r(t)})}async function Ss(e,t){return Vr(`${er.users.v1}/count`,e,{headers:$r(t)})}async function vs(e,t){return xr(fr.v2,e,{headers:$r(t)})}async function hs(e,t){return xr(fr.metadata.v2,x({},e,{_tenantIds:e._tenantIds.join(",")}),{headers:$r(t)})}async function ms(){return xr(Yo.v1)}async function As(){return xr(`${Yo.v1}/mfa-policy`)}async function bs(){return xr(`${Yo.v1}/mfa-policy/vendor`)}async function Ts(e){return e.id?jr(`${Yo.v1}/mfa-policy`,e):Vr(`${Yo.v1}/mfa-policy`,e)}async function Es(){return xr(`${Yo.v1}/lockout-policy`)}async function Is(){return xr(`${Yo.v1}/lockout-policy/vendor`)}async function ks(e){return e.id?jr(`${Yo.v1}/lockout-policy`,e):Vr(`${Yo.v1}/lockout-policy`,e)}async function Os(){try{return await xr(`${Yo.v1}/captcha-policy/public`)}catch{return null}}async function Ps(){return xr(`${Yo.v1}/password-history-policy`)}async function Ls(){return xr(`${Yo.v1}/password-history-policy/vendor`)}async function ws(e){return e.id?jr(`${Yo.v1}/password-history-policy`,e):Vr(`${Yo.v1}/password-history-policy`,e)}async function Ds(){return xr(`${Yo.v1}/password`)}async function Us(){return xr(`${Xo.emailDomain.v1}`)}async function Cs(){return xr(`${Xo.emailDomain.v1}/config`)}async function Rs(e){return Vr(`${Xo.emailDomain.v1}`,e)}async function _s(e){return Vr(`${Xo.emailDomain.v1}/config`,e)}async function Ns(e){return Wr(`${Xo.emailDomain.v1}/${e}`)}async function Ms(e){return xr(`${Xo.ip.v1}`,e)}async function Fs(){return xr(`${Xo.ip.v1}/config`)}async function Gs(e){return Vr(`${Xo.ip.v1}`,e)}async function xs(e){return Vr(`${Xo.ip.v1}/bulk`,e)}async function Vs(e){return Vr(`${Xo.ip.v1}/config`,e)}async function js(e){return Wr(`${Xo.ip.v1}/${e}`)}async function Bs(){return Vr(`${Xo.ip.v1}/verify`)}async function Ws(){return Vr(`${Xo.ip.v1}/verify/allow`)}Jr._instances={};class zs extends Error{constructor(e){super(e)}}const $s="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){const t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new zs("'atob' failed: The string to be decoded is not correctly encoded.");let n="";for(let e,a,i=0,o=0;a=t.charAt(o++);~a&&(e=i%4?64*e+a:a,i++%4)?n+=String.fromCharCode(255&e>>(-2*i&6)):0)a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a);return n};class Ks extends Error{constructor(e){super(e)}}const Hs=(e,t={})=>{const n=t.header?0:1;try{return JSON.parse((e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent($s(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return $s(t)}})(e.split(".")[n]))}catch(e){throw new Ks("Invalid token specified: "+e.message)}};let qs,Js,Ys;!function(e){e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SmsCode="SmsCode",e.SmsCodeV2="SmsCodeV2",e.Passkeys="Passkeys"}(qs||(qs={})),function(e){e.Platform="Platform",e.CrossPlatform="CrossPlatform"}(Js||(Js={})),function(e){e.AuthenticatorApp="AuthenticatorApp",e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SMS="SMS",e.EmailCode="EmailCode"}(Ys||(Ys={}));const Xs="admin_portal_should_load_authorization";async function Qs(){return xr(wr)}async function Zs(){return xr(Dr)}let el;!function(e){e.MISSING_PERMISSION="MISSING_PERMISSION",e.MISSING_FEATURE="MISSING_FEATURE",e.BUNDLE_EXPIRED="BUNDLE_EXPIRED"}(el||(el={}));const tl="admin_portal_entitlements",nl=["type"],al=["type"],il=["type"];async function ol(e){if(!e.accessToken)return e;zo.setAccessToken(e.accessToken);const t=await Hd(),n=x({},e,e.accessToken?Hs(e.accessToken):{},t);return zo.setUser(n),n}async function rl(e){if(!e.accessToken)return{user:e};zo.setAccessToken(e.accessToken);const[t,n]=await Promise.all([Hd(),us()]),a=x({},e,e.accessToken?Hs(e.accessToken):{},t);return zo.setUser(a),{user:a,tenants:n}}function sl(){if(!zo.shouldLoadEntitlements())return!1;const[e]=Jr.getFeatureFlags([tl],zo.getAppName()||"");return e}function ll(){const[e]=Jr.getFeatureFlags([Xs],zo.getAppName()||"");return e}async function cl(e){const{accessToken:t}=e;if(!t)return{user:e};zo.setAccessToken(t);const[n,a]=await Promise.all([Hd(),cs()()]),i=x({},e,t?Hs(t):{},n);return zo.isSessionPerTenantEnabled()&&rs(i.tenantId),zo.setUser(i),{user:i,tenants:a.tenants,activeTenant:a.activeTenant}}async function dl(e){zo.setAccessToken(e.id_token);const t=await Hd(),n=e.id_token?Hs(e.id_token):{},a=x({mfaRequired:!1,accessToken:e.id_token,refreshToken:e.refresh_token},n,t,{expiresIn:e.expires_in||300});return zo.setUser(a),a}async function ul(e){zo.setAccessToken(e.id_token);const[t,n]=await Promise.all([Hd(),cs()()]),a=e.id_token?Hs(e.id_token):{},i=x({mfaRequired:!1,accessToken:e.id_token,refreshToken:e.refresh_token},a,t,{expiresIn:e.expires_in||300});return zo.isSessionPerTenantEnabled()&&rs(i.tenantId),zo.setUser(i),{user:i,tenants:n.tenants,activeTenant:n.activeTenant}}async function yl(e){try{const{address:t}=await Vr(`${qo.v1}/user/saml/prelogin`,e);return t}catch{return null}}async function fl(e){return Vr(`${qo.v1}/user/saml/prelogin`,e)}async function pl(e){return ol(await Vr(`${qo.v1}/user/saml/postlogin`,e))}async function gl(e){return ol(await Vr(`${qo.v1}/user/oidc/postlogin`,e))}async function Sl(e){return ol(await Vr(`${qo.v1}/user`,e))}async function vl(e){return cl(await Vr(`${qo.v1}/user`,e))}async function hl(e){return ol(await Vr(`${qo.v1}/user/mfa/verify`,e))}async function ml(e){return cl(await Vr(`${qo.v1}/user/mfa/verify`,e))}async function Al(e){return Vr(`${Jo.v1}/activate`,e)}async function bl(e){return cl(await Vr(`${Jo.v1}/activate`,e))}async function Tl(e){return xr(`${Jo.v1}/activate/strategy`,e)}async function El(e){return Vr(`${Jo.v1}/activate/reset`,e)}async function Il(e){return Vr(`${Jo.v1}/invitation/reset`,e)}async function kl(e){return Vr(`${Jo.v1}/invitation/accept`,e)}async function Ol(){const e=ls();return ol(await Vr(`${qo.v1}/user/token/refresh`,{tenantId:e}))}async function Pl(){const e=ls();return rl(await Vr(`${qo.v1}/user/token/refresh`,{tenantId:e}))}async function Ll(){const e=ls();return cl(await Vr(`${qo.v1}/user/token/refresh`,{tenantId:e}))}async function wl(){return Vr(`${qo.v1}/logout`)}async function Dl(e){return xr(`${kr}/logout`,e)}async function Ul(e){return Vr(`${Jo.v1}/passwords/reset`,e)}async function Cl(e){return Vr(`${Jo.v1}/passwords/reset/verify`,e)}async function Rl(e){return xr(`${Jo.v1}/passwords/config`,e)}async function _l(e){return Vr(`${qo.v1}/user/mfa/recover`,e)}async function Nl(){return Vr(`${Jo.v1}/mfa/enroll`)}async function Ml(){return Vr(`${Jo.v1}/mfa/authenticator/enroll`)}async function Fl(e){return Vr(`${Jo.v1}/mfa/authenticator/enroll/verify`,e)}async function Gl(e){return Vr(`${Jo.v1}/mfa/sms/enroll`,e)}async function xl(e){return Vr(`${Jo.v1}/mfa/sms/enroll/verify`,e)}async function Vl(){return Vr(`${Jo.v1}/mfa/webauthn/enroll`)}async function jl(e){return Vr(`${Jo.v1}/mfa/webauthn/enroll/verify`,e)}async function Bl(e){return Vr(`${Jo.v1}/mfa/enroll/verify`,e)}async function Wl(e){return Vr(`${Jo.v1}/mfa/disable`,e)}async function zl(e,t){return Vr(`${Jo.v1}/mfa/authenticator/${e}/disable/verify`,t)}async function $l(e){return Vr(`${Jo.v1}/mfa/sms/${e}/disable`)}async function Kl(e,t){return Vr(`${Jo.v1}/mfa/sms/${e}/disable/verify`,t)}async function Hl(e){return Vr(`${Jo.v1}/mfa/webauthn/${e}/disable`)}async function ql(e,t){return Vr(`${Jo.v1}/mfa/webauthn/${e}/disable/verify`,t)}async function Jl(){return xr(`${Jo.v1}/mfa/devices`)}async function Yl(e){return Vr(`${qo.v1}/user/mfa/authenticator/enroll`,e)}async function Xl(e){return Vr(`${qo.v1}/user/mfa/authenticator/enroll/verify`,e)}async function Ql(e){return cl(await Vr(`${qo.v1}/user/mfa/authenticator/enroll/verify`,e))}async function Zl(e,t){return Vr(`${qo.v1}/user/mfa/authenticator/${e}/verify`,t)}async function ec(e){return Vr(`${qo.v1}/user/mfa/emailcode`,e)}async function tc(e){return Vr(`${qo.v1}/user/mfa/emailcode/verify`,e)}async function nc(e){return cl(await Vr(`${qo.v1}/user/mfa/emailcode/verify`,e))}async function ac(e){return Vr(`${qo.v1}/user/mfa/sms/enroll`,e)}async function ic(e){return Vr(`${qo.v1}/user/mfa/sms/enroll/verify`,e)}async function oc(e){return cl(await Vr(`${qo.v1}/user/mfa/sms/enroll/verify`,e))}async function rc(e,t){return Vr(`${qo.v1}/user/mfa/sms/${e}`,t)}async function sc(e,t){return Vr(`${qo.v1}/user/mfa/sms/${e}/verify`,t)}async function lc(e,t){return cl(await Vr(`${qo.v1}/user/mfa/sms/${e}/verify`,t))}async function cc(e){return Vr(`${qo.v1}/user/mfa/webauthn/enroll`,e)}async function dc(e){return Vr(`${qo.v1}/user/mfa/webauthn/enroll/verify`,e)}async function uc(e){return cl(await Vr(`${qo.v1}/user/mfa/webauthn/enroll/verify`,e))}async function yc(e,t){return Vr(`${qo.v1}/user/mfa/webauthn/${e}`,t)}async function fc(e,t){return Vr(`${qo.v1}/user/mfa/webauthn/${e}/verify`,t)}async function pc(e,t){return cl(await Vr(`${qo.v1}/user/mfa/webauthn/${e}/verify`,t))}async function gc(){return xr(`${sr.v1}/saml/configurations`)}async function Sc(e){return Vr(`${sr.v1}/saml/configurations`,e)}async function vc(){return xr(`${sr.v1}/saml/configurations/vendor-config`)}async function hc(e){return Br(`${sr.v1}/saml/configurations/metadata`,e)}async function mc(){return Br(`${sr.v1}/saml/validations/domain`)}async function Ac(){return xr(`${sr.v1}/saml/configurations/roles/default`)}async function bc(){return xr(`${sr.v2}/saml/configurations/groups`)}async function Tc({roleIds:e}){return Vr(`${sr.v1}/saml/configurations/roles/default`,{roleIds:e})}async function Ec({roleIds:e,group:t}){return Vr(`${sr.v2}/saml/configurations/groups`,{group:t,roleIds:e})}async function Ic({roleIds:e,group:t,id:n}){return jr(`${sr.v2}/saml/configurations/groups/${n}`,{group:t,roleIds:e})}async function kc({id:e}){return Wr(`${sr.v2}/saml/configurations/groups/${e}`)}async function Oc(){return xr(`${sr.v1}/oidc/configurations`)}async function Pc(){return xr(`${sr.v2}/configurations/public`)}async function Lc(){return xr(Qo.v1)}async function wc(){return xr(Qo.v2)}async function Dc(){return xr(`${Qo.v2}/authenticated`)}async function Uc(){return xr(Qo.custom.v1)}async function Cc({provider:e,code:t,idToken:n,redirectUri:a,codeVerifier:i,metadata:o,invitationToken:r,state:s}){const l={};return t&&(l.code=t),n&&(l.id_token=n),a&&(l.redirectUri=a),i&&(l.code_verifier=i),s&&(l.state=s),Vr(`${qo.v1}/user/sso/${e}/postlogin`,{metadata:o,invitationToken:r},{params:l})}async function Rc(){return xr(`${Yo.v1}/public`)}async function _c(e){const{shouldActivate:t,authResponse:n,userId:a,tenantId:i}=await Vr(`${Jo.v1}/signUp`,e),o={shouldActivate:t,userId:a,tenantId:i};if(!t&&n){const{user:e,tenants:t,activeTenant:a}=await cl(n);return x({},o,{user:e,tenants:t,activeTenant:a})}return o}async function Nc(){return xr(Jo.sessions.currentUser.v1)}async function Mc(){return xr(`${Jo.sessions.currentUser.v1}/current`)}async function Fc(e){return Vr(`${Jo.sessions.v1}/revoke`,{userId:e})}async function Gc(){return xr(Jo.sessions.configurations.v1)}async function xc(e){await Vr(Jo.sessions.configurations.v1,e)}async function Vc(e){await Wr(`${Jo.sessions.currentUser.v1}/${e}`)}async function jc(){await Wr(`${Jo.sessions.currentUser.v1}/all`)}async function Bc(){return xr(Jo.accessTokens.v1)}async function Wc(){return xr(er.accessTokens.v1)}async function zc({id:e}){return Wr(`${er.accessTokens.v1}/${e}`)}async function $c({id:e}){return Wr(`${Jo.accessTokens.v1}/${e}`)}async function Kc(e){return Vr(Jo.accessTokens.v1,e)}async function Hc(e){return Vr(er.accessTokens.v1,e)}async function qc(){return xr(Jo.apiTokens.v1)}async function Jc(){return xr(er.apiTokens.v1)}async function Yc(e){return Vr(Jo.apiTokens.v1,e)}async function Xc(e){return Vr(er.apiTokens.v2,e)}async function Qc({tokenId:e}){return Wr(`${er.apiTokens.v1}/${e}`)}async function Zc({tokenId:e}){return Wr(`${Jo.apiTokens.v1}/${e}`)}async function ed({userId:e}){return xr(`${Jo.v1}/${e}`)}async function td(e){return xr(`${Yo.v1}/mfa-policy/allow-remember-device`,{mfaToken:e})}async function nd(e){let{type:t}=e,n=ii(e,nl);return Vr(`${qo.v1}/passwordless/${t.toLocaleLowerCase()}/prelogin`,n)}async function ad(e){let{type:t}=e,n=ii(e,al);return cl(await Vr(`${qo.v1}/passwordless/${t.toLocaleLowerCase()}/postlogin`,n))}async function id(e){let{type:t}=e,n=ii(e,il);return Vr(`${qo.v1}/passwordless/${t.toLocaleLowerCase()}/postlogin`,n)}async function od({token:e}){return Vr(er.invites.verify.v1,{token:e})}async function rd(){return xr(`${sr.v1}/configurations`)}async function sd(e){return Vr(`${sr.v1}/configurations`,e)}async function ld(e,t){return jr(`${sr.v1}/configurations/${e}`,t)}async function cd(e){return Wr(`${sr.v1}/configurations/${e}`)}async function dd(e){return Vr(`${sr.v1}/configurations/metadata`,e)}async function ud(e,t){return Br(`${sr.v1}/configurations/${e}/metadata`,t)}async function yd(e){return Vr(`${sr.v1}/configurations/metadata-url`,e)}async function fd(e,t){return Br(`${sr.v1}/configurations/${e}/metadata-url`,t)}async function pd(e,t){return Vr(`${sr.v1}/configurations/${e}/domains`,t)}async function gd(e,t){return Wr(`${sr.v1}/configurations/${e}/domains/${t}`)}async function Sd(e,t){return Br(`${sr.v1}/configurations/${e}/domains/${t}/validate`)}async function vd(e){return xr(`${sr.v1}/configurations/${e}/roles`)}async function hd(e,t){return Br(`${sr.v1}/configurations/${e}/roles`,t)}async function md(e,t){return Vr(`${sr.v1}/configurations/${e}/groups`,t)}async function Ad(e,{roleIds:t,group:n,id:a}){return jr(`${sr.v1}/configurations/${e}/groups/${a}`,{group:n,roleIds:t})}async function bd(e,t){return Wr(`${sr.v1}/configurations/${e}/groups/${t}`)}async function Td(e){return xr(`${sr.v1}/configurations/${e}/groups`)}async function Ed(e){return Vr(`${qo.v2}/user/sso/prelogin`,e)}async function Id(e){return ol(await Vr(`${qo.v2}/user/oidc/postlogin`,e))}async function kd(e){return ul(await Vr(`${kr}/token`,e))}async function Od(){const e=ls();return ul(await Vr(`${kr}/authorize/silent`,{tenantId:e}))}async function Pd(e){return dl(await Vr(`${kr}/token`,e))}async function Ld(){const e=ls();return dl(await Vr(`${kr}/authorize/silent`,{tenantId:e}))}async function wd(e){return Vr(`${Jo.v1}/phone/reset`,e)}async function Dd(e){return Vr(`${Jo.v1}/phone/reset/verify`,e)}async function Ud(e){return Vr(`${Jo.v1}/phone`,e)}async function Cd(e){return Vr(`${Jo.v1}/phone/verify`,e)}async function Rd(e){return Br(`${Jo.v1}/phone/change`,e)}async function _d(e){return Vr(`${qo.v1}/webauthn/prelogin`,e)}async function Nd(e){return Vr(`${qo.v1}/webauthn/postlogin`,e)}async function Md(e){return cl(await Vr(`${qo.v1}/webauthn/postlogin`,e))}async function Fd(){return Vr(Ho.v1)}async function Gd(){return xr(Ho.v1)}async function xd(e){return Wr(`${Ho.v1}/${e}`)}async function Vd(e){return Vr(`${Ho.v1}/verify`,e)}async function jd(){return xr(`${Yo.v1}/auth/strategies/public`)}async function Bd(){return xr(`${Yo.v1}/auth/strategies`)}async function Wd(){return xr(`${Yo.v1}/mfa/strategies`)}async function zd(){return xr(`${Jo.authorization.v1}`)}async function $d(){return xr(`${Jo.v2}/me`)}const Kd=async()=>{try{return await Zs()}catch(e){}};async function Hd(){const[e]=Jr.getFeatureFlags([Hr],zo.getAppName()||""),t=[{action:$d,shouldLoad:!0},{action:e?Kd:Qs,shouldLoad:sl()},{action:zd,shouldLoad:ll()}].map((e=>async function({shouldLoad:e,action:t}){if(e)return await t()}(e))),[n,a,i]=await Promise.all(t),o=ls();return o&&(n.tenantId=o),x({},n,null!=i?i:{},{entitlements:a})}async function qd(e){const t=await Vr(`${qo.v1}/user/step-up/generate`,e);return t.accessToken?cl(t):t}async function Jd(e){return xr(`${Jo.v2}/me`,null!=e?e:{addRoles:!0})}async function Yd(e){return Br(`${Jo.v2}/me`,e)}async function Xd(e){return Br(`${ur.v1}/me/image/v1`,e,{responseType:"plain",contentType:void 0})}async function Qd(e){return Vr(`${Jo.v1}/passwords/change`,e)}async function Zd(e){var t,n,a,i,o,r;const s=(e.filter||[]).reduce(((e,t)=>x({},e,{[t.id]:t.value})),{}),l=null!=(t=e.sort)&&t.length?{sortBy:null!=(n=null==(a=e.sort)||null==(i=a[0])?void 0:i.id)?n:"name",sortDirection:null!=(o=e.sort)&&null!=(r=o[0])&&r.desc?"desc":"asc"}:null;return xr(lr.v1,x({pageOffset:e.pageOffset,pageSize:e.pageSize},s,l))}async function eu(e){return Vr(Jo.v2,x({},e,{provider:"local"}))}async function tu(e){return Wr(`${lr.v1}/${e.userId}`)}async function nu(e){return Br(lr.v1,e)}async function au(e){const{userId:t,expirationInSeconds:n}=e;return Br(`${Jo.temporary.v1}/${t}`,{expirationInSeconds:n})}async function iu(e){return Wr(`${Jo.temporary.v1}/${e}`)}async function ou(){return xr(Jo.temporary.configuration.v1)}async function ru(e){return Vr(er.invites.user.v1,x({},e))}async function su(e){return jr(er.invites.user.v1,x({},e))}async function lu(){return Wr(er.invites.user.v1)}async function cu(){return xr(er.invites.user.v1)}async function du(){return xr(er.invites.configuration.v1)}async function uu(){return xr(cr.v1)}async function yu(){return xr(Zo.v1)}async function fu(){return xr(`${dr.v1}/members`)}async function pu(e){return Vr(`${lr.v1}/${e.userId}/resendActivationEmail`,{})}async function gu(e){return Vr(Jo.v2,x({},e,{provider:"local"}))}async function Su(e){return Vr(Jo.invitation.resendAll.v1,x({},e))}async function vu(e){var t,n;const a=await xr("/metadata",e);if(null!=a&&null!=(t=a.rows)&&t[0])return null==a||null==(n=a.rows)?void 0:n[0];throw new Error(`metadata not found: ${e.entityName}`)}async function hu(){return xr("/metadata/admin-box")}async function mu(e){return Vr("/metadata/admin-box",e)}async function Au(){const e=await xr("/metadata/ipme");if(e)return e;throw new Error("ip metadata not found")}const bu=async()=>vu({entityName:"notifications"}),Tu=async()=>vu({entityName:"saml"}),Eu=async()=>vu({entityName:"audits"}),Iu=async e=>async function(e){const t=await xr(`/metadata/ip/${e}`);if(t)return t;throw new Error("ip metadata not found")}(e),ku=["dataFilters"],Ou=["templateId","dataFilters"],Pu=["dataFilters"];async function Lu(e){return xr(`${mr.v2}/tenant-reports`,e)}async function wu(e){return xr(`${mr.v2}/${e.id}/tenant-reports`)}async function Du(e){let{dataFilters:t}=e,n=ii(e,ku);return{html:await xr(`${Ar.v1}/preview-report`,x({},n,{dataFilters:btoa(JSON.stringify(t||{})),responseType:"html"}),{responseType:"plain"})}}async function Uu(e){let{templateId:t,dataFilters:n}=e,a=ii(e,Ou);return Vr(`${mr.v2}/${t}/tenant-reports`,x({},a,{dataFilters:btoa(JSON.stringify(n||{}))}))}async function Cu(e){let{dataFilters:t}=e,n=ii(e,Pu);const a=await xr(`${Ar.v1}/preview-report`,x({},n,{dataFilters:btoa(JSON.stringify(t||{}))}),{responseType:"blob"});let i="text/html",o="html";"pdf"===n.responseType?(i="application/pdf",o="pdf"):"image"===n.responseType&&(i="image/jpeg",o="jpg");const r=new Blob([a],{type:i}),s=URL.createObjectURL(r),l=document.createElement("a");l.href=s,l.setAttribute("download",`report_${n.name||""}.${o}`),l.click(),setTimeout(l.remove.bind(l))}async function Ru(e){return Vr(`${Ar.v1}/tenant-reports`,e)}async function _u(e){return xr(br,{params:e})}async function Nu(e){return Br(`${br}/status`,{params:e})}async function Mu(e){const{notificationId:t,pinStatus:n}=e;return Br(`${br}/${n}`,{notificationId:t})}async function Fu(){return Vr(`${br}/status/mark-all-read`)}const Gu=["endpoint","headerProps"];async function xu(e){return xr(Tr,e)}async function Vu(e){return xr(`${Tr}/stats`,e)}async function ju(e){const{endpoint:t,headerProps:n}=e,a=ii(e,Gu);return zr(`${Tr}/export/${t}`,{properties:n},a)}const Bu=["eventKey"],Wu=["eventKey"],zu=()=>xr(`${gr.v1}/slack`),$u=()=>xr(`${gr.v1}/slack/applications`),Ku=()=>xr(`${gr.v1}/slack/channels`),Hu=e=>e.id?jr(`${gr.v1}/slack/subscription/${e.id}`,e):Vr(`${gr.v1}/slack/subscriptions`,e),qu=e=>Wr(`${gr.v1}/slack/subscriptions/${e.id}`),Ju=e=>Vr(`${gr.v1}/slack/applications/registrations`,{code:e}),Yu=()=>xr(`${gr.v1}/emails`),Xu=e=>{let{eventKey:t}=e,n=ii(e,Bu);return Vr(`${gr.v1}/emails/${t}`,n)},Qu=({eventKey:e,enabled:t})=>jr(`${gr.v1}/emails/${e}`,{enabled:t}),Zu=(e,t)=>Wr(`${gr.v1}/emails/${e}/subscriptions/${t}`),ey=(e,t,n)=>Br(`${gr.v1}/emails/${t}/subscriptions/${e}`,n),ty=e=>Wr(`${gr.v1}/emails/${e}`),ny=()=>xr(`${gr.v2}/sms`),ay=e=>{let{eventKey:t}=e,n=ii(e,Wu);return Vr(`${gr.v2}/sms/${t}`,n)},iy=({eventKey:e,enabled:t})=>jr(`${gr.v2}/sms/${e}`,{enabled:t}),oy=(e,t)=>Wr(`${gr.v2}/sms/${e}/subscriptions/${t}`),ry=(e,t,n)=>Br(`${gr.v2}/sms/${t}/subscriptions/${e}`,n),sy=e=>Wr(`${gr.v2}/sms/${e}`),ly=()=>xr(Ir),cy=e=>e._id?jr(`${Ir}/${e._id}`,e):Vr(`${Ir}/custom`,e),dy=e=>Wr(`${Ir}/${e}`),uy=(e,t=0,n=10)=>{const a=new URLSearchParams({id:e,offset:`${t}`,limit:`${n}`});return xr(`${Ir}/logs/?${a.toString()}`)},yy=e=>Vr(`${Ir}/test`,e),fy=e=>Vr(`${Ir}/logs/${e}/retries`),py=()=>xr(`${Er.v1}/categories`),gy=e=>xr(Er.v1,{channels:e});async function Sy(e,t){return Br(yr.v1,e,{headers:$r(t)})}async function vy(e){return xr(yr.v1,void 0,{headers:$r(e)})}async function hy(){return xr(`${yr.v1}/public`)}const my=["roleId"],Ay=["roleId"],by=["permissionId"];async function Ty(){return xr(tr.v1)}async function Ey(e){return Vr(tr.v1,e)}async function Iy({roleId:e}){return Wr(`${tr.v1}/${e}`)}async function ky(e){let{roleId:t}=e,n=ii(e,my);return jr(`${tr.v1}/${t}`,n)}async function Oy(e){let{roleId:t}=e,n=ii(e,Ay);return Br(`${tr.v1}/${t}/permissions`,n)}async function Py(){return xr(Zo.v1)}async function Ly(e){let{permissionId:t}=e,n=ii(e,by);return Br(`${Zo.v1}/${t}/roles`,n)}async function wy(){return xr(`${Zo.v1}/categories`)}async function Dy(e){return Vr(tr.v2,e)}async function Uy(){return xr(Sr.subscriptions.v1)}async function Cy(e){return xr(`${Sr.subscriptions.v1}/${e}`)}async function Ry(e){return Br(`${Sr.subscriptions.v1}/${e}/cancellations/`,{})}async function _y(e){return Br(`${Sr.subscriptions.v1}/${e}/renewals/`,{})}async function Ny(e,{paymentMethodId:t,planId:n}){return Br(`${Sr.subscriptions.v1}/${e}`,{paymentMethodId:t,planId:n})}async function My(e){return xr(`${hr.v1}/${e}`)}async function Fy(){return xr(`${hr.v1}`)}async function Gy(e){return Br(`${hr.v1}/${e}/cancellations/`,{})}async function xy(e){return Br(`${hr.v1}/${e}/renewals/`,{})}async function Vy(e,{paymentMethodId:t,planId:n}){return Br(`${hr.v1}/${e}`,{paymentMethodId:t,planId:n})}async function jy(){return xr(Sr.plans.v1)}async function By(e){return xr(`${Sr.plans.v1}/${e}`)}async function Wy(){return xr(Sr.invoices.v1)}async function zy(e){return xr(`${Sr.invoices.v1}/${e}`)}async function $y(e,t){return xr(`${Sr.invoices.v1}/${e}/pdf`,{outputFileName:t},{responseType:"blob"})}const Ky=["email"];async function Hy(){return xr(Sr.paymentMethods.v1)}async function qy(e){return xr(`${Sr.paymentMethods.v1}/${e}`)}async function Jy(e,t){let{email:n}=t,a=ii(t,Ky);return jr(`${Sr.paymentMethods.v1}/${e}/billing-details`,{email:n,address:a})}async function Yy(e){return Vr(Sr.paymentProviders.stripe.subscriptions.v1,e)}async function Xy(e){return xr(`${Sr.paymentProviders.stripe.customers.v1}/${e}`)}async function Qy(e){return Vr(`${Sr.paymentProviders.stripe.customers.v1}`,e)}async function Zy(){return xr(`${Sr.paymentProviders.stripe.publicConfigurations.v1}`)}async function ef(e){return Vr(`${Sr.paymentProviders.stripe.setupIntents.v1}`,e)}async function tf(e){return xr(`${Sr.summaries.v1}/${e}`)}async function nf(e){return xr(`${Sr.tenantConfiguration.v1}/${e}`)}async function af(e){return Vr(`${Sr.tenantConfiguration.v1}`,e)}async function of(){return xr(vr.v1)}async function rf(){return xr(`${Sr.configurations.vendorPublicConfigurations.v1}`)}let sf,lf,cf,df,uf,yf;async function ff({userId:e}){return xr(`${ir.v1}/${e}/apps`)}async function pf({userIds:e}){return xr(`${ir.v1}/users-apps`,{userIds:e.join(",")})}async function gf(){return xr(_r.v1)}async function Sf({appIds:e,includeFreeAccess:t=!0}){return xr(Rr,{ids:e.join(","),_includeFreeAccess:t})}async function vf(e){return Vr(`${ir.v1}/apps-user`,e)}async function hf(e){return Wr(`${ir.v1}/user-apps`,e)}async function mf(e){return xr(`${ir.v1}/apps-users`,e)}async function Af(){return xr("/vendors/public")}async function bf(e){return xr(nr.v1,e)}async function Tf(e){return Vr(nr.v1,e)}async function Ef(e,t){return Wr(nr.v1,e,{headers:$r(t)})}async function If(e,t,n){return Vr(`${nr.v1}/${e}/roles`,t,{headers:$r(n)})}async function kf(e,t,n){return Wr(`${nr.v1}/${e}/roles`,t,{headers:$r(n)})}async function Of(e,t,n){return jr(`${nr.v1}/${e}/roles`,t,{headers:$r(n)})}async function Pf(e,t){return Vr(pr.v1,e,{headers:$r(t)})}async function Lf(e,t){return Wr(`${pr.v1}/${e}`,void 0,{headers:$r(t)})}async function wf({tenantId:e},t,n){return jr(`${pr.v1}/${e}`,t,{headers:$r(n)})}async function Df(e,t,n){return Br(`${nr.v1}/${e}/access`,t,{headers:$r(n)})}async function Uf(e,t){return Vr(`${nr.v2}/`,e,{headers:$r(t)})}async function Cf(){return xr(`${Pr}`)}async function Rf(e,t){return jr(`${Pr}/${e}`,t)}async function _f(e){return Vr(`${Pr}`,e)}async function Nf(e){return Wr(`${Pr}/${e}`)}async function Mf(e){return xr(`${Lr}/${e}/Users/count`)}async function Ff(e){return Vr(`${ar.v1}`,e)}!function(e){e.ACTIVE="active",e.CANCELED="canceled",e.INCOMPLETE="incomplete",e.EXPIRED="expired",e.TRIALING="trialing",e.TRIAL_ENDED="trialEnded"}(sf||(sf={})),function(e){e.UNKNWON="unknown",e.CARD="card"}(lf||(lf={})),function(e){e.AT_PERIOD_END="atPeriodEnd"}(cf||(cf={})),(df||(df={})).Stripe="Stripe",function(e){e.CHANGE_TO_DEFAULT="change_to_default",e.RETAIN_TRIAL="retain_trial"}(uf||(uf={})),function(e){e.CREATE="create_customer"}(yf||(yf={}));const Gf=["groupId"];async function xf({groupId:e},t){return xr(`${or.v1}/${e}`,x({},t))}async function Vf(e){return xr(`${or.v1}`,x({},e))}async function jf(e,t){return Vr(`${or.getByIds.v1}`,e,{params:t})}async function Bf(e){return Vr(`${or.v1}`,e)}async function Wf(e){let{groupId:t}=e,n=ii(e,Gf);return jr(`${or.v1}/${t}`,n)}async function zf(e){return Wr(`${or.v1}/${e}`)}async function $f(e,t){return Vr(`${or.v1}/${e}/roles`,t)}async function Kf(e,t){return Wr(`${or.v1}/${e}/roles`,t)}async function Hf(e,t){return Vr(`${or.v1}/${e}/users`,t)}async function qf(e,t){return Wr(`${or.v1}/${e}/users`,t)}async function Jf(){return xr(`${or.configurations.v1}`)}async function Yf(e){return Vr(`${or.configurations.v1}`,e)}async function Xf(){return xr(Ur.v1)}async function Qf(){return xr(Cr.v1)}async function Zf(e){return xr(`${rr.v1}`,e)}async function ep(e){return Vr(`${rr.v1}`,e)}async function tp(e){return Wr(`${rr.v1}/${e}`)}async function np(e){return Vr(`${rr.v1}/preverify`,e)}async function ap(e){return Vr(`${rr.v1}/verify`,e)}async function ip(e,t){return Vr(`${rr.v1}/${e}/delete/verify`,t)}let op,rp,sp,lp;!function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"}(op||(op={})),function(e){e.createdAt="createdAt",e.name="name",e.tenantId="tenantId"}(rp||(rp={})),function(e){e.CUSTOMER="customer",e.SPAM="spam",e.TEST="test",e.RESELLER="reseller",e.HEADQUARTER="headquarter"}(sp||(sp={})),function(e){e.NEVER="NEVER",e.ALWAYS="ALWAYS",e.ASSIGNABLE="ASSIGNABLE"}(lp||(lp={}));const cp=[/^(.*)\/logout$/g,"/logout",/^\/identity\/resources\/auth\/v[0-9]*\/user\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/passwordless\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/webauthn\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/token\/refresh$/g,/^\/identity\/resources\/users\/v[0-9]*$/g,/^\/identity\/resources\/users\/v[0-9]*\/signUp$/g,/^\/identity\/resources\/users\/v[0-9]*\/activate$/g,/^\/identity\/resources\/users\/v[0-9]*\/invitation\/accept$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/verify$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/[^\/]*\/[^\/]*\/verify$/g,/^\/oauth\/token$/g,/^\/oauth\/authorize\/silent$/g],dp=`${qo.v1}/user/token/refresh`,up=`${kr}/authorize/silent`,yp=`${Jo.v2}/me`,fp=`${Jo.v2}/me/tenants`,pp=`${Jo.v3}/me/tenants`;let gp,Sp,vp,hp,mp,Ap,bp,Tp,Ep;!function(e){e.FRONTEGG="frontegg",e.OKTA="okta",e.AZURE_AD="azure-ad",e.OTHER="other"}(gp||(gp={})),function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"}(Sp||(Sp={})),function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"}(vp||(vp={})),function(e){e.FORCE_MFA="FORCE_MFA",e.BREACHED_PASSWORDS_EXIST="BREACHED_PASSWORDS_EXIST",e.ENABLE_USER_LOCKOUT="ENABLE_USER_LOCKOUT",e.STRENGTHEN_USER_LOCKOUT="STRENGTHEN_USER_LOCKOUT",e.ENABLE_PASSWORD_HISTORY="ENABLE_PASSWORD_HISTORY",e.STRENGTHEN_PASSWORD_HISTORY="STRENGTHEN_PASSWORD_HISTORY",e.ENABLE_FORCE_RELOGIN="ENABLE_FORCE_RELOGIN",e.SET_FORCE_RELOGIN="SET_FORCE_RELOGIN",e.ENABLE_SESSION_CONCURRENCY="ENABLE_SESSION_CONCURRENCY",e.SET_SESSION_CONCURRENCY="SET_SESSION_CONCURRENCY",e.ENABLE_IDLE_SESSION="ENABLE_IDLE_SESSION",e.SET_IDLE_SESSION="SET_IDLE_SESSION",e.ENABLE_IP_RESTRICTIONS="ENABLE_IP_RESTRICTIONS",e.CHANGE_IP_TO_ALLOWLIST="CHANGE_IP_TO_ALLOWLIST",e.ENABLE_DOMAIN_RESTRICTIONS="ENABLE_DOMAIN_RESTRICTIONS",e.CHANGE_DOMAIN_TO_ALLOWLIST="CHANGE_DOMAIN_TO_ALLOWLIST",e.CONFIGURE_SSO="CONFIGURE_SSO"}(hp||(hp={})),function(e){e.MFA_FORCED="MFA_FORCED",e.PARTIALLY_FORCED_MFA="PARTIALLY_FORCED_MFA",e.PARTIAL_MFA_USAGE="PARTIAL_MFA_USAGE",e.FULL_MFA_USAGE="FULL_MFA_USAGE",e.BREACHED_PASSWORD_USERS_EXIST="BREACHED_PASSWORD_USERS_EXIST",e.IMPROVE_LOCKOUT_POLICY="IMPROVE_LOCKOUT_POLICY",e.IMPROVE_PASSWORD_HISTORY_POLICY="IMPROVE_PASSWORD_HISTORY_POLICY",e.NO_SESSION_SETTINGS="NO_SESSION_SETTINGS",e.PARTIAL_SESSION_SETTINGS="PARTIAL_SESSION_SETTINGS",e.FULL_SESSION_SETTINGS="FULL_SESSION_SETTINGS",e.NO_IP_RESTRICTIONS="NO_IP_RESTRICTIONS",e.IP_ALLOWLIST="IP_ALLOWLIST",e.IP_DENYLIST="IP_DENYLIST",e.NO_DOMAIN_RESTRICTIONS="NO_DOMAIN_RESTRICTIONS",e.DOMAIN_ALLOWLIST="DOMAIN_ALLOWLIST",e.DOMAIN_DENYLIST="DOMAIN_DENYLIST",e.FULL_PASSWORD_SETTINGS="FULL_PASSWORD_SETTINGS"}(mp||(mp={})),function(e){e.SEND_RESET_BREACHED_PASSWORD_EMAIL="SEND_RESET_BREACHED_PASSWORD_EMAIL",e.ADJUST_FORCE_RELOGIN="ADJUST_FORCE_RELOGIN",e.ADJUST_MAX_CONCURRENT_SESSIONS="ADJUST_MAX_CONCURRENT_SESSIONS",e.ADJUST_IDLE_TIMEOUT="ADJUST_IDLE_TIMEOUT"}(Ap||(Ap={})),function(e){e.SEVERE="SEVERE",e.WARNING="WARNING",e.INFO="INFO"}(bp||(bp={})),function(e){e.MFA="MFA",e.SESSIONS="SESSIONS",e.PASSWORD="PASSWORD",e.INACTIVITY="INACTIVITY",e.IP="IP",e.DOMAIN="DOMAIN",e.SSO="SSO"}(Tp||(Tp={})),function(e){e.FREE_ACCESS="FREE_ACCESS",e.MANAGED_ACCESS="MANAGED_ACCESS"}(Ep||(Ep={}));const Ip={auth:s,teams:l,metadata:c,reports:d,connectivity:f,notifications:u,audits:y,tenants:o,accountSettings:p,roles:g,subscriptions:S,vendor:h,subTenants:m,featureFlags:t,directory:A,impersonate:b,groups:T,users:i,entitlements:r,securityCenter:E,userPhoneNumbers:I,applications:v},kp={fetch:e,ContextHolder:zo,FronteggContext:$o,api:Ip,FronteggApiError:Ko,AuthStrategyEnum:Oa,MachineToMachineAuthStrategy:Pa,SocialLoginProviders:ka,ISubscriptionCancellationPolicy:cf,ISubscriptionStatus:sf,PaymentMethodType:lf,ProviderType:df};let Op,Pp;!function(e){e.LOAD_SSO_CONFIGURATIONS="LOAD_SSO_CONFIGURATIONS",e.SAVE_SSO_CONFIGURATION="SAVE_SSO_CONFIGURATION",e.UPDATE_SSO_CONFIGURATION="UPDATE_SSO_CONFIGURATION",e.SAVE_SSO_CONFIGURATION_BY_METADATA="SAVE_SSO_CONFIGURATION_BY_METADATA",e.UPDATE_SSO_CONFIGURATION_BY_METADATA="UPDATE_SSO_CONFIGURATION",e.DELETE_SSO_CONFIGURATION="DELETE_SSO_CONFIGURATION",e.SAVE_SSO_DOMAIN="SAVE_SSO_DOMAIN",e.DELETE_SSO_DOMAIN="DELETE_SSO_DOMAIN",e.VALIDATE_SSO_DOMAIN="VALIDATE_SSO_DOMAIN",e.UPDATE_SSO_DEFAULT_ROLES="UPDATE_SSO_DEFAULT_ROLES",e.DELETE_SSO_GROUPS="DELETE_SSO_GROUPS",e.SAVE_SSO_GROUPS="SAVE_SSO_GROUPS",e.GET_SSO_AUTHORIZATION_ROLES="GET_SSO_AUTHORIZATION_ROLES"}(Op||(Op={})),function(e){e.Saml="saml",e.Okta="okta",e.Azure="azure",e.Google="google",e.Oidc="oidc"}(Pp||(Pp={}));const Lp="input is invalid type",wp="undefined"!=typeof ArrayBuffer,Dp="0123456789abcdef".split(""),Up=[-2147483648,8388608,32768,128],Cp=[24,16,8,0],Rp=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],_p=["hex","array","digest","arrayBuffer"],Np=[];Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),wp&&!ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});const Mp=function(e){return function(t){const n=new Gp(!0).update(t);return null==n?void 0:n[e]()}},Fp=function(e){return function(t,n){const a=new xp(t,!0).update(n);return null==a?void 0:a[e]()}};class Gp{constructor(e=!1){this.blocks=void 0,this.h0=void 0,this.h1=void 0,this.h2=void 0,this.h3=void 0,this.h4=void 0,this.h5=void 0,this.h6=void 0,this.h7=void 0,this.block=void 0,this.start=void 0,this.bytes=void 0,this.hBytes=void 0,this.finalized=void 0,this.hashed=void 0,this.first=void 0,this.lastByteIndex=void 0,this.sharedMemory=!1,this.toString=()=>this.hex(),this.array=()=>Gp.prototype.digest(),e?(Np[0]=Np[16]=Np[1]=Np[2]=Np[3]=Np[4]=Np[5]=Np[6]=Np[7]=Np[8]=Np[9]=Np[10]=Np[11]=Np[12]=Np[13]=Np[14]=Np[15]=0,this.blocks=Np):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.sharedMemory=e}update(e){if(this.finalized)return;let t;const n=typeof e;if("string"!==n){if("object"!==n)throw new Error(Lp);if(null===e)throw new Error(Lp);if(wp&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||wp&&ArrayBuffer.isView(e)))throw new Error(Lp);t=!0}let a,i,o=0;const r=e.length,s=this.blocks;for(;o<r;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)for(i=this.start;o<r&&i<64;++o)s[i>>2]|=e[o]<<Cp[3&i++];else for(i=this.start;o<r&&i<64;++o)a=e.charCodeAt(o),a<128?s[i>>2]|=a<<Cp[3&i++]:a<2048?(s[i>>2]|=(192|a>>6)<<Cp[3&i++],s[i>>2]|=(128|63&a)<<Cp[3&i++]):a<55296||a>=57344?(s[i>>2]|=(224|a>>12)<<Cp[3&i++],s[i>>2]|=(128|a>>6&63)<<Cp[3&i++],s[i>>2]|=(128|63&a)<<Cp[3&i++]):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),s[i>>2]|=(240|a>>18)<<Cp[3&i++],s[i>>2]|=(128|a>>12&63)<<Cp[3&i++],s[i>>2]|=(128|a>>6&63)<<Cp[3&i++],s[i>>2]|=(128|63&a)<<Cp[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}finalize(){if(this.finalized)return;this.finalized=!0;const e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=Up[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}hash(){let e,t,n,a,i,o,r,s,l,c,d,u=this.h0,y=this.h1,f=this.h2,p=this.h3,g=this.h4,S=this.h5,v=this.h6,h=this.h7;const m=this.blocks;for(e=16;e<64;++e)i=m[e-15],t=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,i=m[e-2],n=(i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[e]=m[e-16]+t+m[e-7]+n<<0;for(d=y&f,e=0;e<64;e+=4)this.first?(s=704751109,i=m[0]-210244248,h=i-1521486534<<0,p=i+143694565<<0,this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=u&y,a=s^u&f^d,r=g&S^~g&v,i=h+n+r+Rp[e]+m[e],o=t+a,h=p+i<<0,p=i+o<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),l=p&u,a=l^p&y^s,r=h&g^~h&S,i=v+n+r+Rp[e+1]+m[e+1],o=t+a,v=f+i<<0,f=i+o<<0,t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),c=f&p,a=c^f&u^l,r=v&h^~v&g,i=S+n+r+Rp[e+2]+m[e+2],o=t+a,S=y+i<<0,y=i+o<<0,t=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),n=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7),d=y&f,a=d^y&p^c,r=S&v^~S&h,i=g+n+r+Rp[e+3]+m[e+3],o=t+a,g=u+i<<0,u=i+o<<0;this.h0=this.h0+u<<0,this.h1=this.h1+y<<0,this.h2=this.h2+f<<0,this.h3=this.h3+p<<0,this.h4=this.h4+g<<0,this.h5=this.h5+S<<0,this.h6=this.h6+v<<0,this.h7=this.h7+h<<0}hex(){this.finalize();const e=this.h0,t=this.h1,n=this.h2,a=this.h3,i=this.h4,o=this.h5,r=this.h6,s=this.h7;let l=Dp[e>>28&15]+Dp[e>>24&15]+Dp[e>>20&15]+Dp[e>>16&15]+Dp[e>>12&15]+Dp[e>>8&15]+Dp[e>>4&15]+Dp[15&e]+Dp[t>>28&15]+Dp[t>>24&15]+Dp[t>>20&15]+Dp[t>>16&15]+Dp[t>>12&15]+Dp[t>>8&15]+Dp[t>>4&15]+Dp[15&t]+Dp[n>>28&15]+Dp[n>>24&15]+Dp[n>>20&15]+Dp[n>>16&15]+Dp[n>>12&15]+Dp[n>>8&15]+Dp[n>>4&15]+Dp[15&n]+Dp[a>>28&15]+Dp[a>>24&15]+Dp[a>>20&15]+Dp[a>>16&15]+Dp[a>>12&15]+Dp[a>>8&15]+Dp[a>>4&15]+Dp[15&a]+Dp[i>>28&15]+Dp[i>>24&15]+Dp[i>>20&15]+Dp[i>>16&15]+Dp[i>>12&15]+Dp[i>>8&15]+Dp[i>>4&15]+Dp[15&i]+Dp[o>>28&15]+Dp[o>>24&15]+Dp[o>>20&15]+Dp[o>>16&15]+Dp[o>>12&15]+Dp[o>>8&15]+Dp[o>>4&15]+Dp[15&o]+Dp[r>>28&15]+Dp[r>>24&15]+Dp[r>>20&15]+Dp[r>>16&15]+Dp[r>>12&15]+Dp[r>>8&15]+Dp[r>>4&15]+Dp[15&r];return l+=Dp[s>>28&15]+Dp[s>>24&15]+Dp[s>>20&15]+Dp[s>>16&15]+Dp[s>>12&15]+Dp[s>>8&15]+Dp[s>>4&15]+Dp[15&s],l}digest(){this.finalize();const e=this.h0,t=this.h1,n=this.h2,a=this.h3,i=this.h4,o=this.h5,r=this.h6,s=this.h7,l=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,r>>24&255,r>>16&255,r>>8&255,255&r];return l.push(s>>24&255,s>>16&255,s>>8&255,255&s),l}arrayBuffer(){this.finalize();const e=new ArrayBuffer(32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),t.setUint32(28,this.h7),e}}class xp extends Gp{constructor(e,t=!1){let n;super(t),this.inner=void 0,this.oKeyPad=void 0;const a=typeof e;if("string"===a){const t=[],a=e.length;let i,o=0;for(n=0;n<a;++n)i=e.charCodeAt(n),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>6,t[o++]=128|63&i):i<55296||i>=57344?(t[o++]=224|i>>12,t[o++]=128|i>>6&63,t[o++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),t[o++]=240|i>>18,t[o++]=128|i>>12&63,t[o++]=128|i>>6&63,t[o++]=128|63&i);e=t}else{if("object"!==a)throw new Error(Lp);if(null===e)throw new Error(Lp);if(wp&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||wp&&ArrayBuffer.isView(e)))throw new Error(Lp)}var i;e.length>64&&(e=null==(i=new Gp(!0).update(e))?void 0:i.array());const o=[],r=[];for(n=0;n<64;++n){const t=e[n]||0;o[n]=92^t,r[n]=54^t}Gp.call(this,t),this.update(r),this.oKeyPad=o,this.inner=!0,this.sharedMemory=t}finalize(){if(super.finalize(),this.inner){this.inner=!1;const e=this.array();Gp.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Gp.prototype.finalize.call(this)}}}const Vp=function(){const e=Mp("hex");e.create=function(){return new Gp},e.update=function(t){return e.create().update(t)};for(let t=0;t<_p.length;++t){const n=_p[t];e[n]=Mp(n)}return e}();function jp(e,t){const n=x({},e);return t.forEach((e=>{delete n[e]})),n}async function Bp(e){var t,n;return null!=(t=window.crypto)&&null!=(n=t.subtle)&&n.digest?async function(e){const t=await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}(e):(console.warn("Generating CodeChallenge in non-secure domain:",window.location.origin),async function(e){const t=Vp.digest((new TextEncoder).encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}(e))}function Wp(e=16){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let a=0;a<e;a++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}!function(){const e=Fp("hex");e.create=function(e){return new xp(e)},e.update=function(t,n){return e.create(t).update(n)};for(let t=0;t<_p.length;++t){const n=_p[t];e[n]=Fp(n)}}();const zp=e=>new Promise(((t,n)=>{const a=new FileReader;a.readAsText(e),a.onload=()=>t(a.result),a.onerror=n}));function*$p(e){const t=yield qi((e=>e.root.appName));return Jr.getFeatureFlags(e,t)}const Kp={clientId:"CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e",secret:"SECRET_16806d3d-8fc3-4450-be97-abdaf66b723e",createdAt:"createdAt",description:"Demo API Token (preview only)"},Hp=x({},Kp,{roleIds:[],tenantId:"my-tenant-id",createdByUserId:"createdByUserId"}),qp=[{id:"a040dcf6-b907-4e83-9970-6bd23c88fd40",key:"ReadOnly",name:"Read Only",description:null,isDefault:!1,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],vendorId:"vendorId"},{id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0",key:"Admin",name:"Admin",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","16647407-ed6f-4ca6-83a0-86225d921959","f403c6b9-1abe-4ec7-9971-aa032255fc25","a43e059d-d731-44b1-94bb-fb6b16c62210"],vendorId:"vendorId"},{id:"1234",key:"Support",name:"Support",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","f26b00f8-ffe0-4739-b15c-7db15c27ea26","a9c803b0-ebfa-49b9-9607-f0d3a390ee61"],tenantId:"tenantId",vendorId:"vendorId"}],Jp={sub:"",tenants:[],id:"testId",name:"Demo User Name",email:"demo-user@frontegg.com",mfaEnrolled:!0,profilePictureUrl:"https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434",roles:[{id:"roleId",key:"admin",isDefault:!1,name:"Admin",description:null,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],tenantId:"tenantId",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date}],permissions:[{id:"8d71b676-754c-4600-afe7-ca5add1e6809",key:"fe.*",name:"General Admin",description:"description",categoryId:"category",fePermission:!0,createdAt:new Date,updatedAt:new Date,roleIds:[]}],tenantId:"my-tenant-id",tenantIds:["my-tenant-id"],activatedForTenant:!0,metadata:JSON.stringify({phoneNumber:"+972-54123456",jobTitle:"Developer",address:{city:"Tel Aviv",country:"Israel"}}),verified:!1},Yp=x({},Jp,{accessToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1MTY5YmY0Zi02YmI5LTQ5NGMtOGNkZS05MDc4NDQ0NWY4MDciLCJuYW1lIjoiRHVtbXkgVXNlciIsImVtYWlsIjoiZHVtbXlAZnJvbnRlZ2cuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsIm1ldGFkYXRhIjp7fSwicm9sZXMiOlsiYWRtaW4iXSwicGVybWlzc2lvbnMiOlsiZmUuKiJdLCJ0ZW5hbnRJZCI6Im15LXRlbmFudC1pZCIsInRlbmFudElkcyI6WyJteS10ZW5hbnQtaWQiXSwicHJvZmlsZVBpY3R1cmVVcmwiOiJodHRwczovL3d3dy5ncmF2YXRhci5jb20vYXZhdGFyLzQyYjJhZDJiYWQ2ZmM5YjlkYjUwODZkZmNmODA3MmFjP2Q9aHR0cHM6Ly91aS1hdmF0YXJzLmNvbS9hcGkvZmUvMTI4L3JhbmRvbT90PTE2MTcyNjE4OTA4NzU_dD0xNjE3MjYxOTE3NDM0IiwidHlwZSI6InVzZXJUb2tlbiIsImlhdCI6MTYxNzkwNjMyNCwiZXhwIjoxNjE3OTkyNzI0LCJpc3MiOiJmcm9udGVnZyJ9.paaXLkpWEWbQmUtoK2P8IwXCxK4WJp7XhXonvzF8g1I",expiresIn:86400,mfaRequired:!1,refreshToken:"refresh-token-dummy-de39dc9c-9d22-4852-b7f5-c3c0aa613b58",type:"userToken",iat:1617906324,exp:1617992724,iss:"frontegg",email_verified:!0}),Xp={loading:!1,error:void 0,saving:!0,profile:Jp},Qp={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date,allowOverrideEnforcePasswordHistory:!0,allowOverridePasswordComplexity:!1,allowOverridePasswordExpiration:!1,allowSignups:!0,apiTokensEnabled:!0,cookieSameSite:"cookieSameSite",defaultRefreshTokenExpiration:0,defaultTokenExpiration:1,publicKey:"publicKey"},Zp={allowSignups:!0,allowNotVerifiedUsersLogin:!1,apiTokensEnabled:!0,forcePermissions:!1,authStrategy:Oa.EmailAndPassword,machineToMachineAuthStrategy:Pa.ClientCredentials},eg={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date},tg={id:"id",enabled:!0,maxAttempts:1,createdAt:new Date,updatedAt:new Date},ng={id:"id",enabled:!0,historySize:1,createdAt:new Date,updatedAt:new Date},ag={enabled:!0,domain:"domain",validated:!0,generatedVerification:"generatedVerification",ssoEndpoint:"ssoEndpoint",publicCertificate:"publicCertificate",signRequest:!0,createdAt:new Date,updatedAt:new Date,acsUrl:void 0,spEntityId:void 0,oidcClientId:void 0,oidcSecret:void 0,type:void 0},ig={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",properties:[],vendorId:"vendorId",entityName:"saml",isActive:!0,configuration:{acsUrl:"acsUrl",spEntityId:"spEntityId"}},og=[{id:"id",description:"description",key:"key",name:"name",permissions:[],permissionLevel:1}],rg={firstLoad:!1,loading:!1,error:void 0,saving:!1,samlConfiguration:ag,roles:og,authorizationRoles:[],errors:{},loaders:{},ssoConfigurations:[]},sg=[{description:"string",fePermission:!0,id:"id",key:"key",name:"name",roleIds:[],createdAt:new Date,updatedAt:new Date,categoryId:"categoryId"}],lg={id:"id2",email:"demo-user2@frontegg.com",name:"Demo User Name2",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,verified:!1,createdAt:(new Date).toISOString(),customData:void 0,lastLogin:void 0,mfaEnabled:void 0,roles:[qp[0]],groups:[{id:"id2",name:"Developers",color:"#03A9F4",roles:[qp[0]],managedBy:vp.FRONTEGG}]},cg={id:lg.id,email:lg.email,name:lg.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[qp[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},dg={id:"id",email:"demo-user@frontegg.com",name:"Demo User Name",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,createdAt:new Date(2022,4,1).toISOString(),verified:!0,customData:void 0,lastLogin:new Date(2022,5,25).toISOString(),mfaEnabled:void 0,roles:[qp[1]],groups:[{id:"id1",name:"Designers",color:"#E1F5E2",roles:[qp[0]],managedBy:vp.FRONTEGG}]},ug={id:dg.id,email:dg.email,name:dg.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[qp[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},yg={metadata:"",mfaEnrolled:!1,provider:"",sub:"",tenantIds:[],tenants:[],verified:!1,id:"id",email:"email",name:"name",tenantId:"tenantId",createdAt:new Date},fg=[dg,lg],pg=[ug,cg],gg=[yg],Sg=[{id:"my-tenant-id",isReseller:!1,name:"Frontegg demo",deletedAt:null,metadata:void 0,tenantId:"my-tenant-id",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date,address:void 0,timezone:void 0,dateFormat:void 0,timeFormat:void 0,currency:void 0,logo:void 0}],vg=[{id:"laptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date,ipAddress:"190.194.88.251",current:!0},{id:"iphone",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",createdAt:new Date(Date.now()-1e4),ipAddress:"191.49.203.21"},{id:"tablet",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",createdAt:new Date(Date.now()-3e4),ipAddress:"130.19.196.136"},{id:"anotherlaptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date(Date.now()-1002232300),ipAddress:"2.228.163.92"}],hg={sessionConcurrentConfiguration:{isActive:!0,maxSessions:10},sessionIdleTimeoutConfiguration:{isActive:!0,timeout:3600},sessionTimeoutConfiguration:{isActive:!0,timeout:7776e3}},mg={isActive:!0,strategy:Kn.ALLOW},Ag=[{updatedAt:new Date,createdAt:new Date,id:"1",ip:"255.255.255.255",isActive:!0,strategy:Kn.ALLOW,description:"My IP"},{updatedAt:new Date,createdAt:new Date,id:"2",ip:"255.255.255.254",isActive:!0,strategy:Kn.ALLOW,description:"IP 2"},{updatedAt:new Date,createdAt:new Date,id:"3",ip:"255.255.255.253",isActive:!0,strategy:Kn.BLOCK,description:"IP 3"},{updatedAt:new Date,createdAt:new Date,id:"4",ip:"255.255.255.253",isActive:!0,strategy:Kn.BLOCK,description:"IP 4"}],bg=e=>{const t=[];return Array.from({length:e}).forEach(((e,n)=>{t.push(x({},dg,{name:"Demo User",id:`id${n}`,profilePictureUrl:null,createdAt:new Date}))})),t},Tg=e=>({id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0"+e,key:e,name:e,description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:[],tenantId:"tenantId",vendorId:"vendorId"}),Eg=[{id:"id1",name:"Designers",color:"#E1F5E2",description:"The whole design team",users:bg(6),roles:[Tg("Editor")],metadata:'{"lastTermsCheck":"2022-08-16T10:31:11.270Z"}',managedBy:vp.FRONTEGG},{id:"id2",name:"Developers",color:"#03A9F4",description:"All frontend and backend developers",users:bg(44),roles:[Tg("Editor")],managedBy:vp.FRONTEGG},{id:"id3",name:"Product",color:"#E1583E",description:"PMs and team leads",users:bg(8),roles:[Tg("Viewer")],managedBy:vp.FRONTEGG},{id:"id4",name:"Management",color:"#9AE0FF",description:"Executives",users:bg(5),roles:[Tg("Admin")],managedBy:vp.FRONTEGG},{id:"id5",name:"Sales",color:"#ED8E7C",users:bg(21),description:"BDR, AE, and inside sales",roles:[Tg("Viewer")],managedBy:vp.FRONTEGG},{id:"id6",name:"Support",color:"#A79D7B",users:bg(23),description:"Dev success and customer success",roles:[Tg("Admin")],managedBy:vp.FRONTEGG},{id:"id7",name:"Marketing",color:"#2CA744",users:bg(10),description:"The marketing department",roles:[Tg("Viewer")],managedBy:vp.FRONTEGG},{id:"id8",name:"HR",color:"#EAE1C2",users:bg(4),description:"Human resources",roles:[Tg("Viewer")],managedBy:vp.FRONTEGG},{id:"id9",name:"Finance",color:"#5587C0",users:bg(3),roles:[Tg("Viewer")],managedBy:vp.FRONTEGG},{id:"id10",name:"Operations",color:"#B1CAE7",users:bg(8),roles:[Tg("Editor")],managedBy:vp.FRONTEGG},{id:"id11",name:"Legal",color:"#2CA744",users:bg(4),roles:[Tg("Viewer")],managedBy:vp.FRONTEGG}],Ig={scoring:{score:79},recommendations:{items:[{code:hp.FORCE_MFA,severity:bp.WARNING,category:Tp.MFA},{code:hp.ENABLE_FORCE_RELOGIN,severity:bp.WARNING,category:Tp.SESSIONS}]}},kg={insights:{items:[{category:Tp.MFA,code:mp.PARTIALLY_FORCED_MFA,metadata:{totalUsers:2,mfa:{enrolledUsersCount:1}}},{category:Tp.SESSIONS,code:mp.PARTIAL_SESSION_SETTINGS,metadata:{totalUsers:2,sessions:{idleTimeoutRecommendation:1800}}},{category:Tp.PASSWORD,code:mp.IMPROVE_PASSWORD_HISTORY_POLICY,metadata:{password:{userLockoutRecommendation:5,historyRecommendations:5}}},{category:Tp.DOMAIN,code:mp.NO_IP_RESTRICTIONS,metadata:{restrictions:{ipsCount:1,domainsCount:1}}}]}},Og={users:pg,totalUsersItems:2,totalUsersPages:1,usersPageOffset:0},Pg={users:[pg[0]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0,queryParams:{_maxInactiveSeconds:7776e3}},Lg={users:[pg[1]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0},wg=[{id:"8d71b676-754c-4600-afe7-ca5add1e6809",key:"fe.secure.*",name:"Secure write",description:"all secure access permissions",categoryId:"77154759-0a04-4669-b6b4-0858d3c1190e",fePermission:!0,assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date},{id:"85e1fd7b-2bb7-498f-8521-5f8e5774c01e",key:"fe.account-hierarchy.write.subAccountAccess",name:"Give access to sub accounts",description:"Give a user access to sub account",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"a1807695-54a2-4f95-95de-a9b246488aae",key:"fe.account-hierarchy.read.subAccount",name:"Read sub accounts",description:"Read sub accounts",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"04dbcc11-61db-40a9-9577-9b73e50d1d03",key:"fe.secure.read.*",name:"Secure read",description:"all secure access read permissions",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"77154759-0a04-4669-b6b4-0858d3c1190e",fePermission:!0},{id:"a1807695-54a2-4f95-95de-a9b246488aae",key:"fe.account-hierarchy.read.subAccount",name:"Read sub accounts",description:"Read sub accounts",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"85e1fd7b-2bb7-498f-8521-5f8e5774c01e",key:"fe.account-hierarchy.write.subAccountAccess",name:"Give access to sub accounts",description:"Give a user access to sub account",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d24db1e3-002b-421d-951d-09a967dd7cd5",fePermission:!0},{id:"a9c803b0-ebfa-49b9-9607-f0d3a390ee61",key:"fe.account-settings.delete.account",name:"Delete Account",description:"Delete my account",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"42aaebe1-893d-4da5-99d7-375a4537b7a4",fePermission:!0},{id:"f26b00f8-ffe0-4739-b15c-7db15c27ea26",key:"fe.account-settings.write.custom-login-box",name:"Edit custom login settings",description:"Write account's custom login box styling",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"42aaebe1-893d-4da5-99d7-375a4537b7a4",fePermission:!0},{id:"a43e059d-d731-44b1-94bb-fb6b16c62210",key:"fe.connectivity.delete.*",name:"Connectivity delete",description:"all connectivity delete permissions",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",fePermission:!0},{id:"f403c6b9-1abe-4ec7-9971-aa032255fc25",key:"fe.connectivity.delete.slackAppRegistration",name:"Delete slack application registration",description:"allow user to delete slack app registration",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"e8c0e727-f562-449a-82c5-f7691defde02",key:"fe.connectivity.read.*",name:"Connectivity read",description:"all connectivity read permissions",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",fePermission:!0},{id:"2a5dcd6d-57a3-45c4-815f-c265609cc1f7",key:"fe.connectivity.read.emailConfig",name:"Read email configuration",description:"read email integration configuration",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"2d7b4be7-8269-4ff4-81d6-0c92e95790d5",fePermission:!0},{id:"4fee0eb0-5b17-450b-bea4-b9b908230bda",key:"fe.connectivity.read.eventCategories",name:"Read events categories",description:"view connectivity events categories",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"31c7a260-55d6-43d5-a872-4f9e22982ff5",fePermission:!0},{id:"750a96a5-8abf-4340-b91a-723c7bb8bcfd",key:"fe.connectivity.read.events",name:"Read events",description:"view connectivity events",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"31c7a260-55d6-43d5-a872-4f9e22982ff5",fePermission:!0},{id:"ef2a5f1a-74c5-431f-b1a6-d4fb5026e374",key:"fe.connectivity.read.slackApp",name:"Read slack application",description:"get slack application configuration in order to register",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"9fc1fa37-a8b9-4931-b2b5-5de55df25289",key:"fe.connectivity.read.slackChannels",name:"Read slack channels",description:"view registered slack workspace channels",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"87c3df9d-0ab2-4e97-bfc8-777a68ba2543",key:"fe.connectivity.read.slackSubscriptions",name:"Read slack subscriptions",description:"view slack events subscriptions",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"7826470b-151f-4bab-b2c0-785e09878616",key:"fe.connectivity.read.slackUsers",name:"Read slack users",description:"view registered slack workspace users",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",fePermission:!0},{id:"ee779734-a7e3-47b3-ace9-944f9bee8ad8",key:"fe.connectivity.read.smsConfig",name:"Read SMS configuration",description:"read SMS integration configuration",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"5743fccc-b4ea-4907-bdca-7446ea088974",fePermission:!0},{id:"54583a96-c731-4a84-9abc-1b8b827f06ae",key:"fe.connectivity.read.userBellNotifications",name:"Read bell notifications",description:"view user bell notifications",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"18d2584b-7f03-4038-ab93-bc2b0f4511be",fePermission:!0},{id:"2dfde8ef-7df2-4426-bb8d-33615e399a4d",key:"fe.connectivity.read.webhookLogs",name:"Read webhooks logs",description:"view webhooks logs",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"e74e5390-396b-429c-9544-62417912d018",fePermission:!0},{id:"16647407-ed6f-4ca6-83a0-86225d921959",key:"fe.connectivity.read.webhooks",name:"Read webhooks",description:"view webhooks configuration",assignmentType:lp.ASSIGNABLE,createdAt:new Date,updatedAt:new Date,categoryId:"e74e5390-396b-429c-9544-62417912d018",fePermission:!0}],Dg=[{id:"d9b4dbd0-476c-4708-b079-d9e6e4758971",name:"test",description:"",createdAt:new Date,updatedAt:new Date,permissionIds:[],feCategory:!1},{id:"2b3f1746-1135-4b8d-aff3-5697cffc4482",name:"SAML",description:"Secure access SAML",createdAt:new Date,updatedAt:new Date,permissionIds:["8ea45a49-c403-4551-9da9-77f5da44f130","8d94c261-1f7d-46bd-88a8-511e9f39273b","7391ac41-b076-4386-8a14-7c2d798d3335","6d8f5a1f-b3cd-421a-ba85-7784bdd97dc2","3c989065-35e1-4198-8c9c-c94084222794"],feCategory:!0},{id:"2c2281da-cf81-4943-9605-42969677e9fe",name:"Security Policies",description:"Secure access security policies",createdAt:new Date,updatedAt:new Date,permissionIds:["e5642338-b265-4ce5-94e4-8c21490033ad","daddb9e9-a836-4901-b175-2d1182dab6f5","bd4242ce-e84f-4387-9c41-c90e7d1fc6fa","ba33b4c1-47f0-4aa2-9e3a-fcf96229d355","ade4558f-5438-4383-b42b-728e8a745cc8","ad064258-2178-48f8-845c-ac1ce0217be8","acefb7fd-11c7-4a43-9544-b4fb461db94c","909b6a0a-4efc-4464-90ac-b8b9a8f22fc2","8a03c1e7-3991-4cca-8726-88c339766144","860eb891-b9eb-44ba-94c1-51cfc2be9dd9","719e09ae-5513-4cc3-bce1-97503a0a7658","6fcd99e7-2206-4c45-86aa-411a87b7fcac","235592cc-47c7-49cc-82e4-129f5333cc45","2214404d-3140-44bf-9c9d-438fa56b5a50"],feCategory:!0},{id:"2d7b4be7-8269-4ff4-81d6-0c92e95790d5",name:"Email integration",description:"Connectivity email integration",createdAt:new Date,updatedAt:new Date,permissionIds:["9a0bb3db-8bdb-4278-8f18-9c484bcd2f8c","440f5616-ad85-43d1-b25d-1fd7930c6d26","2a5dcd6d-57a3-45c4-815f-c265609cc1f7"],feCategory:!0},{id:"31c7a260-55d6-43d5-a872-4f9e22982ff5",name:"Events",description:"Connectivity Events",createdAt:new Date,updatedAt:new Date,permissionIds:["85c90d0f-3bb0-40c0-914a-640c7ca9eea5","750a96a5-8abf-4340-b91a-723c7bb8bcfd","4fee0eb0-5b17-450b-bea4-b9b908230bda"],feCategory:!0},{id:"42aaebe1-893d-4da5-99d7-375a4537b7a4",name:"Account settings",description:"Account profile settings",createdAt:new Date,updatedAt:new Date,permissionIds:["f26b00f8-ffe0-4739-b15c-7db15c27ea26","eb11313d-c7bb-43c0-a85d-c79bedab46b1","a9c803b0-ebfa-49b9-9607-f0d3a390ee61","634d3fab-b470-4a92-a25b-245459ddd6db"],feCategory:!0},{id:"62fc3fe0-f06b-4a0f-854c-cdf51353b616",name:"Slack integration",description:"Connectivity Slack integration",createdAt:new Date,updatedAt:new Date,permissionIds:["f403c6b9-1abe-4ec7-9971-aa032255fc25","ef2a5f1a-74c5-431f-b1a6-d4fb5026e374","e3231a61-e425-4ac1-aa87-654ab995af5c","9fc1fa37-a8b9-4931-b2b5-5de55df25289","87c3df9d-0ab2-4e97-bfc8-777a68ba2543","7993a558-0af5-4d77-b9fc-8e8114f0ce0b","7826470b-151f-4bab-b2c0-785e09878616","5b0323d1-a0a0-4d4f-9bb8-b1634d9afa94","4245736e-13b0-48fd-9a08-bc93809dcdaf","2fccccb1-36f5-4c5c-8d93-73ab15d0b2d9"],feCategory:!0},{id:"6b925df5-8b09-470a-9fcc-dae0beae1af4",name:"Audits",description:"Audit Logs",createdAt:new Date,updatedAt:new Date,permissionIds:["97085bb5-bec7-49eb-9744-4d35bbb83ad3"],feCategory:!0},{id:"77154759-0a04-4669-b6b4-0858d3c1190e",name:"Secure access",description:"Secure access general",createdAt:new Date,updatedAt:new Date,permissionIds:["925e0c16-aead-41e6-b62f-8ddb2ea4ed06","8d71b676-754c-4600-afe7-ca5add1e6809","1c81d4ca-47a2-4564-b9d9-9d346b8cdbe7","04dbcc11-61db-40a9-9577-9b73e50d1d03"],feCategory:!0},{id:"916d6db5-489e-4109-95cf-57dee7802c57",name:"Webpush integration",description:"Webpush notifications integration",createdAt:new Date,updatedAt:new Date,permissionIds:["e5a7bbd3-f76b-4559-979d-885c5c75f72f","cb47ea6f-0a59-4694-97d0-9c32f6732e85"],feCategory:!0},{id:"9707ef7f-afd3-4d1f-962e-68c0d876db53",name:"Subscriptions",description:"Subscriptions access general",createdAt:new Date,updatedAt:new Date,permissionIds:["ce03de78-a7f4-4498-acce-df4aae30ed0d","ae81dd56-2f94-4da8-9c16-b6c781b0dcb7","72e55675-ea98-4f1a-85f0-09319cdcbcbf"],feCategory:!0},{id:"a71e2e14-0cdb-42df-b297-d00af2d4e62e",name:"Users management",description:"Secure access users management",createdAt:new Date,updatedAt:new Date,permissionIds:["e7263c99-874f-4e17-8d63-25ae3d9f5739","db957d5f-4048-4011-bcb4-5d21af0560e4","c52b0a96-dcff-4fba-aa8e-ce3a7336bde2","bc754ce1-ebbe-446a-bb84-4f287be0651c","998756c3-773a-4771-b7a5-510e795fb5f4","88565631-dc77-472c-b1d9-18674483c24b","6b84ddeb-a242-48c5-bf2a-62105315518a","61874f64-2204-4eec-8f02-0d38bd5a66b8","4c47caae-d384-48bb-99bc-554aafa2888f","43695880-d40e-412d-b342-434d58c5c8ca","4003ac5b-326c-4dc2-afb1-8900e16ee443","007c612d-5184-4f04-846e-d49c6591de0c"],feCategory:!0},{id:"c058e114-917c-4ad1-940e-11e9cc40b638",name:"Roles and permissions",description:"Secure access roles and permissions",createdAt:new Date,updatedAt:new Date,permissionIds:["c89960c8-6d67-44fa-a3aa-1a6826f45b0d","93be3a9a-98a2-48b8-a146-a223e457c904","80e49f9a-7628-4efc-913b-5f80ca92f106","7f2576d6-cbbb-4c7b-bb70-d75a88d9ce47","6a337814-34e5-4c24-a56f-d462c1db218b"],feCategory:!0},{id:"c38e9f59-ff65-4f9f-a31d-0bbfc44df347",name:"Groups",description:"Secure access groups",createdAt:new Date,updatedAt:new Date,permissionIds:["e1907e68-877d-4f2d-a266-d54e143c3c0c","7a17405a-6c4b-4053-9843-f9d5e3af9e00","5ee7bb2d-aad4-497f-94d2-9e255c470882","4c406972-c815-46a9-8f47-9708adc334b8","399bff45-aa24-49ae-9357-5f05a5eef3a5","0037b3ad-5f77-4157-aa33-33c92b5fe057"],feCategory:!0},{id:"d18fccaa-e09a-4e6e-b902-cc9c615ff12d",name:"Connectivity",description:"Connectivity general",createdAt:new Date,updatedAt:new Date,permissionIds:["e8c0e727-f562-449a-82c5-f7691defde02","c88bf74a-66a4-48c2-bc1b-2e2aa057858d","a43e059d-d731-44b1-94bb-fb6b16c62210","3f118e4c-badd-45d1-8056-3f3428be92ca"],feCategory:!0},{id:"d24db1e3-002b-421d-951d-09a967dd7cd5",name:"Account Hierarchy",description:"Account hierarchy",createdAt:new Date,updatedAt:new Date,permissionIds:["b6e66e0f-c6d2-4113-865a-57d08b1dec45","a1807695-54a2-4f95-95de-a9b246488aae","85e1fd7b-2bb7-498f-8521-5f8e5774c01e","60cfedb4-64ca-40d1-8b3a-4288bcde1209"],feCategory:!0},{id:"e74e5390-396b-429c-9544-62417912d018",name:"Webhooks integration",description:"Connectivity webhooks integration",createdAt:new Date,updatedAt:new Date,permissionIds:["996e42ed-b1d8-4e36-aa76-58091c56bdf7","8e7014d4-13fa-439a-a313-a2b9141f8b47","2dfde8ef-7df2-4426-bb8d-33615e399a4d","16647407-ed6f-4ca6-83a0-86225d921959"],feCategory:!0},{id:"e8af2833-1bbf-4ccf-8658-f6e0c60621b9",name:"API tokens",description:"Secure access API tokens",createdAt:new Date,updatedAt:new Date,permissionIds:["f03dc571-0769-4bcf-9c51-776b81582a14","c395932b-c732-41ad-bec6-ced7602bf79e","94351961-e9c8-4c63-8818-ae8481ceab22","5a744287-d01e-4a7a-8a37-2ce212ce5ff5","0cf97f9f-84dc-4dfc-bf41-2ad4b6c072e9","0c8cdac0-b364-4ab6-9737-7aa43f944013"],feCategory:!0}];let Ug,Cg,Rg;!function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORDLESS="PASSWORDLESS",e.ACTIVATION_LINK="ACTIVATION_LINK"}(Ug||(Ug={})),function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORD="PASSWORD"}(Cg||(Cg={})),function(e){e.profile="profile",e.privacy="privacy",e.personalApiTokens="personalApiTokens",e.account="account",e.users="users",e.groups="groups",e.security="security",e.sso="sso",e.audits="audits",e.webhooks="webhooks",e.apiTokens="apiTokens",e.roles="roles",e.subscriptions="subscription",e.allAccounts="allAccounts"}(Rg||(Rg={})),Rg.profile,Rg.privacy,Rg.personalApiTokens,Rg.account,Rg.users,Rg.groups,Rg.security,Rg.sso,Rg.audits,Rg.webhooks,Rg.apiTokens,Rg.roles,Rg.subscriptions,Rg.allAccounts;const _g=e=>{try{return new URL(e),!0}catch(e){return!1}},Ng=e=>{const{searchParams:t}=new URL(e),n=t.toString();if(n)return`?${n}`},Mg=e=>{const t=new URLSearchParams(window.location.search).get(e);return null!=t?t:void 0},Fg="tenantId",Gg=e=>e.mfaRequired&&e.mfaToken?(zo.setAccessToken(null),zo.setUser(null),!0):(zo.setAccessToken(e.accessToken),zo.setUser(e),!1),xg=e=>{const{numberOfPhoneDevices:t,numberOfAuthenticators:n,numberOfEmails:a,totalDevices:i}=(e=>{const t=+Boolean(e.webauthn.length),n=+Boolean(e.phones.length),a=+Boolean(e.authenticators.length),i=+Boolean(e.emails.length);return{numberOfWebAuthnDevices:t,numberOfPhoneDevices:n,numberOfAuthenticators:a,numberOfEmails:i,totalDevices:t+n+a+i}})(e);if(1===i){if(n)return un.authenticatorApp;if(t)return un.smsVerifyCode;if(a)return un.emailVerifyCode}return un.verify},Vg=e=>{if(1===e.length){const[t]=e;if(t===Ys.AuthenticatorApp)return un.authenticatorApp;if(t===Ys.SMS)return un.smsSetPhoneNumber;if(t===Ys.EmailCode)return un.emailVerifyCode}return un.verify};function*jg(e){let t=wt.loginWithTwoFactor,n={};const{loginState:a}=yield qi((e=>e.auth)),{isAllowedToRemember:i,mfaDeviceExpiration:o}=yield $i(Ip.auth.checkIfAllowToRememberMfaDevice,e.mfaToken);!e.hasOwnProperty("mfaEnrolled")||e.mfaEnrolled?n={mfaDevices:e.mfaDevices,step:xg(e.mfaDevices)}:(n={step:Vg(e.mfaStrategies),qrCode:e.qrCode,recoveryCode:e.recoveryCode,loading:!1,mfaToken:e.mfaToken,mfaStrategies:e.mfaStrategies},t=wt.forceTwoFactor);let r={};const s=localStorage.getItem("register-quick-login");return s&&(r={quickLoginToRegister:s,flow:Dt.RegisterQuickLogin}),{user:void 0,isAuthenticated:!1,mfaState:n,loginState:x({},a,r,{mfaToken:e.mfaToken,mfaRequired:e.mfaRequired,loading:!1,error:void 0,step:t,tenantsLoading:!0,email:e.userEmail,tenants:[],allowRememberMfaDevice:i,mfaDeviceExpiration:o,isBreachedPassword:e.isBreachedPassword})}}const Bg=(e,t)=>e?(e=>Boolean(null==e?void 0:e.statusCode))(e)?e.message:((e=>e instanceof Error||(null==e?void 0:e.message)&&(null==e?void 0:e.stack)&&"Error"===(null==e?void 0:e.name))(e)?console.error(e.message):"string"==typeof e&&console.error(e),null!=t?t:"We're facing some difficulties, Please try again"):t;let Wg;function zg(e,t){var n,a;null==(n=(a=window).onFronteggEvent)||n.call(a,e,t)}!function(e){e.SIGNUP_COMPLETED="signup_completed",e.USER_VERIFIED="user_verified"}(Wg||(Wg={}));const $g=(e,t=[])=>Object.entries(e).reduce(((e,[n,a])=>"object"==typeof a?[...e,...$g(a,[...t,n])]:[...e,{type:[...t,n].join("/"),payload:a}]),[]),Kg=["callback"];function*Hg(){yield Bi($a.setCustomLoginState({loading:!0}));try{const e=yield $i(Ip.metadata.getAdminBoxMetadata);yield Bi($a.setCustomLoginState({tenantMetadata:e,loading:!1}))}catch(e){yield Bi($a.setCustomLoginState({loading:!1,error:Bg(e)}))}}function*qg(e){let{payload:{callback:t}}=e,n=ii(e.payload,Kg);try{yield Bi($a.setCustomLoginState({error:null,saving:!0}));const e=$g(n);if(0===e.length)throw new Error("No changes to update");yield $i(Ip.metadata.updateAdminBoxMetadata,{actions:e});const a=yield $i(Ip.metadata.getAdminBoxMetadata);yield Bi($a.setCustomLoginState({tenantMetadata:a,saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setCustomLoginState({error:Bg(e,"No changes to update"),saving:!1})),null==t||t(null,e)}}function*Jg(){return!!(yield $i(Yg))}function*Yg(){const e=zo.getContext();if(null==e||!e.tenantResolver)return;const t=yield e.tenantResolver();if(null!=t&&t.tenant)return t.tenant;const{customLoginAlias:n,hasCustomLogin:a}=yield qi((e=>{var t,n;const a=null==(t=e.auth)||null==(n=t.tenantsState)?void 0:n.activeTenant;return{customLoginAlias:null==a?void 0:a.alias,hasCustomLogin:null==a?void 0:a.hasCustomLogin}}));return a?n:void 0}function*Xg(){try{var e;if(!(yield $i(Jg)))return;const t=yield qi((e=>e.auth.isAuthenticated)),{getSettings:n,getPublicSettings:a}=Ip.accountSettings,{applicationUrl:i}=yield $i(t?n:a);if(!i)return;const{routes:o}=yield qi((e=>e.auth)),r=null!=(e=Ng(i))?e:"";yield Bi($a.setState({routes:x({},o,{customLoginAuthenticatedUrl:i,customLoginUrl:o.loginUrl+r})})),yield Bi($a.setCustomLoginState({customLoginSearchParams:null!=r?r:void 0}))}catch{}}function*Qg(){yield Wo($a.loadTenantMetadata,Hg),yield Wo($a.updateTenantMetadata,qg)}let Zg;!function(e){e.RECOMMENDATIONS="recommendations",e.INSIGHTS="insights",e.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS="sendBulkResetBreachedPasswordEmails",e.SEND_BREACHED_PASSWORD_EMAIL="sendBreachedPasswordEmail",e.BREACHED_PASSWORD_USERS_TABLE="breachedPasswordUsersTable",e.UNENROLLED_MFA_USERS_TABLE="unenrolledMfaUsersTable",e.INACTIVE_USERS_TABLE="inactiveUsersTable"}(Zg||(Zg={}));const eS=["callback"];function tS(e){return function*(t){const[n]=yield $i($p,["security-center-admin-portal-major-version"]);yield e(t),n&&(yield nS(),yield aS())}}function*nS(){const e=Zg.RECOMMENDATIONS;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0}));try{var t;const{recommendations:n,scoring:a}=yield $i(Ip.securityCenter.getRecommendations);yield Bi($a.setSecurityCenterState({recommendations:n.items,score:null!=(t=null==a?void 0:a.score)?t:0}))}catch(t){yield Bi($a.setSecurityCenterStateError({key:e,value:Bg(t)}))}finally{yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}}function*aS(){const e=Zg.INSIGHTS;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0}));try{const{insights:t}=yield $i(Ip.securityCenter.getInsights);yield Bi($a.setSecurityCenterState({insights:t.items}))}catch(t){yield Bi($a.setSecurityCenterStateError({key:e,value:Bg(t)}))}finally{yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}}function*iS(e){let{payload:{callback:t}}=e,n=ii(e.payload,eS);const a=Zg.SEND_BREACHED_PASSWORD_EMAIL;yield Bi($a.setSecurityCenterStateError({key:a,value:!1})),yield Bi($a.setSecurityCenterStateLoader({key:a,value:!0}));try{yield $i(Ip.auth.forgotPassword,n),null==t||t(!0)}catch(e){yield Bi($a.setSecurityCenterStateError({key:a,value:Bg(e)})),null==t||t(!1,e)}finally{yield Bi($a.setSecurityCenterStateLoader({key:a,value:!1}))}}function*oS({payload:{callback:e}}){const t=Zg.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS;yield Bi($a.setSecurityCenterStateError({key:t,value:!1})),yield Bi($a.setSecurityCenterStateLoader({key:t,value:!0}));try{yield $i(Ip.users.sendResetBreachedPasswordEmails),null==e||e(!0)}catch(n){yield Bi($a.setSecurityCenterStateError({key:t,value:Bg(n)})),null==e||e(!1)}finally{yield Bi($a.setSecurityCenterStateLoader({key:t,value:!1}))}}function*rS({key:e,tableState:t,updateStateKey:n,_offset:a,_limit:i,_preset:o,_email:r,_maxInactiveSeconds:s}){var l,c,d,u;yield Bi($a.setSecurityCenterStateError({key:e,value:!1})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0}));const y=null!=(l=null!=a?a:null==t||null==(c=t.queryParams)?void 0:c._offset)?l:0,f=null!=(d=null!=i?i:null==t||null==(u=t.queryParams)?void 0:u._limit)?d:10,p=x({_offset:y,_limit:f,_includeSubTenants:!1,_preset:o,_maxInactiveSeconds:s},!!r&&{_email:r});try{const{items:t,_metadata:{totalItems:a,totalPages:i}}=yield $i(Ip.users.getUsersV3,p),o={totalUsersItems:a,totalUsersPages:i,usersPageOffset:y,queryParams:x({_offset:y,_limit:f,_maxInactiveSeconds:s},!!r&&{_email:r})};if(t.length){const e=yield function*(e){const t=e.map((e=>e.id)),n=yield $i(Ip.roles.getRoles),a=yield $i(Ip.users.getUsersRoles,{ids:t});return e.map((e=>{var t,i;const o=null==a||null==(t=a.find((t=>t.userId===e.id)))?void 0:t.roleIds;return x({},e,{roles:null!=(i=null==o?void 0:o.map((e=>{var t;return null!=(t=null==n?void 0:n.find((t=>t.id===e)))?t:[]})))?i:[]})}))}(t);yield Bi($a.setSecurityCenterState({[n]:x({users:e},o)}))}else yield Bi($a.setSecurityCenterState({[n]:x({users:[]},o)}))}catch(t){yield Bi($a.setSecurityCenterStateError({key:e,value:Bg(t)}))}finally{yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}}function*sS({payload:e}){var t;const n=Zg.BREACHED_PASSWORD_USERS_TABLE,a=yield null!=(t=qi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.breachedPasswordUsersTable})))?t:{};yield rS(x({key:n,updateStateKey:"breachedPasswordUsersTable",_preset:ga.BREACHED_PASSWORDS,tableState:a},e))}function*lS({payload:e}){var t;const n=Zg.UNENROLLED_MFA_USERS_TABLE,a=yield null!=(t=qi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.unenrolledMfaUsersTable})))?t:{};yield rS(x({key:n,updateStateKey:"unenrolledMfaUsersTable",_preset:ga.MFA_UNENROLLED,tableState:a},e))}function*cS({payload:e}){var t;const n=Zg.INACTIVE_USERS_TABLE,a=yield null!=(t=qi((e=>{var t;return null==(t=e.auth.securityCenterState)?void 0:t.inactiveUsersTable})))?t:{};yield rS(x({key:n,updateStateKey:"inactiveUsersTable",_preset:ga.INACTIVE,tableState:a},e))}function*dS(){yield jo($a.loadRecommendations,nS),yield jo($a.loadInsights,aS),yield jo($a.sendResetBreachedPasswordEmail,iS),yield jo($a.sendBulkResetBreachedPasswordEmails,oS),yield jo($a.loadBreachedPasswordUsers,sS),yield jo($a.loadUnenrolledMfaUsers,lS),yield jo($a.loadInactiveUsers,cS)}function*uS(){const e=Zg.RECOMMENDATIONS;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0})),yield Ji(500),yield Bi($a.setSecurityCenterState({recommendations:Ig.recommendations.items,score:Ig.scoring.score})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}function*yS(){const e=Zg.INSIGHTS;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0})),yield Ji(500),yield Bi($a.setSecurityCenterState({insights:kg.insights.items})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}function*fS(){const e=Zg.BREACHED_PASSWORD_USERS_TABLE;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0})),yield Ji(500),yield Bi($a.setSecurityCenterState({breachedPasswordUsersTable:Og})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}function*pS(){const e=Zg.UNENROLLED_MFA_USERS_TABLE;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0})),yield Ji(500),yield Bi($a.setSecurityCenterState({unenrolledMfaUsersTable:Lg})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}function*gS(){const e=Zg.INACTIVE_USERS_TABLE;yield Bi($a.setSecurityCenterStateLoader({key:e,value:!0})),yield Ji(500),yield Bi($a.setSecurityCenterState({inactiveUsersTable:Pg})),yield Bi($a.setSecurityCenterStateLoader({key:e,value:!1}))}function*SS({payload:{callback:e}}){const t=Zg.SEND_BREACHED_PASSWORD_EMAIL;yield Bi($a.setSecurityCenterStateLoader({key:t,value:!0})),yield Ji(500),null==e||e(!0),yield Bi($a.setSecurityCenterStateLoader({key:t,value:!1}))}function*vS(){yield jo($a.loadRecommendations,uS),yield jo($a.loadInsights,yS),yield jo($a.loadBreachedPasswordUsers,fS),yield jo($a.loadUnenrolledMfaUsers,pS),yield jo($a.loadInactiveUsers,gS),yield jo($a.sendResetBreachedPasswordEmail,SS)}const hS=["callback"],mS=["callback"],AS=["callback"],bS=["callback"],TS=["callback"],ES=["callback"];function*IS(){yield Bi($a.setSecurityPolicyGlobalState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getGlobalSecurityPolicy);yield Bi($a.setSecurityPolicyGlobalState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyGlobalState({error:Bg(e),loading:!1}))}yield Bi($a.loadSecurityPolicyMfa()),yield Bi($a.loadSecurityPolicyVendorMfa()),yield Bi($a.loadSecurityPolicyLockout()),yield Bi($a.loadSecurityPolicyVendorLockout()),yield Bi($a.loadSecurityPolicyVendorPasswordHistory()),yield Bi($a.loadSecurityPolicyCaptcha()),yield Bi($a.loadPublicAuthStrategiesPolicy())}function*kS(e){var t,n;if(!(yield $i(Jg)))return e;const a=yield $i(PS);return null!=a&&null!=(t=a.mainAuthStrategies)&&null!=(n=t[0])&&n.strategy?x({},e,{authStrategy:a.mainAuthStrategies[0].strategy}):e}function*OS(){yield Bi($a.setSecurityPolicyPublicState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getVendorConfig),t=yield kS(e);yield Bi($a.setSecurityPolicyPublicState({policy:t,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyPublicState({error:Bg(e),loading:!1}))}}function*PS(){const e=yield qi((({auth:e})=>e.isAuthenticated));let t;return t=e?yield $i(Ip.auth.getPublicAuthStrategiesConfigForAuthenticatedUser):yield $i(Ip.auth.getVendorPublicAuthStrategiesConfig),t}function*LS(){yield Bi($a.setSecurityPolicyAuthStrategyPublicState({loading:!0,error:null}));try{var e,t;const n=yield $i(PS);yield function*(e){const t=yield $i(Jg);if(!e||!t)return;const{policy:n}=yield qi((({auth:e})=>{var t;return null==(t=e.securityPolicyState)?void 0:t.publicPolicy}));yield Bi($a.setSecurityPolicyPublicState({policy:x({},n,{authStrategy:e}),loading:!1}))}(null==n||null==(e=n.mainAuthStrategies)||null==(t=e[0])?void 0:t.strategy),yield Bi($a.setSecurityPolicyAuthStrategyPublicState({policy:n,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyAuthStrategyPublicState({error:Bg(e),loading:!1}))}}function*wS(){yield Bi($a.setSecurityPolicyMfaState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getMfaPolicy);yield Bi($a.setSecurityPolicyMfaState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyMfaState({error:Bg(e),loading:!1}))}}function*DS(){yield Bi($a.setSecurityPolicyMfaState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getVendorMfaPolicy);yield Bi($a.setSecurityPolicyVendorMfaState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyVendorMfaState({error:Bg(e),loading:!1}))}}function*US(e){let{payload:{callback:t}}=e,n=ii(e.payload,hS);yield Bi($a.setSecurityPolicyMfaState({saving:!0,error:null}));try{const e=yield $i(Ip.auth.saveMfaPolicy,n);yield Bi($a.setSecurityPolicyMfaState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Bi($a.setSecurityPolicyMfaState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*CS(){yield Bi($a.setSecurityPolicyLockoutState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getLockoutPolicy);yield Bi($a.setSecurityPolicyLockoutState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyLockoutState({error:Bg(e),loading:!1}))}}function*RS(e){let{payload:{callback:t}}=e,n=ii(e.payload,mS);yield Bi($a.setSecurityPolicyLockoutState({saving:!0,error:null}));try{const e=yield $i(Ip.auth.saveLockoutPolicy,n);yield Bi($a.setSecurityPolicyLockoutState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Bi($a.setSecurityPolicyLockoutState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*_S(){yield Bi($a.setSecurityPolicyVendorLockoutState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getVendorLockoutPolicy);yield Bi($a.setSecurityPolicyVendorLockoutState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyVendorLockoutState({error:Bg(e),loading:!1}))}}function*NS(){yield Bi($a.setSecurityPolicyLockoutState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getCaptchaPolicy);yield Bi($a.setSecurityPolicyCaptchaState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyCaptchaState({error:Bg(e),loading:!1}))}}function*MS(){yield Bi($a.setSecurityPolicyPasswordHistoryState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getPasswordHistoryPolicy);yield Bi($a.setSecurityPolicyPasswordHistoryState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyPasswordHistoryState({error:Bg(e),loading:!1}))}}function*FS(){yield Bi($a.setSecurityPolicyVendorPasswordHistoryState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getVendorPasswordHistoryPolicy);yield Bi($a.setSecurityPolicyVendorPasswordHistoryState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyVendorPasswordHistoryState({error:Bg(e),loading:!1}))}}function*GS(e){let{payload:{callback:t}}=e,n=ii(e.payload,AS);yield Bi($a.setSecurityPolicyPasswordHistoryState({saving:!0,error:null}));try{const e=yield $i(Ip.auth.savePasswordHistoryPolicy,n);yield Bi($a.setSecurityPolicyPasswordHistoryState({policy:e,saving:!1})),null==t||t(e)}catch(e){yield Bi($a.setSecurityPolicyPasswordHistoryState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*xS(){yield Bi($a.setSecurityPolicyPasswordState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getPasswordConfigPolicy);yield Bi($a.setSecurityPolicyPasswordState({policy:e,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyPasswordState({error:Bg(e),loading:!1}))}}function*VS(){yield Wo($a.loadSecurityPolicy,IS),yield jo($a.saveSecurityPolicyMfa,tS(US)),yield jo($a.loadSecurityPolicyMfa,wS),yield jo($a.loadSecurityPolicyVendorMfa,DS),yield jo($a.saveSecurityPolicyLockout,tS(RS)),yield jo($a.loadSecurityPolicyLockout,CS),yield jo($a.loadSecurityPolicyVendorLockout,_S),yield jo($a.loadSecurityPolicyCaptcha,NS),yield jo($a.saveSecurityPolicyPasswordHistory,tS(GS)),yield jo($a.loadSecurityPolicyPasswordHistory,MS),yield jo($a.loadSecurityPolicyVendorPasswordHistory,FS),yield jo($a.loadVendorPasswordConfig,xS),yield jo($a.loadPublicSecurityPolicy,OS),yield jo($a.loadPublicAuthStrategiesPolicy,LS)}function*jS(){yield Bi($a.setSecurityPolicyPublicState({loading:!0,error:null}));try{yield Bi($a.setSecurityPolicyPublicState({policy:Zp,loading:!1}))}catch(e){yield Bi($a.setSecurityPolicyPublicState({error:Bg(e),loading:!1}))}}function*BS(){yield Bi($a.setSecurityPolicyGlobalState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyGlobalState({policy:Qp,loading:!1})),yield Bi($a.loadSecurityPolicyMfa()),yield Bi($a.loadSecurityPolicyVendorMfa()),yield Bi($a.loadSecurityPolicyLockout()),yield Bi($a.loadSecurityPolicyVendorLockout()),yield Bi($a.loadSecurityPolicyPasswordHistory()),yield Bi($a.loadSecurityPolicyVendorPasswordHistory()),yield Bi($a.loadSecurityPolicyCaptcha())}function*WS(){yield Bi($a.setSecurityPolicyMfaState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyMfaState({policy:eg,loading:!1}))}function*zS(){yield Bi($a.setSecurityPolicyVendorMfaState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyVendorMfaState({policy:eg,loading:!1}))}function*$S(e){var t;let{payload:{callback:n}}=e,a=ii(e.payload,bS);yield Bi($a.setSecurityPolicyMfaState({saving:!0,error:null}));const i=x({},tg,{id:null!=(t=a.id)?t:tg.id,enforceMFAType:a.enforceMFAType});yield It(),yield Bi($a.setSecurityPolicyMfaState({policy:i,saving:!1})),null==n||n(i)}function*KS(){yield Bi($a.setSecurityPolicyLockoutState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyLockoutState({policy:tg,loading:!1}))}function*HS(){yield Bi($a.setSecurityPolicyVendorLockoutState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyVendorLockoutState({policy:tg,loading:!1}))}function*qS(e){let{payload:{callback:t}}=e,n=ii(e.payload,TS);yield Bi($a.setSecurityPolicyLockoutState({saving:!0,error:null})),yield It();const a=x({},tg,n,{id:n.id?n.id:tg.id});null==t||t(a),yield Bi($a.setSecurityPolicyLockoutState({policy:a,saving:!1}))}function*JS(){yield Bi($a.setSecurityPolicyLockoutState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyLockoutState({policy:tg,loading:!1}))}function*YS(){yield Bi($a.setSecurityPolicyPasswordHistoryState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyPasswordHistoryState({policy:ng,loading:!1}))}function*XS(){yield Bi($a.setSecurityPolicyVendorPasswordHistoryState({loading:!0,error:null})),yield It(),yield Bi($a.setSecurityPolicyVendorPasswordHistoryState({policy:ng,loading:!1}))}function*QS(e){let{payload:{callback:t}}=e,n=ii(e.payload,ES);yield Bi($a.setSecurityPolicyPasswordHistoryState({saving:!0,error:null})),yield It();const a=x({},ng,n,{id:n.id?n.id:ng.id});null==t||t(a),yield Bi($a.setSecurityPolicyPasswordHistoryState({policy:a,saving:!1}))}function*ZS(){yield Wo($a.loadSecurityPolicy,BS),yield jo($a.loadPublicSecurityPolicy,jS),yield jo($a.saveSecurityPolicyMfa,$S),yield jo($a.loadSecurityPolicyMfa,WS),yield jo($a.loadSecurityPolicyVendorMfa,zS),yield jo($a.saveSecurityPolicyLockout,qS),yield jo($a.loadSecurityPolicyLockout,KS),yield jo($a.loadSecurityPolicyVendorLockout,HS),yield jo($a.loadSecurityPolicyCaptcha,JS),yield jo($a.saveSecurityPolicyPasswordHistory,QS),yield jo($a.loadSecurityPolicyPasswordHistory,YS),yield jo($a.loadSecurityPolicyVendorPasswordHistory,XS)}const ev=["phoneNumber"],tv=["events","url"];function*nv(){yield Bi($a.setSignUpState({loading:!0}));try{const e=yield $i(Ip.auth.getVendorConfig),t=yield kS(e),{allowSignups:n,allowNotVerifiedUsersLogin:a}=e;yield Bi($a.setSignUpState({loading:!1,allowSignUps:n,allowNotVerifiedUsersLogin:a,firstLoad:!1})),yield Bi($a.setSecurityPolicyPublicState({policy:t,loading:!1}))}catch(e){yield Bi($a.setSignUpState({loading:!1,error:Bg(e),firstLoad:!1}))}}function*av(e){let{payload:{events:t,url:n}}=e,a=ii(e.payload,tv);yield Bi($a.setSignUpState({loading:!0}));try{const{routes:e,onRedirectTo:r}=yield qi((e=>e.auth)),{shouldActivate:s,user:l,tenantId:c,userId:d,tenants:u=[],activeTenant:y}=yield $i(Ip.auth.signUpUser,(o=a,ii(o,ev)));if(!a.invitationToken){var i;const{email:e,name:o,companyName:r,phoneNumber:s}=a,l={email:e,name:o,companyName:r,url:n,phoneNumber:s||void 0,authenticationType:Cg.PASSWORD,id:d,tenantId:c,createdAt:new Date};null==t||null==(i=t.signUpComplete)||i.call(t,l),zg(Wg.SIGNUP_COMPLETED,l)}if(!s&&l&&Gg(l)){const t=yield jg(l);yield Bi($a.setState(t)),r(e.loginUrl)}else{const{tenantsState:e}=yield qi((e=>e.auth));yield Bi($a.setSignUpState({loading:!1,shouldActivate:s,stage:bn.SignUpSuccess})),yield Bi($a.setState({user:l,isAuthenticated:!(null==l||!l.accessToken),tenantsState:x({},e,{tenants:u,activeTenant:y})}))}}catch(e){zo.setAccessToken(null),zo.setUser(null),yield Bi($a.setSignUpState({loading:!1,error:Bg(e)}))}var o;yield Bi($a.setSignUpState({loading:!1}))}function*iv(){const{allowSignUps:e,allowNotVerifiedUsersLogin:t}=yield qi((e=>e.auth.signUpState));yield Bi($a.resetSignUpState()),yield Bi($a.setSignUpState({allowSignUps:e,allowNotVerifiedUsersLogin:t}))}function*ov(){yield Wo($a.signUpUser,av),yield Wo($a.resetSignUpStateSoft,iv)}const rv={setVendorState:(e,{payload:t})=>x({},e,t)},sv={loadVendorPublicInfo:ft("vendor/loadVendorPublicInfo")},lv={loading:!1},{reducer:cv,actions:dv}=gt({name:Gt,initialState:lv,reducers:x({},rv)}),uv=x({},dv,sv);function*yv(){yield Bi(uv.setVendorState({loading:!0}));try{const{whiteLabelMode:e=!1}=yield Ip.vendor.getVendorPublicInfo();yield Bi(uv.setVendorState({whiteLabelMode:e,loading:!1}))}catch(e){yield Bi(uv.setVendorState({loading:!1})),console.error("failed to getVendorPublicInfo - ",e)}}var fv=n(9378),pv=n.n(fv);function gv(e,t){return pv()(e,t)}function*Sv({payload:e}){const t=null==e?void 0:e.callback,[n]=yield $i($p,[Hr]);try{const e=yield $i(n?Ip.entitlements.loadEntitlementsV2:Ip.entitlements.loadEntitlements);yield function*(e){gv(yield qi((e=>{var t;return null==(t=e.auth.user)?void 0:t.entitlements})),e)||(yield Bi($a.setEntitlements(e)))}(e),null==t||t(!0)}catch(e){null==t||t(!1)}}function*vv(){yield Wo($a.loadEntitlements,Sv)}const hv=new class{constructor(){this.loginWithSSO=e=>{if(this.isWebkitAvailable()){var t,n,a;null==(t=window.webkit)||null==(n=t.messageHandlers)||null==(a=n.FronteggNativeBridge)||a.postMessage(JSON.stringify({action:"loginWithSSO",payload:e}))}else{if(!this.isJsInterfaceAvailable())throw new Error("FronteggNativeBridge is not available");var i;null==(i=window.FronteggNativeBridge)||i.loginWithSSO(e)}},this.loginWithSocialLogin=e=>{if(this.isWebkitAvailable()){var t,n,a;null==(t=window.webkit)||null==(n=t.messageHandlers)||null==(a=n.FronteggNativeBridge)||a.postMessage(JSON.stringify({action:"loginWithSocialLogin",payload:e}))}else{if(!this.isJsInterfaceAvailable())throw new Error("FronteggNativeBridge is not available");var i;null==(i=window.FronteggNativeBridge)||i.loginWithSocialLogin(e)}},this.promptSocialLoginConsent=()=>{var e,t;return null!=(e=null==(t=window.FronteggNativeBridgeFunctions)?void 0:t.shouldPromptSocialLoginConsent)&&e}}isWebkitAvailable(){var e,t;return null!=(null==(e=window.webkit)||null==(t=e.messageHandlers)?void 0:t.FronteggNativeBridge)}isJsInterfaceAvailable(){return null!=window.FronteggNativeBridge}isSocialLoginAvailable(){return this.isAvailable("loginWithSocialLogin")}isLoginWithSSOAvailable(){return this.isAvailable("loginWithSSO")}isAvailable(e){var t,n;return!(!this.isWebkitAvailable()&&!this.isJsInterfaceAvailable())&&null!=(t=null==(n=window.FronteggNativeBridgeFunctions)?void 0:n[e])&&t}};function*mv(){const{publicAuthStrategyPolicy:e}=yield qi((e=>e.auth.securityPolicyState)),{policy:t}=e,n=(e=>{var t;return!(null==e||null==(t=e.secondaryAuthStrategies)||!t.some((({isActive:e,strategy:t})=>e&&t===qs.Passkeys)))})(t),a="Passkeys"===localStorage.getItem("preferred-login-method"),i="true"===localStorage.getItem("dont-show-again-prompt-passkeys"),[o]=yield $i($p,["show-passkeys-new"]);if(!o||!n||a||i)return!1;{const{devices:e}=yield $i(Ip.auth.getWebAuthnDevices);return yield Bi($a.setPasskeysState({devices:null!=e?e:[]})),0===(null!=e&&e.length?e.length:0)}}function*Av({user:e,tenants:t=[],activeTenant:n},a={}){const{tenantsState:i}=yield qi((e=>e.auth));yield Bi($a.setState(x({user:e,tenantsState:x({},i,{tenants:t,activeTenant:n,loading:!1})},a)))}const bv="http://schemas.openid.net/pape/policies/2007/06/multi-factor",Tv=["otp","sms","hwk"],Ev="SHOULD_STEP_UP",Iv=(e,{maxAge:t}={})=>{if(!e)return!1;const{amr:n=[],acr:a="",auth_time:i}=e;if(t&&i&&!(Date.now()/1e3-i<=t))return!1;const o=a===bv,r=-1!==n.indexOf("mfa"),s=void 0!==Tv.find((e=>n.indexOf(e)));return o&&r&&s};function kv(){const e=window.location.pathname+window.location.search;window.localStorage.setItem(Rt,e)}function*Ov(e){const{routes:t,includeQueryParam:n,enforceRedirectToSameSite:a=!1,allowedRedirectOrigins:i=[]}=yield qi((e=>e.auth));if(e)return(e=>{const{pathname:t}=new URL(e),n=Ng(e);return n?t+n:t})(e);const{authenticatedUrl:o,loginUrl:r,logoutUrl:s,socialLoginCallbackUrl:l,activateUrl:c}=t;let d=window.localStorage.getItem(Rt);d&&![r,s,l,c].includes(d)||(d=o);const u=(({authenticatedUrl:e,enforceRedirectToSameSite:t,allowedRedirectOrigins:n,includeQueryParam:a})=>{let i=e;const o=new URL(window.location.href).searchParams.get("redirectUrl");return o?t&&_g(o)?((e,t)=>{const n=new URL(window.location.href),a=new URL(e),i=a.origin===n.origin;return t.includes(a.origin)||i})(o,n)?i=o:console.warn("The redirect url param is not valid, the origin is a different site"):i=o:a&&(i+=window.location.search),i})({authenticatedUrl:d,includeQueryParam:n,enforceRedirectToSameSite:a,allowedRedirectOrigins:i});return(y=u).startsWith(null==(f=window)?void 0:f.location.origin)?y.replace(null==(p=window)?void 0:p.location.origin,""):y;var y,f,p}function*Pv(e,{customLoginAuthenticatedUrl:t,forceStepUpUrl:n,shouldStepUpDuringLogin:a}={}){const i=zo.onRedirectTo;let o;if(n)o=n;else{var r;if(a){const e=window.localStorage.getItem(Rt);e&&!_g(e)&&(o=e)}o||(o=yield $i(Ov,t)),null==(r=window)||r.localStorage.removeItem(Rt)}yield Ji(200),Bi(e()),i(o,{refresh:o.startsWith("http")})}function*Lv(){var e;const{routes:{customLoginAuthenticatedUrl:t,stepUpUrl:n}}=yield qi((e=>e.auth)),a=null==(e=window)?void 0:e.localStorage.getItem(Ev),i=yield qi((({auth:e})=>e.user));var o;if(a&&(null==(o=window)||o.localStorage.removeItem(Ev)),n&&a&&!Iv(i))return void(yield $i(Pv,$a.resetLoginState,{forceStepUpUrl:n}));let r=t;t||(yield $i(Xg),r=yield qi((e=>{var t;return null==(t=e.auth.routes)?void 0:t.customLoginAuthenticatedUrl}))),yield $i(Pv,$a.resetLoginState,{customLoginAuthenticatedUrl:r,shouldStepUpDuringLogin:!!a})}function*wv(){yield $i(Pv,$a.resetStepUpState)}const Dv=["callback"];function*Uv(e,t,n){const{loginState:a}=yield qi((e=>e.auth));let i={};if(!n){const t=a.flow===Dt.Login?wt.success:a.step;i={loginState:{flow:a.flow,quickLoginToRegister:a.quickLoginToRegister,loading:!1,step:t,error:void 0,tenants:e}}}return x({},i,{isAuthenticated:t})}function*Cv(e,t){const{loginState:n}=yield qi((e=>e.auth));if(n.flow!==Dt.Login)return;const[a]=yield $i($p,["security-center-show-login-flows"]);a&&n.isBreachedPassword&&!e?yield Bi($a.setLoginState({step:wt.breachedPassword,loading:!1})):(yield $i(mv))?yield Bi($a.setLoginState({step:wt.promptPasskeys,loading:!1})):yield Lv(),null==t||t(!0)}function*Rv(e){yield wv(),null==e||e(!0)}function*_v(e,t,n){let{callback:a}=e,i=ii(e,Dv);yield Bi(t({loading:!0,error:void 0}));try{const{user:e,tenants:o=[],activeTenant:r}=yield $i(Ip.auth.loginWithMfaV2,i),s=!!e.accessToken,l=yield $i(Uv,o,s,n);if(yield $i(Av,{user:e,tenants:o,activeTenant:r},l),e.id&&localStorage.setItem("userId",e.id),yield Bi(t({loading:!1,error:void 0})),n)return void(yield $i(Rv,a));yield $i(Cv,s,a)}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==a||a(!1,e)}}function*Nv({payload:e}){yield _v(e,$a.setLoginState,!1)}function*Mv(){yield $i(wv)}function*Fv(e){const{loginState:t}=yield qi((e=>e.auth)),{step:n}=yield qi((e=>e.auth.mfaState)),[a]=yield $i($p,["security-center-show-login-flows"]);if(t.flow===Dt.Login)if(a&&t.isBreachedPassword&&!e)yield Bi($a.setLoginState({step:wt.breachedPassword,loading:!1}));else{const e=yield $i(mv);n===un.smsVerifyCode&&e?yield Bi($a.setLoginState({step:wt.promptPasskeys,loading:!1})):yield Lv()}}function*Gv({user:e,tenants:t,activeTenant:n},a=!1){yield Bi($a.setUser(e)),yield Bi($a.setTenantsState({tenants:t,activeTenant:n,loading:!1})),e.id&&localStorage.setItem("userId",e.id);const i=!!e.accessToken;yield Bi($a.setState({isAuthenticated:i})),a?yield $i(Mv):yield $i(Fv,i)}const xv=["callback","deviceId"],Vv=["callback","deviceId"];function*jv(e,t){let{callback:n,deviceId:a}=e,i=ii(e,xv);yield Bi(t({loading:!1,error:void 0}));try{const e=yield $i(Ip.auth.preVerifyMFASMSForLogin,a,i);yield Bi($a.setMfaState({otcToken:e.otcToken,step:un.smsVerifyCode,phoneNumber:e.phoneNumber})),yield Bi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==n||n(null)}}function*Bv(e,t,n=!1){let{callback:a,deviceId:i}=e,o=ii(e,Vv);yield Bi(t({loading:!0}));try{const e=yield $i(Ip.auth.verifyMFASMSForLoginV2,i,o);yield Gv(e,n),yield Bi(t({loading:!1,error:void 0})),null==a||a(!0)}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==a||a(null)}}function*Wv({payload:e}){yield jv(e,$a.setLoginState)}function*zv({payload:e}){yield Bv(e,$a.setLoginState,!1)}const $v=["callback","deviceId"],Kv=["callback","deviceId"];function*Hv(e,t){let{callback:n,deviceId:a}=e,i=ii(e,$v);yield Bi(t({loading:!0}));try{var o;const e=yield $i(Ip.auth.preVerifyMFAWebAuthnForLogin,a,i),r=x({},e.options,{challenge:Pt(e.options.challenge),allowCredentials:null==(o=e.options.allowCredentials)?void 0:o.map((e=>x({},e,{id:Pt(e.id)})))});yield Bi(t({loading:!1,error:void 0})),null==n||n({options:r,webauthnToken:e.webauthnToken})}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==n||n(null)}}function*qv(e,t,n){let{callback:a,deviceId:i}=e,o=ii(e,Kv);yield Bi(t({loading:!0}));try{const e=Lt(o.publicKey),r=yield $i(Ip.auth.verifyMFAWebAuthnForLoginV2,i,x({},o,{options:e}));yield Gv(r,n),yield Bi(t({loading:!1,error:void 0})),null==a||a(!0)}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==a||a(null)}}function*Jv({payload:e}){yield Hv(e,$a.setLoginState)}function*Yv({payload:e}){yield qv(e,$a.setLoginState,!1)}const Xv=["callback"],Qv=["callback"];function*Zv(e,t){let{callback:n}=e,a=ii(e,Xv);yield Bi(t({loading:!0,error:void 0}));try{const e=yield $i(Ip.auth.preVerifyMFAEmailCode,a);yield Bi($a.setMfaState({otcToken:e.otcToken,step:un.emailVerifyCode})),yield Bi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Bi(t({error:Bg(e)})),null==n||n(null)}}function*eh(e,t){let{callback:n}=e,a=ii(e,Qv);yield Bi(t({loading:!0}));try{const e=yield $i(Ip.auth.verifyMFAEmailCodeV2,a);yield Gv(e),yield Bi(t({loading:!1,error:void 0})),null==n||n(!0)}catch(e){yield Bi(t({loading:!1,error:Bg(e)})),null==n||n(null)}}function*th({payload:e}){yield Zv(e,$a.setLoginState)}function*nh({payload:e}){yield eh(e,$a.setLoginState)}const ah=["callback"],ih=["callback"],oh=["callback"],rh=["callback"],sh=["callback","events"],lh=["callback"],ch=["callback"],dh=["callback"],uh=["callback"],yh=["user"],fh=["callback"],ph=["callback"],gh=["callback"],Sh=["callback"],vh=["callback"];function*hh(e){const t=yield qi((e=>{var t;return null==(t=e.auth.user)?void 0:t.entitlements}));return gv(t,null==e?void 0:e.entitlements)?x({},e,{entitlements:t}):e}function*mh(){let e;try{var t;const n=yield $i(Ip.metadata.getSamlMetadata);e=null==n||null==(t=n.configuration)?void 0:t.acsUrl}catch(e){console.error(e)}yield Bi($a.setState({ssoACS:e}))}function*Ah(){try{const{isActive:e}=yield $i(Ip.auth.getSSOPublicConfiguration);yield Bi($a.setState({isSSOAuth:e}))}catch(e){console.error(e)}}function*bh(e){var t;const{routes:n,loginState:a}=yield qi((e=>e.auth)),i=null!=(t=localStorage.getItem("register-quick-login"))?t:a.quickLoginToRegister;return i&&"true"!==localStorage.getItem(`${e.id}-${i}`)&&!window.location.pathname.endsWith(n.logoutUrl)}function*Th(){const{hostedLoginBox:e}=yield qi((e=>e.auth));e?yield $i(Eh):yield $i(kh)}function*Eh(){const{user:e}=yield qi((e=>e.auth));if(null==e||!e.refreshToken)return zo.setAccessToken(null),zo.setUser(null),void(yield Bi($a.setState({user:null,isAuthenticated:!1})));try{const t={grant_type:"refresh_token",refresh_token:null==e?void 0:e.refreshToken},n=yield $i(Ip.auth.exchangeOAuthTokensV2,t),a=yield $i(hh,n.user);yield $i(Av,x({},n,{user:a}),{isAuthenticated:!0})}catch(e){zo.setAccessToken(null),zo.setUser(null),yield Bi($a.setState({user:null,isAuthenticated:!1}))}}function*Ih(){const{user:e}=yield qi((e=>e.auth));if(null==e||!e.refreshToken)return zo.setAccessToken(null),zo.setUser(null),void(yield Bi($a.setState({user:null,isAuthenticated:!1})));try{const t={grant_type:"refresh_token",refresh_token:null==e?void 0:e.refreshToken},n=yield $i(Ip.auth.exchangeOAuthTokensV2,t),a=yield $i(hh,n.user);yield $i(Av,x({},n,{user:a}),{isAuthenticated:!0})}catch(e){zo.setAccessToken(null),zo.setUser(null),yield Bi($a.setState({user:null,isAuthenticated:!1}))}}function*kh(){try{const t=zo.onRedirectTo,{routes:n,loginState:a}=yield qi((e=>e.auth)),{user:i,tenants:o=[],activeTenant:r}=yield $i(Ip.auth.refreshTokenV3);if(Gg(i)){const e=yield jg(i);yield Bi($a.setState(e)),t(n.loginUrl,{preserveQueryParams:!0})}else{var e;i.id&&localStorage.setItem("userId",i.id);const t=null!=(e=localStorage.getItem("register-quick-login"))?e:a.quickLoginToRegister,n=yield bh(i),s=yield $i(hh,i);yield $i(Av,{user:s,tenants:o,activeTenant:r},{loginState:x({},a,{quickLoginToRegister:t,flow:n?Dt.RegisterQuickLogin:Dt.Login}),isAuthenticated:!0}),yield Ph(n)}}catch(e){zo.setAccessToken(null),zo.setUser(null),yield Bi($a.setState({user:void 0,isAuthenticated:!1}))}}function*Oh(){try{const t=zo.onRedirectTo,{routes:n,loginState:a}=yield qi((e=>e.auth)),{user:i,tenants:o=[],activeTenant:r}=yield $i(Ip.auth.refreshTokenV3);if(Gg(i)){const e=yield jg(i);yield Bi($a.setState(e)),t(n.loginUrl,{preserveQueryParams:!0})}else{const s=yield $i(hh,i);if(yield $i(mv))yield Bi($a.setLoginState({step:wt.promptPasskeys,loading:!1})),yield $i(Av,{user:s,tenants:o,activeTenant:r},{isLoading:!1}),t(n.loginUrl,{preserveQueryParams:!0});else{var e;i.id&&localStorage.setItem("userId",i.id);const t=null!=(e=localStorage.getItem("register-quick-login"))?e:a.quickLoginToRegister,n=yield bh(i);yield $i(Av,{user:s,tenants:o,activeTenant:r},{loginState:x({},a,{quickLoginToRegister:t,flow:n?Dt.RegisterQuickLogin:Dt.Login}),isAuthenticated:!0}),yield Ph(n)}}}catch(e){zo.setAccessToken(null),zo.setUser(null),yield Bi($a.setState({user:void 0,isAuthenticated:!1}))}}function*Ph(e){var t;const n=new URL(null==(t=window)?void 0:t.location.href),a=zo.onRedirectTo,{routes:i,loginState:o}=yield qi((e=>e.auth)),r=n.searchParams.get("invitationToken"),s=[i.socialLoginCallbackUrl,i.oidcRedirectUrl,i.samlCallbackUrl];r||s.push(i.loginUrl,i.signUpUrl),e?a(i.loginUrl):s.some((e=>e&&window.location.pathname.endsWith(e)))&&(o.isNewUser&&i.signUpSuccessUrl&&i.socialLoginCallbackUrl===window.location.pathname?a(i.signUpSuccessUrl,{refresh:i.signUpSuccessUrl.startsWith("http")}):yield Lv())}function*Lh({payload:{callback:e}}){try{const{ip:t}=yield $i(Ip.metadata.getCurrentUserIpMetadata);yield Bi($a.setState({userIp:t})),null==e||e(!0)}catch(t){null==e||e(!1)}}function*wh({payload:e}){const t=[],n=[];t.push($i(Th)),e&&(yield Bi($a.setState({isLoading:!0})),yield Bi($a.loadSocialLoginsConfigurationV2()),t.push($i(nv)),t.push($i(LS)),t.push($i(Ah)),t.push($i(yv)),t.push($i(mh)),n.push($i(Xg))),yield Wi(t),n.length>0&&(yield Wi(n)),yield Bi($a.setState({isLoading:!1}))}function*Dh({accessToken:e,user:t}){if(!e)return void(yield Bi($a.setState({user:void 0,isAuthenticated:!1})));const n=zo.onRedirectTo,{routes:a}=yield qi((e=>e.auth));if(Gg(t)){const e=yield jg(t);yield Bi($a.setState(e)),n(a.loginUrl,{preserveQueryParams:!0})}}function*Uh({payload:e}){const t=[];yield Bi($a.loadSocialLoginsConfigurationV2()),t.push($i(nv)),t.push($i(Ah)),t.push($i(yv)),t.push($i(mh)),t.push($i(Dh,e)),t.push($i(Xg)),yield Wi(t)}const Ch=e=>{var t;if("path"===e)return(null!=(t=window)?t:document).location.pathname;{var n;const e=((null!=(n=window)?n:document).location.hash||"#").substring(1);return-1!==e.indexOf("?")?e.substring(0,e.indexOf("?")):e}};function*Rh(){const e=yield $i(Ip.auth.silentOAuthRefreshTokenV2);if(null==e||!e.user)throw new Error("couldn't refresh user token with oauth service");yield $i(Av,e,{isAuthenticated:!0,isLoading:!1})}function*_h({payload:e}){var t;null==(t=localStorage)||t.removeItem(Ev);const{disableSilentRefresh:n}=yield qi((e=>({disableSilentRefresh:e.auth.disableSilentRefresh})));if("login"!==(null==e?void 0:e.prompt))try{if(n)throw new Error("silent refresh is disabled");yield Rh()}catch(t){yield Mh(e)}else yield Mh(e)}function*Nh({payload:{additionalParams:e,shouldRedirectToLogin:t,firstTime:n,loginDirectAction:a}}){var i,o;if(null==(i=localStorage)||i.removeItem(Ev),n){const{urlStrategy:e}=yield qi((e=>({urlStrategy:e.root.urlStrategy}))),t=Ch(e);if(yield Bi($a.setState({isLoading:!0})),(e=>"/oauth/callback"===e)(t))return}const{disableSilentRefresh:r}=yield qi((e=>({disableSilentRefresh:e.auth.disableSilentRefresh})));if(a&&((e=e||{}).login_direct_action=btoa(JSON.stringify(a))),"login"!==(null==(o=e)?void 0:o.prompt))try{if(r)throw new Error("silent refresh is disabled");yield Rh()}catch(n){if(!t)return void(yield Bi($a.setState({isLoading:!1})));yield Mh(e)}else yield Mh(e)}function*Mh(e){const{routes:t,context:n,onRedirectTo:a,urlStrategy:i}=yield qi((e=>({routes:e.auth.routes,onRedirectTo:e.auth.onRedirectTo,context:e.root.context,urlStrategy:e.root.urlStrategy})));if(Ch(i)===t.hostedLoginRedirectUrl)return void console.debug("Calling loginWithRedirect while in hostedLoginCallback route");yield Bi($a.setState({isLoading:!0}));const o=Wp(),r=Wp(),s=yield $i(Bp,r);localStorage.setItem(_t,r);let l=`${window.location.origin}${"path"===i?"":"#"}${t.hostedLoginRedirectUrl}`;yield $i(Xg);const c=yield qi((e=>{var t;return null==(t=e.auth.customLoginState)?void 0:t.customLoginSearchParams}));c&&(l.endsWith("/")&&(l=l.slice(0,-1)),l+=c);const d=`${Nr(n,"/oauth/authorize")}/oauth/authorize`,u=x({response_type:"code",client_id:n.appId||n.clientId||"INVALID-CLIENT-ID",scope:"openid email profile",redirect_uri:l,code_challenge:s,code_challenge_method:"S256",nonce:o},e);if(null==e||!e.organization){const e=yield $i(Yg);e&&(u.organization=e)}const y=Mg(Fg);y&&(u.tenantId=y),a(`${d}?${new URLSearchParams(u).toString()}`,{refresh:!0})}function*Fh({payload:e}){const t=localStorage.getItem(_t)||"INVALID-CODE-VERIFIER",{routes:n,urlStrategy:a}=yield qi((e=>({routes:e.auth.routes,urlStrategy:e.root.urlStrategy})));let i=`${window.location.origin}${"path"===a?"":"#"}${n.hostedLoginRedirectUrl}`;yield $i(Xg);const o=yield qi((e=>{var t;return null==(t=e.auth.customLoginState)?void 0:t.customLoginSearchParams}));o&&(i.endsWith("/")&&(i=i.slice(0,-1)),i+=o);const r={code:e.code,redirect_uri:i,code_verifier:t,grant_type:"authorization_code"};try{const e=yield $i(Ip.auth.exchangeOAuthTokensV2,r);yield $i(Av,e,{isAuthenticated:!0,isLoading:!1})}catch(e){yield Bi($a.setState({isLoading:!1})),console.error("Failed to exchangeOAuthTokens",e)}finally{const e=yield qi((({auth:e})=>e.user)),t=window.localStorage.getItem(Ev);window.localStorage.removeItem(Ev),t&&Iv(e)?yield wv():yield Lv()}}function*Gh(e){let{payload:{callback:t}}=e,n=ii(e.payload,ah);try{yield Bi($a.setLoginState({loading:!0}));const e=yield $i(Ip.auth.changePhoneNumberWithVerification,n);yield Bi($a.setLoginState({phoneNumber:n.phoneNumber,loading:!1,changePhoneId:e.changePhoneId,step:wt.loginWithQuickSmsOtc,error:void 0})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({error:Bg(e),loading:!1}))}}function*xh(e){let{payload:{callback:t}}=e,n=ii(e.payload,ih);try{yield Bi($a.setLoginState({loading:!0})),yield $i(Ip.auth.verifyChangePhoneNumber,n),yield Bi($a.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({error:Bg(e),loading:!1}))}}function*Vh(e){let{payload:{callback:t}}=e,n=ii(e.payload,oh);try{yield Bi($a.setLoginState({loading:!0}));const e=yield $i(Ip.auth.passwordlessPreLogin,x({},n,{type:Oa.SmsCode}));yield Bi($a.setLoginState({step:wt.loginWithQuickSmsOtc,loading:!1,phoneNumber:null==e?void 0:e.phoneNumber,error:void 0})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({error:Bg(e),loading:!1})),null==t||t(e)}}function*jh(e){let{payload:{callback:t}}=e,n=ii(e.payload,rh);try{let e;yield Bi($a.setLoginState({loading:!0})),function(e){return"email"in e}(n)&&(e=n.email);const a=yield $i(Ip.auth.passwordlessPreLogin,n),i=La[n.type];yield Bi($a.setLoginState({step:i,loading:!1,phoneNumber:null==a?void 0:a.phoneNumber,email:e,error:void 0})),null==t||t()}catch(e){yield Bi($a.setLoginState({error:Bg(e),loading:!1})),null==t||t()}}function*Bh(e){let{payload:{callback:t,events:n}}=e,a=ii(e.payload,sh);try{yield Bi($a.setLoginState({loading:!0}));const{user:e,tenants:o=[],activeTenant:r}=yield $i(Ip.auth.passwordlessPostLoginV2,a),s=zo.onRedirectTo,{routes:l}=yield qi((e=>e.auth));if(Gg(e)){const t=yield jg(e);yield Bi($a.setState(t)),s(l.loginUrl,{preserveQueryParams:!0})}else{const{loginState:a}=yield qi((e=>e.auth));if(e.emailVerified){var i;const t={email:e.email,origin:Ug.PASSWORDLESS,id:e.id,tenantId:e.tenantId,createdAt:new Date,name:e.name};null==n||null==(i=n.userVerified)||i.call(n,t),zg(Wg.USER_VERIFIED,t)}e.id&&localStorage.setItem("userId",e.id),yield $i(Av,{user:e,tenants:o,activeTenant:r}),yield Bi($a.setLoginState({error:void 0})),yield Bi($a.setState({isLoading:!1})),a.flow===Dt.Login?(yield $i(mv))?(yield Bi($a.setLoginState({step:wt.promptPasskeys,loading:!1})),s(l.loginUrl,{preserveQueryParams:!0})):(yield Bi($a.setState({isAuthenticated:!0})),yield Lv()):s(l.loginUrl,{preserveQueryParams:!0}),localStorage.removeItem("register-quick-login"),null==t||t(!0)}}catch(e){yield Bi($a.setLoginState({error:Bg(e,"Failed to authenticate")}))}finally{yield Bi($a.setLoginState({loading:!1}))}}function*Wh({payload:e}){try{yield Bi($a.setLoginState({loading:!0}));const{name:t}=yield $i(Ip.auth.verifyInviteToken,e);yield Bi($a.setLoginState({inviteTokenTenantName:t}))}catch(e){yield Bi($a.setLoginState({inviteTokenError:Bg(e,"We couldn't verify your invitation")}))}finally{yield Bi($a.setLoginState({loading:!1}))}}function*zh({payload:{email:e,recaptchaToken:t,invitationToken:n,callback:a}}){yield Bi($a.setLoginState({loading:!0}));try{const i=yield qi((({auth:{onRedirectTo:e}})=>e)),o=Mg(Fg),{address:r,idpType:s}=yield $i(Ip.auth.preLoginV2,{email:e,tenantId:o});if(r){let t=r;if(s===Pp.Oidc&&!t.includes("redirect_uri")){const{routes:{oidcRedirectUrl:e}}=yield qi((({auth:{routes:e}})=>({routes:e})));t+=`&redirect_uri=${window.location.origin}${e}`}hv.isLoginWithSSOAvailable()?(hv.loginWithSSO(e),yield Bi($a.setLoginState({loading:!1})),null==a||a()):(yield Bi($a.setLoginState({step:wt.redirectToSSO,loading:!1,ssoRedirectUrl:t})),setTimeout((()=>{i(t,{refresh:!0})}),2e3))}else yield $h({email:e,recaptchaToken:t,callback:a,invitationToken:n})}catch(i){yield $h({email:e,recaptchaToken:t,callback:a,invitationToken:n})}}function*$h(e){let{callback:t}=e,n=ii(e,lh);const a=yield qi((({auth:{securityPolicyState:{publicPolicy:{policy:e}}}})=>e));if(null==a||!a.authStrategy)return yield Bi($a.setLoginState({step:wt.loginWithPassword,loading:!1})),void(null==t||t());(null==a?void 0:a.authStrategy)===Oa.EmailAndPassword?(yield Bi($a.setLoginState({step:wt.loginWithPassword,loading:!1})),null==t||t()):[Oa.MagicLink,Oa.Code,Oa.SmsCode].includes(null==a?void 0:a.authStrategy)?yield Bi($a.passwordlessPreLogin(x({},n,{type:null==a?void 0:a.authStrategy,callback:t}))):(yield Bi($a.setLoginState({step:wt.loginWithPassword,loading:!1})),null==t||t())}function*Kh({payload:{callback:e}}){try{yield Bi($a.setLoginState({loading:!0}));const{options:t}=yield $i(Ip.auth.webAuthnCreateNewDeviceSession);t.user.id=Pt(t.user.id),t.challenge=Pt(t.challenge),t.excludeCredentials=[],null==e||e(t)}catch(t){yield Bi($a.setLoginState({error:Bg(t)})),null==e||e(null)}finally{yield Bi($a.setLoginState({loading:!1}))}}function*Hh(e){let{payload:{callback:t}}=e,n=ii(e.payload,ch);try{yield Bi($a.setLoginState({loading:!0}));const e=Lt(n.publicKey),a="platform"===(null==e?void 0:e.authenticatorAttachment)?Js.Platform:Js.CrossPlatform;yield $i(Ip.auth.verifyNewDeviceSession,{id:e.id,response:e.response,deviceType:a}),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({error:Bg(e)})),null==t||t(null)}finally{yield Bi($a.setLoginState({loading:!1}))}}function*qh(e){let{payload:{callback:t}}=e,n=ii(e.payload,dh);try{var a;yield Bi($a.setPasskeysState({loading:!0})),yield Bi($a.setLoginState({loading:!0}));const{options:e}=yield $i(Ip.auth.webAuthnPreLogin,n);e.challenge=Pt(e.challenge),e.allowCredentials=null==(a=e.allowCredentials)?void 0:a.map((e=>x({},e,{id:Pt(e.id)}))),yield Bi($a.setLoginState({error:void 0})),null==t||t(e)}catch(e){yield Bi($a.setLoginState({error:Bg(e)})),null==t||t(null)}finally{yield Bi($a.setPasskeysState({loading:!1})),yield Bi($a.setLoginState({loading:!1}))}}function*Jh(e){let{payload:{callback:t}}=e,n=ii(e.payload,uh);try{var a;yield Bi($a.setPasskeysState({loading:!0})),yield Bi($a.setLoginState({loading:!0}));const e=Lt(n.publicKey),i=yield $i(Ip.auth.webAuthnPostLoginV2,x({},e,{response:x({},e.response,{userHandle:null!=(a=e.response.userHandle)?a:void 0}),recaptchaToken:n.recaptchaToken,invitationToken:n.invitationToken})),{user:o}=i,r=ii(i,yh);if(Gg(o)){const e=zo.onRedirectTo,{routes:t}=yield qi((e=>e.auth)),n=yield jg(o);yield Bi($a.setState(n)),e(t.loginUrl,{preserveQueryParams:!0})}else o.id&&localStorage.setItem("userId",o.id),yield $i(Av,x({user:o},r),{isAuthenticated:!0}),yield Bi($a.setLoginState({error:void 0})),yield Lv(),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({error:Bg(e)})),null==t||t(null)}finally{yield Bi($a.setPasskeysState({loading:!1})),yield Bi($a.setLoginState({loading:!1}))}}function*Yh({payload:e}){const{onRedirectTo:t,routes:n}=yield qi((({auth:{onRedirectTo:e,routes:t}})=>({onRedirectTo:e,routes:t})));yield Bi($a.setLoginState({loading:!0}));try{const t=yield $i(Ip.auth.postLogin,e);yield Bi($a.setState({user:t.accessToken?t:void 0,isAuthenticated:!!t.accessToken})),yield Lv()}catch(e){setTimeout((()=>{t(n.authenticatedUrl)}),1e3),yield Bi($a.setLoginState({step:wt.loginWithSSOFailed,loading:!1}))}}function*Xh({payload:{email:e,password:t,recaptchaToken:n,invitationToken:a,callback:i}}){yield Bi($a.setLoginState({loading:!0}));try{const{user:o,tenants:r=[],activeTenant:s}=yield $i(Ip.auth.loginv2,{email:e,password:t,recaptchaToken:n,invitationToken:a}),l=zo.onRedirectTo,{routes:c}=yield qi((e=>e.auth));if(Gg(o)){const e=yield jg(o);yield Bi($a.setState(e)),l(c.loginUrl,{preserveQueryParams:!0})}else{const{loginState:t}=yield qi((e=>e.auth)),n=!!o.accessToken;o.id&&localStorage.setItem("userId",o.id),yield $i(Av,{user:o,tenants:r,activeTenant:s},{loginState:{flow:t.flow,quickLoginToRegister:t.quickLoginToRegister,email:e,loading:!1,error:void 0,mfaToken:o.mfaToken,step:t.flow===Dt.Login?wt.success:t.step,tenants:r,tenantsLoading:!0,isBreachedPassword:o.isBreachedPassword},isAuthenticated:n});const[a]=yield $i($p,["security-center-show-login-flows"]);t.flow===Dt.Login&&(a&&o.isBreachedPassword&&!n?yield Bi($a.setLoginState({step:wt.breachedPassword,loading:!1})):n&&((yield $i(mv))?(yield Bi($a.setLoginState({step:wt.promptPasskeys,loading:!1})),l(c.loginUrl,{preserveQueryParams:!0})):yield Lv()))}localStorage.removeItem("register-quick-login"),null==i||i(!0)}catch(t){zo.setAccessToken(null),zo.setUser(null),null==i||i(!1,t),yield Bi($a.setLoginState({email:e,error:Bg(t),loading:!1}))}}function*Qh({payload:e}){yield Bi($a.setLoginState({loading:!0}));try{var t;yield $i(Ip.auth.recoverMfaToken,e),yield Bi($a.setLoginState({loading:!1,error:void 0,step:wt.preLogin})),yield Bi($a.setState({user:void 0,isAuthenticated:!1})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setLoginState({error:Bg(t),loading:!1})),null==(n=e.callback)||n.call(e,!1,t)}}function*Zh({payload:e}){const{hostedLoginBox:t}=yield qi((e=>e.auth));yield Bi($a.setState({isLoading:!0}));try{t?yield $i(Ip.auth.OAuthLogout):yield $i(Ip.auth.logout)}catch{}zo.isSessionPerTenantEnabled()&&ss(),yield Bi($a.resetState()),yield Bi($a.requestAuthorize(!0)),null==e||e()}function*em({payload:e}){var t;try{yield $i(Ip.auth.logout)}catch{}zo.isSessionPerTenantEnabled()&&ss(),setTimeout((()=>{var t;return null==e||null==(t=e.callback)?void 0:t.call(e,!0)}),null!=(t=null==e?void 0:e.callbackTimeout)?t:500)}function*tm({user:e,tenants:t,activeTenant:n}){const a={step:un.recoveryCode,loading:!1,error:void 0,saving:!1};null!=e&&e.recoveryCode&&(a.recoveryCode=e.recoveryCode),yield Bi($a.setMfaState(a)),yield Bi($a.setUser(e)),yield Bi($a.setTenantsState({tenants:t,activeTenant:n,loading:!1})),e.id&&localStorage.setItem("userId",e.id)}function*nm(e){let{payload:{callback:t}}=e,n=ii(e.payload,fh);yield Bi($a.setLoginState({loading:!0}));try{const e=yield $i(Ip.auth.preEnrollMFASMSForLogin,n);yield Bi($a.setMfaState({otcToken:e.otcToken,step:un.smsVerifyCode,phoneNumber:e.phoneNumber})),yield Bi($a.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)})),null==t||t(null)}}function*am(e){let{payload:{callback:t}}=e,n=ii(e.payload,ph);yield Bi($a.setLoginState({loading:!0}));try{const e=yield $i(Ip.auth.enrollMFASMSForLoginV2,n);yield tm(e),yield Bi($a.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)})),null==t||t(null)}}function*im(e){let{payload:{callback:t}}=e,n=ii(e.payload,gh);yield Bi($a.setLoginState({loading:!0}));try{var a;const e=yield $i(Ip.auth.preEnrollMFAWebAuthnForLogin,n),i=x({},e.options,{challenge:Pt(e.options.challenge),user:x({},e.options.user,{id:Pt(e.options.user.id)}),excludeCredentials:null==(a=e.options.excludeCredentials)?void 0:a.map((e=>x({},e,{id:Pt(e.id)})))});yield Bi($a.setLoginState({loading:!1})),null==t||t({options:i,webauthnToken:e.webauthnToken})}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)})),null==t||t(null)}}function*om(e){let{payload:{callback:t}}=e,n=ii(e.payload,Sh);yield Bi($a.setLoginState({loading:!0}));try{const e=Lt(n.publicKey),a=yield $i(Ip.auth.enrollMFAWebAuthnForLoginV2,x({},n,{options:e}));yield tm(a),yield Bi($a.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)})),null==t||t(null)}}function*rm(e){let{payload:{callback:t}}=e,n=ii(e.payload,vh);yield Bi($a.setLoginState({loading:!0}));try{const e=yield $i(Ip.auth.enrollMFAAuthenticatorAppForLoginV2,n);yield tm(e),yield Bi($a.setLoginState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)})),null==t||t(null)}}function*sm({payload:e}){yield Bi($a.setLoginState({loading:!0}));try{yield $i(Ip.auth.forgotPassword,e),yield Bi($a.setLoginState({loading:!1,error:void 0,step:wt.breachedPasswordSuccess})),yield Bi($a.setState({isAuthenticated:!1}))}catch(e){yield Bi($a.setLoginState({loading:!1,error:Bg(e)}))}}function*lm(){yield Wo($a.requestAuthorize,wh),yield Wo($a.requestAuthorizeSSR,Uh),yield Wo($a.requestHostedLoginAuthorize,_h),yield Wo($a.requestHostedLoginAuthorizeV2,Nh),yield Wo($a.handleHostedLoginCallback,Fh),yield Wo($a.preLogin,zh),yield Wo($a.postLogin,Yh),yield Wo($a.login,Xh),yield Wo($a.logout,Zh),yield Wo($a.silentLogout,em),yield Wo($a.loginWithMfa,Nv),yield Wo($a.recoverMfa,Qh),yield Wo($a.quickSmsPasswordlessPreLogin,Vh),yield Wo($a.changePhoneNumberWithVerification,Gh),yield Wo($a.verifyChangePhoneNumber,xh),yield Wo($a.passwordlessPreLogin,jh),yield Wo($a.passwordlessPostLogin,Bh),yield Wo($a.verifyInviteToken,Wh),yield Wo($a.webAuthnPrelogin,qh),yield Wo($a.webAuthnPostLogin,Jh),yield Wo($a.webAuthnCreateNewDeviceSession,Kh),yield Wo($a.webAuthnVerifyNewDeviceSession,Hh),yield Wo($a.afterAuthNavigation,Lv),yield Wo($a.getUserIP,Lh),yield Wo($a.preEnrollMFASMSForLogin,nm),yield Wo($a.enrollMFASMSForLogin,am),yield Wo($a.preEnrollMFAWebAuthnForLogin,im),yield Wo($a.enrollMFAWebAuthnForLogin,om),yield Wo($a.enrollMFAAuthenticatorAppForLogin,rm),yield Wo($a.preVerifyMFASMSForLogin,Wv),yield Wo($a.verifyMFASMSForLogin,zv),yield Wo($a.preVerifyMFAWebAuthnForLogin,Jv),yield Wo($a.verifyMFAWebAuthnForLogin,Yv),yield Wo($a.preVerifyMFAEmailCode,th),yield Wo($a.verifyMFAEmailCode,nh),yield Wo($a.resetBreachedPassword,sm)}function*cm({payload:e}){e&&(yield Bi($a.setState({isLoading:!0})));const t=Yp;yield Bi($a.loadTenants()),yield Bi($a.setState({user:t,isAuthenticated:!0,isLoading:!1}))}function*dm({payload:{callback:e}}){try{const{ip:t}=Ag[0];yield Bi($a.setState({userIp:t})),null==e||e(!0,t)}catch(t){null==e||e(!1,t)}}function*um(){yield Wo($a.requestAuthorize,cm),yield Wo($a.afterAuthNavigation,Lv),yield Wo($a.getUserIP,dm)}const ym=["callback","samlVendor"],fm=["callback","samlVendor"];function*pm(){try{var e,t;yield Bi($a.setSSOState({loading:!0}));const n=yield $i(Ip.auth.getSamlConfiguration),a=yield $i(Ip.auth.getOidcConfiguration),i=yield $i(Ip.metadata.getSamlMetadata);n.acsUrl=null==i||null==(e=i.configuration)?void 0:e.acsUrl,n.spEntityId=null==i||null==(t=i.configuration)?void 0:t.spEntityId,n.isSamlActive=null==i?void 0:i.isActive,yield Bi($a.setSSOState({samlConfiguration:n,oidcConfiguration:a,loading:!1,firstLoad:!1}))}catch(e){yield Bi($a.setSSOState({error:Bg(e),loading:!1}))}}function*gm({payload:e}){const t=yield qi((e=>e.auth.ssoState.samlConfiguration)),n="saving";yield Bi($a.setSSOState({error:void 0,[n]:!0}));try{const a=yield zp(e[0]),i=yield $i(Ip.auth.updateSamlVendorMetadata,{metadata:a});i.isSamlActive=null==t?void 0:t.isSamlActive,yield Bi($a.setSSOState({samlConfiguration:i,error:void 0,[n]:!1}))}catch(e){yield Bi($a.setSSOState({samlConfiguration:t,error:Bg(e),[n]:!1}))}}function*Sm({payload:e}){const{configFile:t,callback:n}=e,a=yield qi((e=>e.auth.ssoState.samlConfiguration)),i="saving";yield Bi($a.setSSOState({error:void 0,[i]:!0}));try{const e=yield zp(t),o=yield $i(Ip.auth.updateSamlVendorMetadata,{metadata:e});o.isSamlActive=null==a?void 0:a.isSamlActive,yield Bi($a.setSSOState({samlConfiguration:o,error:void 0,[i]:!1})),null==n||n(!0)}catch(e){yield Bi($a.setSSOState({samlConfiguration:a,error:Bg(e),[i]:!1})),null==n||n(null,e)}}function*vm({payload:e}){const{callback:t,samlVendor:n}=e,a=ii(e,ym),i=yield qi((e=>e.auth.ssoState.samlConfiguration)),o=x({},i,a);let r="saving";(null==o?void 0:o.enabled)!==i.enabled&&(r="loading");try{if(null==o||!o.domain)return void(yield Bi($a.setSSOState({samlConfiguration:x({},i,o)})));if(yield Bi($a.setSSOState({error:void 0,[r]:!0})),e.type===Pp.Saml){var s,l;const e=yield $i(Ip.metadata.getSamlMetadata);o.acsUrl=null==e||null==(s=e.configuration)?void 0:s.acsUrl,o.spEntityId=null==e||null==(l=e.configuration)?void 0:l.spEntityId}const a=jp(o,["validated","generatedVerification","createdAt","updatedAt"]);(null==i?void 0:i.domain)!==(null==a?void 0:a.domain)&&(a.ssoEndpoint="",a.publicCertificate="",a.signRequest=!1),a.type=null==n?void 0:n.toLowerCase();const c=yield $i(Ip.auth.updateSamlConfiguration,a);c.isSamlActive=null==i?void 0:i.isSamlActive,yield Bi($a.setSSOState({samlConfiguration:c,error:void 0,[r]:!1})),null==t||t(!0)}catch(e){yield Bi($a.setSSOState({samlConfiguration:i,error:Bg(e),[r]:!1})),null==t||t(null,e)}}function*hm({payload:{callback:e}={}}){const t=yield qi((e=>e.auth.ssoState.samlConfiguration));try{yield Bi($a.setSSOState({error:void 0,saving:!0})),yield $i(Ip.auth.validateSamlDomain),yield Bi($a.setSSOState({samlConfiguration:x({},t,{validated:!0}),error:void 0,saving:!1})),null==e||e(!0)}catch(n){yield Bi($a.setSSOState({samlConfiguration:x({},t,{validated:!1}),error:Bg(n),saving:!1})),null==e||e(null,n)}}function*mm(){try{const e=yield $i(Ip.auth.getSamlRoles),t=yield $i(Ip.auth.getSamlRolesGroups);yield Bi($a.setSSOState({authorizationRoles:e.roleIds,rolesGroups:t,error:void 0}))}catch(e){yield Bi($a.setSSOState({error:Bg(e)}))}}function*Am({payload:{callback:e,authorizationRoles:t,groups:n}}){try{yield Bi($a.setSSOState({error:void 0,saving:!0})),yield $i(Ip.auth.updateSamlRoles,{roleIds:t}),n&&(yield function*(e){try{yield Wi(e.map((e=>$i(Ip.auth.updateSamlGroup,{id:e.id,roleIds:e.roleIds,group:e.group}))))}catch(e){yield Bi($a.setSSOState({error:Bg(e)}))}}(n)),yield mm(),yield Bi($a.setSSOState({error:void 0,saving:!1})),null==e||e(!0)}catch(t){yield Bi($a.setSSOState({error:Bg(t),saving:!1})),null==e||e(null,t)}}function*bm({payload:{callback:e,id:t}}){try{yield Bi($a.setSSOState({error:void 0,saving:!0})),yield $i(Ip.auth.deleteSamlGroup,{id:t}),yield mm(),yield Bi($a.setSSOState({error:void 0,saving:!1})),null==e||e(!0)}catch(t){yield Bi($a.setSSOState({error:Bg(t),saving:!1})),null==e||e(null,t)}}function*Tm({payload:{group:e,roleIds:t,callback:n}}){try{yield Bi($a.setSSOState({error:void 0,saving:!0})),yield $i(Ip.auth.createSamlGroup,{group:e,roleIds:t}),yield mm(),yield Bi($a.setSSOState({error:void 0,saving:!1})),null==n||n(!0)}catch(e){yield Bi($a.setSSOState({error:Bg(e),saving:!1})),null==n||n(null,e)}}function*Em({payload:e}){const t={code:e.code,redirectUri:e.redirectUri,RelayState:e.state};try{yield Bi($a.setSSOState({loading:!0})),yield $i(Ip.auth.oidcPostLoginV2,t),yield $i(Th),yield Bi($a.setSSOState({loading:!1}))}catch(e){yield Bi($a.setSSOState({loading:!1,error:Bg(e,"Failed to authenticate"),firstLoad:!1}))}}function*Im(){yield jo($a.loadSSOConfigurations,pm),yield jo($a.saveSSOConfigurations,vm),yield jo($a.saveSSOConfigurationsFile,gm),yield jo($a.saveSSOConfigurationsFileWithCallback,Sm),yield jo($a.validateSSODomain,hm),yield jo($a.loadSSOAuthorizationRoles,mm),yield jo($a.updateSSOAuthorizationRoles,Am),yield jo($a.deleteSamlGroup,bm),yield jo($a.createSamlGroup,Tm),yield jo($a.oidcPostlogin,Em)}function*km(){yield Bi($a.setSSOState({loading:!0})),yield It(),yield Bi($a.setSSOState({samlConfiguration:ag,loading:!1,firstLoad:!1}))}function*Om({payload:e}){const t="saving";yield Bi($a.setSSOState({error:void 0,[t]:!0}));const n=x({},yield qi((e=>e.auth.ssoState.samlConfiguration)),{enabled:!0},e[0]);yield Bi($a.setSSOState({samlConfiguration:n,error:void 0,[t]:!1}))}function*Pm({payload:e}){var t,n;const{callback:a,samlVendor:i}=e,o=ii(e,fm),r=rg.samlConfiguration,s=x({},r,o);let l="saving";if((null==s?void 0:s.enabled)!==r.enabled&&(l="loading"),null==s||!s.domain)return void(yield Bi($a.setSSOState({samlConfiguration:x({},r,s)})));yield Bi($a.setSSOState({error:void 0,[l]:!0})),yield It(),s.acsUrl=null==ig||null==(t=ig.configuration)?void 0:t.acsUrl,s.spEntityId=null==ig||null==(n=ig.configuration)?void 0:n.spEntityId;const c=jp(s,["validated","generatedVerification","createdAt","updatedAt"]);(null==r?void 0:r.domain)!==(null==c?void 0:c.domain)&&(c.ssoEndpoint="",c.publicCertificate="",c.signRequest=!1),c.type=null==i?void 0:i.toLowerCase(),yield It(),yield Bi($a.setSSOState({samlConfiguration:c,error:void 0,[l]:!1})),null==a||a(!0)}function*Lm({payload:{callback:e}={}}){const t=rg.samlConfiguration;yield Bi($a.setSSOState({error:void 0,saving:!0})),yield It(),yield Bi($a.setSSOState({samlConfiguration:x({},t,{validated:!0}),error:void 0,saving:!1})),null==e||e(!0)}function*wm(){yield It(),yield Bi($a.setSSOState({authorizationRoles:["1","2","3"],error:void 0}))}function*Dm({payload:{callback:e,authorizationRoles:t}}){yield Bi($a.setSSOState({error:void 0,saving:!0})),yield It(),yield Bi($a.setSSOState({authorizationRoles:t,error:void 0,saving:!1})),null==e||e(!0)}function*Um(){yield jo($a.loadSSOConfigurations,km),yield jo($a.saveSSOConfigurations,Pm),yield jo($a.saveSSOConfigurationsFile,Om),yield jo($a.validateSSODomain,Lm),yield jo($a.loadSSOAuthorizationRoles,wm),yield jo($a.updateSSOAuthorizationRoles,Dm)}const Cm=["callback"],Rm=["callback","ssoConfigId"],_m=["callback","ssoConfigId"],Nm=["callback","ssoConfigId"];function*Mm(){try{return yield $i(Ip.auth.getOidcConfiguration)}catch(e){return null}}function*Fm(){try{return yield $i(Ip.metadata.getSamlMetadata)}catch(e){return null}}function*Gm(){try{yield Bi($a.setSSOLoader({key:Op.LOAD_SSO_CONFIGURATIONS,value:!0}));const[e,t]=yield Wi([$i(Mm),$i(Fm)]),n=yield $i(Ip.auth.getSSOConfigurations);yield Bi($a.setSSOState({ssoConfigurations:n,oidcConfiguration:e,samlMetadata:t}))}catch(e){yield Bi($a.setSSOError({key:Op.LOAD_SSO_CONFIGURATIONS,value:Bg(e)}))}finally{yield Bi($a.setSSOLoader({key:Op.LOAD_SSO_CONFIGURATIONS,value:!1}))}}function*xm({payload:e}){yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION,value:!0}));const{callback:t}=e,n=ii(e,Cm),a=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{var i;const e=yield $i(Ip.auth.createSSOConfiguration,x({},n,{enabled:null!=(i=n.enabled)&&i}));yield Bi($a.setSSOState({ssoConfigurations:[...a,e]})),null==t||t(e)}catch(e){yield Bi($a.setSSOError({key:Op.SAVE_SSO_CONFIGURATION,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION,value:!1}))}}function*Vm({payload:e}){yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{configFile:t,callback:n}=e,a=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield zp(t),i=yield $i(Ip.auth.createSSOConfigurationByMetadata,{metadata:e});yield Bi($a.setSSOState({ssoConfigurations:[...a,i]})),null==n||n(i)}catch(e){yield Bi($a.setSSOError({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:Bg(e)})),null==n||n(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*jm({payload:e}){yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_CONFIGURATION,value:!0}));const{callback:t,ssoConfigId:n}=e,a=ii(e,Rm),i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield $i(Ip.auth.updateSSOConfiguration,n,a),o=i.map((t=>t.id===n?e:t));yield Bi($a.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){yield Bi($a.setSSOError({key:Op.UPDATE_SSO_CONFIGURATION,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_CONFIGURATION,value:!1}))}}function*Bm({payload:e}){yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{callback:t,ssoConfigId:n,configFile:a}=e,i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield zp(a),o=yield $i(Ip.auth.updateSSOConfigurationByMetadata,n,{metadata:e}),r=i.map((e=>e.id===n?o:e));yield Bi($a.setSSOState({ssoConfigurations:r})),null==t||t(o)}catch(e){yield Bi($a.setSSOError({key:Op.UPDATE_SSO_CONFIGURATION,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_CONFIGURATION,value:!1}))}}function*Wm({payload:e}){yield Bi($a.setSSOLoader({key:Op.DELETE_SSO_CONFIGURATION,value:!0}));const{ssoConfigId:t,callback:n}=e,a=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{yield $i(Ip.auth.deleteSSOConfiguration,t),yield Bi($a.setSSOState({ssoConfigurations:a.filter((({id:e})=>e!==t))})),null==n||n(!0)}catch(e){yield Bi($a.setSSOError({key:Op.DELETE_SSO_CONFIGURATION,value:Bg(e)})),null==n||n(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.DELETE_SSO_CONFIGURATION,value:!1}))}}function*zm({payload:e}){const{callback:t,ssoConfigId:n}=e,a=ii(e,_m);yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_DOMAIN,value:!0}));const i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{const e=yield $i(Ip.auth.createSSODomain,n,a),o=i.map((t=>t.id===n?x({},t,{domains:[...t.domains,e]}):t));yield Bi($a.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){yield Bi($a.setSSOError({key:Op.SAVE_SSO_DOMAIN,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_DOMAIN,value:!1}))}}function*$m({payload:e}){const{ssoConfigId:t,domainId:n,callback:a}=e;yield Bi($a.setSSOLoader({key:Op.DELETE_SSO_DOMAIN,value:!0}));const i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{yield $i(Ip.auth.deleteSSODomain,t,n);const e=i.map((e=>e.id===t?x({},e,{domains:e.domains.filter((({id:e})=>e!==n))}):e));yield Bi($a.setSSOState({ssoConfigurations:e})),null==a||a(!0)}catch(e){yield Bi($a.setSSOError({key:Op.DELETE_SSO_DOMAIN,value:Bg(e)})),null==a||a(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.DELETE_SSO_DOMAIN,value:!1}))}}function*Km({payload:e}){const{callback:t,domainId:n,ssoConfigId:a}=e;yield Bi($a.setSSOLoader({key:Op.VALIDATE_SSO_DOMAIN,value:!0}));const i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{yield $i(Ip.auth.validateSSODomain,a,n);const e=i.map((e=>e.id===a?x({},e,{domains:e.domains.map((e=>e.id===n?x({},e,{validated:!0}):e))}):e));yield Bi($a.setSSOState({ssoConfigurations:e})),null==t||t(!0)}catch(e){yield Bi($a.setSSOError({key:Op.VALIDATE_SSO_DOMAIN,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.VALIDATE_SSO_DOMAIN,value:!1}))}}function*Hm({payload:{callback:e,ssoConfigId:t,roleIds:n}}){yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_DEFAULT_ROLES,value:!0}));const a=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{yield $i(Ip.auth.setSSODefaultRoles,t,{roleIds:n});const i=a.map((e=>e.id===t?x({},e,{roleIds:n}):e));yield Bi($a.setSSOState({ssoConfigurations:i})),null==e||e(!0)}catch(t){yield Bi($a.setSSOError({key:Op.UPDATE_SSO_DEFAULT_ROLES,value:Bg(t)})),null==e||e(null,t)}finally{yield Bi($a.setSSOLoader({key:Op.UPDATE_SSO_DEFAULT_ROLES,value:!1}))}}function*qm({payload:{groupsToAdd:e,groupsToDelete:t,ssoConfigId:n,callback:a}}){yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_GROUPS,value:!0}));const i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{yield Wi(t.map((e=>$i(Ip.auth.deleteSSOGroup,n,e)))),yield Wi(e.map((e=>$i(Ip.auth.createSSOGroup,n,e))));const o=yield $i(Ip.auth.getSSOGroups,n),r=i.map((e=>e.id===n?x({},e,{groups:o}):e));yield Bi($a.setSSOState({ssoConfigurations:r})),null==a||a(!0)}catch(e){yield Bi($a.setSSOError({key:Op.SAVE_SSO_GROUPS,value:Bg(e)})),null==a||a(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_GROUPS,value:!1}))}}function*Jm({payload:{ssoConfigId:e,changedGroups:t,callback:n}}){try{yield Wi(t.map((t=>$i(Ip.auth.updateSSOGroup,e,t)))),null==n||n(!0)}catch(e){yield Bi($a.setSSOError({key:Op.SAVE_SSO_GROUPS,value:Bg(e)})),null==n||n(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_GROUPS,value:!1}))}}function*Ym({payload:e}){yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!0}));const{metadataUrl:t,configMetadata:n,ssoConfigId:a,callback:i}=e,o=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{const e={url:t,configMetadata:n};let r,s;a?(r=yield $i(Ip.auth.updateSSOConfigurationByMetadataUrl,a,e),s=o.map((e=>e.id===a?r:e))):(r=yield $i(Ip.auth.createSSOConfigurationByMetadataUrl,e),s=[r,...o]),yield Bi($a.setSSOState({ssoConfigurations:s})),null==i||i(r)}catch(e){null==i||i(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*Xm({payload:e}){yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION,value:!0}));const{callback:t,ssoConfigId:n}=e,a=ii(e,Nm),i=yield qi((e=>e.auth.ssoState.ssoConfigurations));try{let e,o;n?(e=yield $i(Ip.auth.updateSSOConfiguration,n,a),o=i.map((t=>t.id===n?e:t))):(e=yield $i(Ip.auth.createSSOConfiguration,a),o=[e,...i]),yield Bi($a.setSSOState({ssoConfigurations:o})),null==t||t(e)}catch(e){null==t||t(null,e)}finally{yield Bi($a.setSSOLoader({key:Op.SAVE_SSO_CONFIGURATION_BY_METADATA,value:!1}))}}function*Qm(){yield jo($a.loadSSOConfigurationsV2,Gm),yield jo($a.saveSSOConfigurationV2,xm),yield jo($a.saveSSODomain,zm),yield jo($a.deleteSSODomain,$m),yield jo($a.validateSSODomainV2,Km),yield jo($a.updateSSOConfiguration,jm),yield jo($a.deleteSSOConfiguration,Wm),yield jo($a.setSSOGroups,qm),yield jo($a.updateSSOGroups,Jm),yield jo($a.setSSODefaultRoles,Hm),yield jo($a.saveSSOConfigurationByMetadata,Vm),yield jo($a.updateSSOConfigurationByMetadata,Bm),yield jo($a.saveSSOConfigurationByUrl,Ym),yield jo($a.saveSSOConfigurationByData,Xm)}const Zm=["callback","profilePictureUrl"],eA=["callback","profilePictureUrl"];function*tA(){yield Bi($a.setProfileState({loading:!0}));try{const e=yield function(e,t,n){for(var a=arguments.length,i=new Array(a>3?a-3:0),o=3;o<a;o++)i[o-3]=arguments[o];return $i.apply(void 0,[Vo,e,t,n].concat(i))}(3,2e3,Ip.teams.getProfile),t=yield qi((e=>e.auth.user));$a.setUser(x({},t,e)),yield Bi($a.setProfileState({profile:e,loading:!1}))}catch(e){yield Bi($a.setProfileState({loading:!1,error:Bg(e)}))}}function*nA(e){let{payload:{callback:t,profilePictureUrl:n}}=e,a=ii(e.payload,Zm);yield Bi($a.setProfileState({saving:!0,error:null,loading:!0}));try{const e=yield qi((e=>e.auth.profileState.profile));let i=e.profilePictureUrl;if(n!==e.profilePictureUrl&&n&&(n||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)){const e=function(e,t="file"){const n=e.match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);if(null==n)return null;const a=`image/${n[1]}`,i=function(e,t){const n=atob(e),a=[];for(let e=0;e<n.length;e+=512){const t=n.slice(e,e+512),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);a.push(new Uint8Array(i))}return new Blob(a,{type:t})}(n[2],a),o=new FormData;return o.append(t,new File([i],t,{type:a})),o}(n,"image");if(e){i=yield $i(Ip.teams.updateProfileImage,e);const t=Date.now().toString(),n=new URL(i);n.searchParams.set("t",t),i=n.href}}const o=x({},e,a,{profilePictureUrl:i}),r=yield $i(Ip.users.updateUserProfileV2,o),s=yield qi((e=>e.auth.user));yield Bi($a.setUser(x({},s,r))),yield Bi($a.setProfileState({profile:r,saving:!1,loading:!1})),null==t||t(o)}catch(e){yield Bi($a.setProfileState({saving:!1,error:Bg(e),loading:!1})),null==t||t(null,e)}}function*aA({payload:e}){yield Bi($a.setProfileState({loading:!0}));try{var t;yield $i(Ip.teams.changePassword,e),yield Bi($a.setProfileState({loading:!1,error:void 0})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setProfileState({loading:!1,error:Bg(t)})),null==(n=e.callback)||n.call(e,null,t)}}function*iA(){yield Wo($a.loadProfile,tA),yield jo($a.saveProfile,nA),yield jo($a.changePassword,aA)}function*oA(){yield Bi($a.setProfileState({loading:!0})),yield It(),yield Bi($a.setUser(x({},Yp,Jp))),yield Bi($a.setProfileState({loading:!1,profile:Jp}))}function*rA(e){let{payload:{callback:t,profilePictureUrl:n}}=e,a=ii(e.payload,eA);yield Bi($a.setProfileState({saving:!0,error:null}));const i=Xp;let o=i.profile.profilePictureUrl;n!==i.profile.profilePictureUrl&&n&&(n||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)&&(o=n);const r=x({},i.profile,a,{profilePictureUrl:o}),s=Yp;yield It(),yield Bi($a.setUser(x({},s,r))),yield Bi($a.setProfileState({loading:!1,error:null,saving:!1,profile:r})),null==t||t(r)}function*sA({payload:e}){var t;yield Bi($a.setProfileState({loading:!0})),yield It(),yield Bi($a.setProfileState({loading:!1,error:void 0})),null==(t=e.callback)||t.call(e,!0)}function*lA(){yield Wo($a.loadProfile,oA),yield jo($a.saveProfile,rA),yield jo($a.changePassword,sA)}const cA=["callback"],dA=["callback"],uA=["user"],yA=["callback"],fA=["deviceId","callback"],pA=["deviceId","callback"],gA=["callback"],SA=["deviceId"],vA=["deviceId"],hA=["callback"],mA=["deviceId"],AA=["callback"];function*bA(e){const{step:t}=yield qi((e=>e.auth.mfaState));return{step:e.recoveryCode?un.recoveryCode:t,loading:!1,saving:!1,error:void 0,recoveryCode:null==e?void 0:e.recoveryCode}}function*TA(){yield Bi($a.setMfaState({saving:!0}));try{const{qrCode:e}=yield $i(Ip.auth.enrollMfa);yield Bi($a.setMfaState({saving:!1,error:void 0,qrCode:e}))}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)}))}}function*EA(e){let{payload:{callback:t}}=e,n=ii(e.payload,cA);yield Bi($a.setMfaState({saving:!0}));try{const e=yield qi((e=>e.auth.user)),a=yield $i(Ip.auth.verifyMfa,n),i=yield $i(Ip.auth.getMFADevices),o=yield bA(a);yield Bi($a.setMfaState(x({},o,{mfaDevices:i}))),yield Bi($a.setUser(x({},e,{mfaEnrolled:!0}))),null==t||t(o.recoveryCode)}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*IA(e){let{payload:{callback:t}}=e,n=ii(e.payload,dA);yield Bi($a.setMfaState({loading:!0}));try{const e=yield $i(Ip.auth.loginWithMfaV2,n),{user:a}=e,i=ii(e,uA),o={step:un.recoveryCode,loading:!1,saving:!1,error:void 0};null!=a&&a.recoveryCode&&(o.recoveryCode=a.recoveryCode),yield Bi($a.setMfaState(o)),yield Av(x({user:a},i)),null==t||t(o.recoveryCode)}catch(e){yield Bi($a.setMfaState({loading:!1,error:Bg(e)})),null==t||t(null,e)}}function*kA({payload:e}){yield Bi($a.setMfaState({saving:!0}));try{var t;yield $i(Ip.auth.disableMfa,e);const n=yield $i(Ip.auth.getMFADevices);yield Bi($a.setMfaState({saving:!1,error:void 0,mfaDevices:n})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setMfaState({saving:!1,error:Bg(t)})),null==(n=e.callback)||n.call(e,!1,t)}}function*OA({payload:e}){yield Bi($a.setMfaState({saving:!0}));try{var t,n;const a=yield $i(Ip.auth.preEnrollMFAWebAuthn),i=x({},a.options,{challenge:Pt(a.options.challenge),user:x({},a.options.user,{id:Pt(a.options.user.id)}),excludeCredentials:null==(t=a.options.excludeCredentials)?void 0:t.map((e=>x({},e,{id:Pt(e.id)})))});yield Bi($a.setMfaState({saving:!1})),null==(n=e.callback)||n.call(e,{options:i,webauthnToken:a.webauthnToken})}catch(t){var a;yield Bi($a.setMfaState({saving:!1,error:Bg(t)})),null==(a=e.callback)||a.call(e,null,t)}}function*PA(e){let{payload:{callback:t}}=e,n=ii(e.payload,yA);yield Bi($a.setMfaState({saving:!0}));try{const e=Lt(n.publicKey),a=yield $i(Ip.auth.enrollMFAWebAuthn,x({},n,{options:e})),i=yield $i(Ip.auth.getMFADevices),o=yield bA(a);yield Bi($a.setMfaState(x({},o,{mfaDevices:i}))),null==t||t(o.recoveryCode)}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*LA(e){let{payload:{deviceId:t,callback:n}}=e;ii(e.payload,fA),yield Bi($a.setMfaState({saving:!0}));try{var a;const e=yield $i(Ip.auth.preDisableMFAWebAuthn,t),i=x({},e.options,{challenge:Pt(e.options.challenge),allowCredentials:null==(a=e.options.allowCredentials)?void 0:a.map((e=>x({},e,{id:Pt(e.id)})))});yield Bi($a.setMfaState({saving:!1})),null==n||n({options:i,webauthnToken:e.webauthnToken})}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==n||n(null,e)}}function*wA(e){let{payload:{deviceId:t,callback:n}}=e,a=ii(e.payload,pA);yield Bi($a.setMfaState({saving:!0}));try{const e=Lt(a.publicKey);yield $i(Ip.auth.disableMFAWebAuthn,t,x({},a,{options:e}));const i=yield $i(Ip.auth.getMFADevices);yield Bi($a.setMfaState({saving:!1,error:void 0,mfaDevices:i})),null==n||n(!0)}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==n||n(!1,e)}}function*DA({payload:e}){yield Bi($a.setMfaState({saving:!0}));try{var t;const n=yield $i(Ip.auth.preEnrollMFASMS,e);yield Bi($a.setMfaState({saving:!1,error:void 0,otcToken:n.otcToken,phoneNumber:n.phoneNumber})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setMfaState({saving:!1,error:Bg(t)})),null==(n=e.callback)||n.call(e,!1,t)}}function*UA(e){let{payload:{callback:t}}=e,n=ii(e.payload,gA);yield Bi($a.setMfaState({saving:!0}));try{const e=yield $i(Ip.auth.enrollMFASMS,n),a=yield $i(Ip.auth.getMFADevices),i=yield bA(e);yield Bi($a.setMfaState(x({},i,{mfaDevices:a}))),null==t||t(i.recoveryCode)}catch(e){yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*CA(e){let{payload:{deviceId:t}}=e,n=ii(e.payload,SA);yield Bi($a.setMfaState({saving:!0}));try{var a;const e=yield $i(Ip.auth.preDisableMFASMS,t);yield Bi($a.setMfaState({saving:!1,error:void 0,otcToken:e.otcToken,phoneNumber:e.phoneNumber})),null==(a=n.callback)||a.call(n,!0)}catch(e){var i;yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==(i=n.callback)||i.call(n,!1,e)}}function*RA(e){let{payload:{deviceId:t}}=e,n=ii(e.payload,vA);yield Bi($a.setMfaState({saving:!0}));try{var a;yield $i(Ip.auth.disableMFASMS,t,n);const e=yield $i(Ip.auth.getMFADevices);yield Bi($a.setMfaState({saving:!1,error:void 0,mfaDevices:e})),null==(a=n.callback)||a.call(n,!0)}catch(e){var i;yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==(i=n.callback)||i.call(n,!1,e)}}function*_A(){yield Bi($a.setMfaState({loading:!0}));try{yield qi((e=>e.auth.user));const e=yield $i(Ip.auth.getMFADevices);yield Bi($a.setMfaState({loading:!1,error:void 0,mfaDevices:e}))}catch(e){yield Bi($a.setMfaState({loading:!1,error:Bg(e)}))}}function*NA(){yield Bi($a.setMfaState({loading:!0}));try{const e=(yield $i(Ip.auth.getMFAStrategiesConfig)).strategies.filter((({isActive:e})=>e)).map((({strategy:e})=>e));yield Bi($a.setMfaState({loading:!1,error:void 0,mfaStrategies:e}))}catch(e){yield Bi($a.setMfaState({loading:!1,error:Bg(e)}))}}function*MA(){yield jo($a.enrollMfa,TA),yield jo($a.getMFADevices,_A),yield jo($a.getMFAStrategies,NA),yield jo($a.verifyMfa,EA),yield jo($a.disableMfa,kA),yield jo($a.verifyMfaAfterForce,IA),yield jo($a.preDisableMfaSms,CA),yield jo($a.disableMfaSms,RA),yield jo($a.preEnrollMfaSms,DA),yield jo($a.enrollMfaSms,UA),yield jo($a.preEnrollMfaWebAuthn,OA),yield jo($a.enrollMfaWebAuthn,PA),yield jo($a.preDisableMfaWebAuthn,LA),yield jo($a.disableMfaWebAuthn,wA)}function*FA(){yield Bi($a.setMfaState({saving:!0})),yield Bi($a.setMfaState({saving:!1,error:void 0,qrCode:"test"}))}function*GA({payload:{callback:e}}){const{mfaDevices:t={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield qi((e=>e.auth.mfaState));yield Bi($a.setMfaState({saving:!0})),yield It();const n={token:"token",recoveryCode:"recoveryCode"},a={step:un.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:x({},t,{authenticators:[{id:"authenticator-id"}]})};null!=n&&n.recoveryCode&&(a.recoveryCode=n.recoveryCode),yield Bi($a.setMfaState(a)),yield Bi($a.setUser(x({},Yp,{mfaEnrolled:!0}))),null==e||e(a.recoveryCode)}function*xA(e){let{payload:{callback:t}}=e,n=ii(e.payload,hA);yield Bi($a.setMfaState({loading:!0})),yield It();const a=x({},n,{recoveryCode:"recoveryCode"}),i={step:un.recoveryCode,loading:!1,error:void 0,saving:!1};null!=a&&a.recoveryCode&&(i.recoveryCode=a.recoveryCode),yield Bi($a.setMfaState(i)),yield It(),yield Bi($a.setUser(x({},Yp,{mfaEnrolled:!0}))),null==t||t(i.recoveryCode)}function*VA({payload:e}){var t;const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield qi((e=>e.auth.mfaState));yield Bi($a.setMfaState({saving:!0})),yield It(),yield Bi($a.setMfaState({saving:!1,error:void 0,mfaDevices:x({},n,{authenticators:[]})})),yield Bi($a.setUser(x({},Yp))),null==(t=e.callback)||t.call(e,!0)}function*jA(e){let{}=e,t=ii(e.payload,mA);yield Bi($a.setMfaState({saving:!0}));try{var n;yield Bi($a.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"})),null==(n=t.callback)||n.call(t,!0)}catch(e){var a;yield Bi($a.setMfaState({saving:!1,error:Bg(e)})),null==(a=t.callback)||a.call(t,!1,e)}}function*BA({payload:e}){var t;const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield qi((e=>e.auth.mfaState));yield Bi($a.setMfaState({saving:!0})),yield It(),yield Bi($a.setMfaState({loading:!1,error:void 0,mfaDevices:x({},n,{phones:[]})})),yield Bi($a.setUser(x({},Yp))),null==(t=e.callback)||t.call(e,!0)}function*WA({payload:e}){var t;yield Bi($a.setMfaState({saving:!0})),yield It(),yield Bi($a.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"})),null==(t=e.callback)||t.call(e,!0)}function*zA(e){let{payload:{callback:t}}=e;ii(e.payload,AA);const{mfaDevices:n={webauthn:[],phones:[],authenticators:[],emails:[]}}=yield qi((e=>e.auth.mfaState));yield Bi($a.setMfaState({saving:!0})),yield It();const a={token:"token",recoveryCode:"recoveryCode"},i={step:un.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:x({},n,{phones:[{id:"phone-id",phoneNumber:"+972504589346"}]})};null!=a&&a.recoveryCode&&(i.recoveryCode=a.recoveryCode),yield Bi($a.setMfaState(i)),yield Bi($a.setUser(x({},Yp,{mfaEnrolled:!0}))),null==t||t(i.recoveryCode)}function*$A(){yield jo($a.enrollMfa,FA),yield jo($a.verifyMfa,GA),yield jo($a.disableMfa,VA),yield jo($a.verifyMfaAfterForce,xA),yield jo($a.preDisableMfaSms,jA),yield jo($a.disableMfaSms,BA),yield jo($a.preEnrollMfaSms,WA),yield jo($a.enrollMfaSms,zA)}const KA=["callback"];function*HA({payload:e}){yield Bi($a.setForgotPasswordState({loading:!0}));try{var t;yield $i(Ip.auth.forgotPassword,e),yield Bi($a.setForgotPasswordState({loading:!1,error:void 0,step:Yt.success})),null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setForgotPasswordState({loading:!1,error:Bg(t,"Unknown error occurred")})),null==(n=e.callback)||n.call(e,!1,t)}}function*qA(e){let{payload:{callback:t}}=e,n=ii(e.payload,KA);yield Bi($a.setForgotPasswordState({loading:!0}));try{yield $i(Ip.auth.resetPassword,n),yield Bi($a.setForgotPasswordState({loading:!1,error:void 0,step:Yt.success})),null==t||t(!0)}catch(e){yield Bi($a.setForgotPasswordState({loading:!1,error:Bg(e)})),null==t||t(!1,e)}}function*JA({payload:e}){yield Bi($a.setForgotPasswordState({loading:!0}));try{const t=yield $i(Ip.auth.loadPasswordConfig,e);yield Bi($a.setForgotPasswordState({loading:!1,passwordConfig:t}))}catch(e){yield Bi($a.setForgotPasswordState({loading:!1,error:Bg(e)}))}}function*YA(){yield Wo($a.forgotPassword,HA),yield Wo($a.resetPassword,qA),yield Wo($a.loadPasswordConfig,JA)}let XA;!function(e){e.USERS="USERS",e.STATS="STATS",e.UPDATE_USER="UPDATE_USER",e.DELETE_USER="DELETE_USER",e.RESEND_ACTIVATE_LINK="RESEND_ACTIVATE_LINK",e.RESEND_INVITATION_LINK="RESEND_INVITATION_LINK",e.ROLES_AND_PERMISSIONS="ROLES_AND_PERMISSIONS",e.CREATE_TOKEN_LINK="CREATE_TOKEN_LINK",e.GET_TOKEN_LINK="GET_TOKEN_LINK",e.UPDATE_TOKEN_LINK="UPDATE_TOKEN_LINK",e.DELETE_TOKEN_LINK="DELETE_TOKEN_LINK",e.CONFIG_TOKEN_LINK="CONFIG_TOKEN_LINK",e.CONFIG_TEMPORARY_USERS="CONFIG_TEMPORARY_USERS",e.UPDATE_USER_EXPIRATION_TIME="UPDATE_USER_EXPIRATION_TIME"}(XA||(XA={}));const QA=["callback","events"],ZA=["user"],eb=["callback"],tb=["callback"];function*nb({payload:{userId:e,token:t}}){yield Bi($a.setActivateState({loading:!0,step:Bt.activating}));try{const{isAuthenticated:n}=yield qi((e=>e.auth));n&&(yield Bi($a.silentLogout()));const a=yield $i(Ip.auth.getActivateAccountStrategy,{userId:e,token:t});yield Bi($a.setActivateStrategyState({strategy:a,loading:!1,error:void 0})),a.shouldSetPassword&&(yield Bi($a.setActivateState({loading:!1,step:Bt.activatingForm})))}catch(e){yield Bi($a.setActivateState({loading:!1,error:Bg(e)}))}}function*ab(e){let{payload:{callback:t,events:n}}=e,a=ii(e.payload,QA);yield Bi($a.setActivateState({loading:!0}));try{const e=zo.onRedirectTo,{routes:o}=yield qi((e=>e.auth)),r=yield $i(Ip.auth.activateAccountV2,a),{user:s}=r,l=ii(r,ZA);if(s.redirectLocation)return void(window.location.href=s.redirectLocation);if(Gg(s)){yield Bi($a.setActivateState({step:Bt.success}));const t=yield jg(s);yield Bi($a.setState(t)),yield Ji(1e3),e(o.loginUrl,{preserveQueryParams:!0})}else{var i;yield Bi($a.setActivateState({step:Bt.success}));const e={email:s.email,origin:Ug.ACTIVATION_LINK,id:s.id,tenantId:s.tenantId,name:s.name,createdAt:new Date};null==n||null==(i=n.userVerified)||i.call(n,e),zg(Wg.USER_VERIFIED,e),yield $i(Av,x({user:s},l),{isAuthenticated:!0}),yield Ji(1e3),yield Lv(),yield Bi($a.resetActivateState())}null==t||t(!0)}catch(e){yield Bi($a.setActivateState({loading:!1,error:Bg(e)}))}}function*ib({payload:e}){const{callback:t}=e,n=ii(e,eb);yield Bi($a.setActivateStrategyState({loading:!0}));try{const e=yield $i(Ip.auth.getActivateAccountStrategy,n);yield Bi($a.setActivateStrategyState({strategy:e,loading:!1,error:void 0})),null==t||t(e)}catch(e){yield Bi($a.setActivateStrategyState({loading:!1,error:Bg(e)}))}}function*ob({payload:e}){const{callback:t}=e,n=ii(e,tb);yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:n.email})),yield Bi($a.setActivateState({loading:!0}));try{yield $i(Ip.auth.resendActivationEmail,n),yield Bi($a.setActivateState({loading:!1,error:void 0,resentEmail:!0})),null==t||t(!0)}catch(e){yield Bi($a.setActivateState({loading:!1,error:Bg(e)})),yield Bi($a.setTeamError({key:XA.RESEND_ACTIVATE_LINK,value:Bg(e)})),null==t||t(null,e)}yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:!1}))}function*rb(){yield Wo($a.activateAccount,ab),yield Wo($a.preActivateAccount,nb),yield Wo($a.getActivateAccountStrategy,ib),yield Wo($a.resendActivationEmail,ob)}function*sb({payload:e}){if(e.token&&e.userId)try{yield Bi($a.setAcceptInvitationState({error:void 0,step:Kt.pending})),yield $i(Ip.auth.acceptInvitation,e),yield Bi($a.setState({isAuthenticated:!1,user:null,acceptInvitationState:{error:void 0,step:Kt.success}}))}catch(e){yield Bi($a.setAcceptInvitationState({step:Kt.failed,error:Bg(e)}))}else yield Bi($a.setAcceptInvitationState({error:void 0,step:Kt.invalid}))}function*lb(){yield Wo($a.acceptInvitation,sb)}var cb,db=new Uint8Array(16);function ub(){if(!cb&&!(cb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cb(db)}const yb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,fb=function(e){return"string"==typeof e&&yb.test(e)};for(var pb=[],gb=0;gb<256;++gb)pb.push((gb+256).toString(16).substr(1));const Sb=function(e,t,n){var a=(e=e||{}).random||(e.rng||ub)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=a[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(pb[e[t+0]]+pb[e[t+1]]+pb[e[t+2]]+pb[e[t+3]]+"-"+pb[e[t+4]]+pb[e[t+5]]+"-"+pb[e[t+6]]+pb[e[t+7]]+"-"+pb[e[t+8]]+pb[e[t+9]]+"-"+pb[e[t+10]]+pb[e[t+11]]+pb[e[t+12]]+pb[e[t+13]]+pb[e[t+14]]+pb[e[t+15]]).toLowerCase();if(!fb(n))throw TypeError("Stringified UUID is invalid");return n}(a)};let vb,hb;!function(e){e.CREATE_GROUP="CREATE_GROUP",e.GET_GROUP="GET_GROUP",e.GET_GROUPS="GET_GROUPS",e.DELETE_GROUP="DELETE_GROUP",e.UPDATE_GROUP="UPDATE_GROUP",e.ADD_USERS_TO_GROUP="ADD_USERS_TO_GROUP",e.DELETE_USERS_FROM_GROUP="DELETE_USERS_FROM_GROUP",e.ADD_ROLES_TO_GROUP="ADD_ROLES_TO_GROUP",e.DELETE_ROLES_FROM_GROUP="DELETE_ROLES_FROM_GROUP",e.GET_GROUP_CONFIGURATION="GET_GROUP_CONFIGURATION",e.UPDATE_GROUP_CONFIGURATION="UPDATE_GROUP_CONFIGURATION",e.GET_TEAM_USERS="GET_TEAM_USERS"}(vb||(vb={})),function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"}(hb||(hb={}));const mb=[{id:"3",appURL:"https://www.idf.il/",name:"Intelligence forces",logoURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAA81BMVEX///8AlioAkRcAjQCjzqmmz6wAlSYAjAAAmCoAlCMAkx8Akx0AkRQAmSoAjwAAkA7h4eHw+PKoqKi5ubmzs7MAegBxuX75/frw8PCjo6OXl5es1LOtra3G4svk8ufb7d8AZQCLxJXR0dEAgQDr6+s2o0y527+CwI1Pq2Dd2NzExMTU6dhBplRXrmf79/qRkZEjnT1ltHMNaiIAaABvuHzL5NDMzMxOdlQAcwAAXwAZmzfDv8OYy6GIw5J4lnwAaBEnbTM6dENRgVhiiGhwh3N8i35aeF4iYS0vYzdhd2QWaieJnIyZopseZitAa0dygXR/iIHUu4ZkAAAYwUlEQVR4nNVdCV/bxtO2JSPLlmzFXDYBbMBgE44GEqCEwL9Jc/RK0vf7f5p3D620x+xpO0mf/tqCbSw92tm5dna20Vg5jo82NvfQP5t7e3ubG//77dXf797//uHjP1823744Xv3lV4nR0eb6+t7m3fEv3ItreQ+jk2VZHk3vD959+LLx4hftd/y8OFpfX994BryxFjVrpGna62b51uv3n/ZefPd7DAdmB5EjEBhWRHuI5psPO/8FlqONnT0tOwyIYUkTsfzt48ZPLbHH6ztnthvUMmQsX/+6N/oud+uN0d7OmcPHjAwJyw4iufnzjeTZzobbB60MMclefvDxbrU37IfRzo6zYXNhiElm0687P8tAPnMdPgLCMHHhiAby08+gXO+eH7l+dID/QxieuFDEA3n/2fnbV4Sz50bTIGC4i/+LGXafHtwoIo5b337khLx77uNXXpL/kjHsnPfdGGJhnX77UeN45DF+CNtkCCnD6HG/7UoRcdz6/CPm47H7/CPYTej/qS7tDw8LZ4p4Pv773fWql/5EOJ/u0x8ow2y7ce1mNhjHg53lkzDgzPdyg+Ki/Km0h+1x46TrQbHZy79+P5Uzeuk1ATEe2uflTyXDzmVj2HVUqIzj1vcS1Y097z85LS7Zj8ynic8bY2eFSpFmb94ulQmM0Uv/zMN2Ho/Zz4xhB4ntfuxHsdmb/rXyYQwYwEarjxQLQ+WX9pHqefSluPph9DOBFLftZjyofqsYJlfotxsfhUqHcev/lkdHwbPnAX80LprRU/1rHVsUM/TrhZdCJcOY/7myDN2Gpw0kGDaTJB/Wv9cMkyZ925dis3ewIkkNkVAySPkj9zsXH+Yt9Pu4H0Bx6+VyKAkYhX0pmmhJwr/AR8AZHltvhYqQFp+XrlODpiBVlsUu/wrPMDrEr7Q8zSKhmP2x5Ml4txn0ZziCSB6El4QsRp9M0O3cn2Kz92ap8caGSxZNBXFa4n3hNYFhNievXWQhFF8vUd+sh4WgwwQpkc6J+OKjMGB94usMHzohFO8DvA8YO0FKtNE4wffdPxdeG7SEHE33mr4aIqdIpYYpBwVeqQoOJADsnIovHrZ2BTbxhLx87h7yc0inS7EaLwNz7I8kiG9PxFeRDRRUJ3sCuwE2A1NcggsXSnBGbrmUwvrVdqsxF/RKfEvfmXtkNTiK7YUpPg8kOKEj1R+IL18UrcZYGK5KE12GKNTFBdU9Wy9ikBF9UlqDCuN+hDy1U0FzxrPyzSCFiigupG70C50WXNG7LYbiy9sZZrgvCGTlEZRPxZvi1gJGYyM0FVtKHPXKagxRIIW9bTHjXXl150HaBtnFYNN/F+bJNBpP5SDl0uutnDJsiXFvl70/C7IZyLsJdOCehfmitebP16Q3UCxIGA5FX7uOrnzSxDzFN0HqYhQ6g5mwkQiXB55/hCGajyLFarp6pYk5in+EBFOhWniQl7OsmEnvYB1KGU7EGcdlOU6CFGoz+8v/RoN1MFP6JNPEg9hByrBxIRKpzaZvmrhEWngPCFjt44JTllrq70vvEF+mZDgTJ1x2U31qEhAPY4pbngr1WUjSidBgfnXnQn6LvFMybCTiULWrjHHp7nmjd+CnbUJldK26vVhyuRu7AsNHyWBc1h/0ThOXFP/0udFQLXNbGTT+limomWcMhxKNmAsjAxVq7uGEh07CcT276oWKErd0fjGGjWsxFSwItd+6G4PHVBwFOnpcdpdbqChx2RUZyi4ar5hC0sRNbPhdrWKojHIZ+liKmhqDUkVWDGXLJxiXcVxEUdbx5elqFTd9XaDhYLI/ax2e1o4Kv1BBcRjJDCWDIToIk9na4fblRSeO+0WRI7JObNOpk5w6yuhwfL6/+zi/Pn3os7uoL5UP5Y8z5VEzbEgRr+LkEQzGt/tr6DIXD1l5ma6BrJucmmR0MD6f7ZLr5abrCQsVBLtswDiGh5LKzFvyX4kon+nN6VWn34/hi2f/2gmeKXqUyuD25Ukz7/eL3C4z4kIFwRX7A47hQI6VIvvdKfcUtQWy6Za9nIFWWQzxYOFvSNvTaZsADxrihxERZBRdhA5GQtCUFyow6hIojqFsMJSA2Q3DAZ0uFw9ETr+6EWwMhwOG8XgymZyfn9/e7u/PZrNdhLW11uPj4eHTfD7f3t6+ub68PL24OEG4enhoJtmD8q01F57hreyCIgd8iEGuOiZX5S4LXpVeFuHh4YHKuqUQ5jjUHzViUFPhGdayy8Q7ypGc9CniOC5KSJLTBSWnRO/ArGyWlCaXwOkUgeFuUDLfArOyOVpNFSBnRwSGjTzIdzEjvTdlbVYzhLxtFxnOg7LAFmSf9beiWoql4EQ7huOw5JoZ6ZZeElczhEJSRmTYuAxLy5jR+6a7lbPV1Kls82ZPYhhSpmBFOtWZ/dUMoZgclRg2XAu+vaAbxLvVzEIxXyEzbK3CYKRbsDpdzRA2xGhWZjgMy3JbAKvTF6uxheJCk8JwNQYjvYfksfbn5BTLQpByvwrD8RJ1TeeK/ZR9Uu9kVHuk50ukKBNQGErrpYsguaiMTwp4p7xLrqSRwiGtwQAM95c2E/uc8wSEGPwru/KyWDAURaIybIQl1lTkj4f141TjRNHaywUGwVCMAcDwMSwBLCO5anCPU7X64qA+KosOgVAMOsBQTn8HIh4LwVj2UbzKSIx8B1MlEREE1SkDGCpzNQj5oRhQy7pGziDetJcip6qehBhOljCIyUPjVvyaXFyklzXPeVuqRwsCEBxBDGWbGYJ4wtYNGDq/8pc4VqouTuIlyCngr4AM5fS3P5CMypY3fc2L6Tpw0WJxOQW8apBhY1F7gRc9nuTHmfNTD8jARdnCcgolmmCGixoMXAGpyEGXE9MRUBp0GC0sp3KyUM9wELZ4z4BkFHicvJhCpUGDuLmgnCoJXz1DJf3tBbIwp24PT4t6JQpME193u4vJ6SV01xqG7jufAeCSAegLOKMPrqehv1lITpWFFxNDYAicgWUUFILeK/btR3D6Ak0jZSnXA/LimZlhuMEgMgpO5DqZodoKAjR35Tp0H8DqUcewEWz0SVkL/DirEErDEOvfcDnVzCwtw+tAikRG5fXkEtmH8st1y9rYJQnXpxE4s7QMhUFwZ0sLHDQy3ntDv1szDWkGwkdOxSoo2ADoGN7y95idOkcbdLeDpqKRTUSdkNKcu7ucDsR4BF460zHkJ1LnxLkIk8qottqvdNz0DEl45yyn17mwxQlOorlYi/5YjoR0KItwbnRDXqbc9AxJiO4qpyjKK4QaDDBhr2E45IwnkRq3DBwtDxxq3YXee/z+yLCwTdIsjnKKXRhhDxCY69UwnNUiTT0pp6iYyqjBb6eBvlbRYJCn45SXInVqwm5KME2oYcglMqJh9cAsYIViidYfoqrGWJFPxsFJTmmcHnGpVlB4NAzT6gNsQ6bD4mlZwmpyh3IsoIZpyNSFg5zu98UbxIDmEsywVob1I7Lmp0oZNeZAsi82huVd2vVpXfRUl7S1gPkBM6w+yRW32WJGJqPG/iFd7NWYC/XoZFKLtiXUksIVB0NmCmZYjTZfKjw3B/5MqxnHuveuYZmHLOduk1POMnAfdY7x2fPJ+bov89Ii+6j5U+lBo3FsKXUrVbFZTnf5y9Sqd1vVhyBDpnWlXdGm7E2HFdyaF5HT++PGkaU8ocy5m/WpICj1fc7Uq4MMWZpMNksGhlUduXldJ52+aFj7hZZybpJTcQd6LWtAmA8yLGVcuYR+fKoKVtvaXPTWNg1r70Jv94dy8Va110LNTUAMB/QK6gYG7QDVReE27y7ftKhSjNLe6PNST7I0Va6NGnpDDMsoJFNKp7XGvHqE1jVyZBDtmwzZZdTCWArAcDG7favcIcSQRpKxvE8KA0q58lXW1jqH7B+HMaxSKBp9ChkkdrvKRIIYZvxDEbEPmfNOvXHBWo2TfXQYw0prd0G7DzuQOv8ZYKj67BygULjeBmYvUO18cGE4YMIOyimcrSjVhnILulXu+Fx5nQAIhbmdAPaasd7vLlJakwDkVBfIUdWvOI0AQ6zJcm0Ru6IsORkF1w0khu+dGFaZQUCfatU1tcnyU1YZ4iBLbvHCQXmC3J4xh9pN5Jg6bdiu7Foh16Ho99DTu5aVHVxP0zfUKEmzgJNRlxWr3t9uDGu/U7b7hqQYkTzZ51AZomdg9OtFTcbJqCbRLTF81XDbflCNhBRHgdqcAWsPuZREZZgmgDPDQ7BG/L5Gl6SqM8O62kiUU9gilyDhrLVyr88HzRB4YYy4bN6uy2KOM8Pz6tuSDveyZcUIW3EpBFIYruWgM8OD8wr5TXEOuSrC0K01RD3dWcccAltJGrp5KdBXGF4W1jrBYW1UuW3tLrbCnWEtKBHfcWbN6lIgAbRIaaFxZnhw0VnM7cN0WVVFutRpP2Wl80Xnyq7LkAG9EYRJZng7lXe1Q+B0CienLquqyB66MKxzIcIue3GKZeCAxrv7wusyw7nTjry1mgvvdDjUbSKfxkVKKyqGTFE8h5shFOdGhpqgcy51DYEzXQ6F/sgvdWHIhER0rvjAt1sghdiCKHZOhekiMRzDMtqKY1H/8ALJFRfYxRTFFg5SWgUIQhsB3kwVp2R2gB3JOsbdCCBwr6HoQSDPGV7uOdu9Grf4kIlIIdxd7WokcdUowXpFF4Y0Ykpifq2Od57qRTz9ulrF0CXGZ66lGFjU7iL/tK1tgR0YVhFXKRkUvANcy5J1ccMpT1P6XYkYHFY+gDhjriwU7Qy5pmbdvHZ3+CCmTrVZm57nm/Z8KQsO+4J6Y2FbJxK1nq2lhZWh2OmTe3y8k5ZXfoetIC56a815s2/OxA6IZeBbXMhR/7gwUrQylPqaRFdMIoVQuGrTb+nxhnPetnWLcr4lHSEAgJQBuxOj4NgYXiq51zbU7yVJ2R+YK6jT+5F17Ykl9cUAgMx7SaEzGHdNWhhCLYWZwhHWCCLmgpv3aOK1J4syLa2elM3EX5vEN5q/MfUiNTM8BP+yG9HHK4bC7JEbQ1RSjGFeA6aOi9x3BH1rV2nHZrtRO8Nd3dp9TDTLQPha5oIbA2FS2WZmSKVGamuFvlRVMTz0/atNDA0CRxWO4MJUuQ99KUa5jm+ch9S3lbOZzU4bUDE8FIXhwNCoojr9NXmRi7ngULkAA6nFMNbTEEUlZzNb7aY1qNM1s9IztJiZZowUjtQquxQj/ZOh9TSmmijq0st9u9o6FcND01FWy9De/aqb3YoJA5b3U1b3aoZ085NhIhI9VchBq1MVmKajrJbhlT1/ncRPM4FM6YLrM8O0rs1Wm6is4DvuoYVdRh1Dt8bz0Yn4eyldWv/bWpuI/YUkuEoYrKDU7bdw3DQjyUWZAdeuBJf717SqhniCfb3ZswFqmgsz5ELnxGszYk7bpmlSp1Wxvm4QsSOYmTPuKit+xIGTK0CGVfojifonllIoCdQF15TNszpvHUPscyddc8ZdxqAdX6zVJNW0BsSwHOskiq8ex56bS0pvC14gqloraBjiJKk14y4BzflO3j/dZc9FmV8AQzJfk6zfPKRW1rjao4B6zHDqtNpvAU9EnAOBywf0KN3/Tt6+nFGSclpDZYh1LqL3VC9z++0QooMArXdzDUDA8OIx0jT6M6BW22gkKUkpraEwHGRRnMyFVXy/QaRLV1DNQr3vCd67lunLB3QQTWC3KK5n8tNVept0i/mt/D1+DaGpMgRUMLd3DTpBeS03lA9ooOwK6Bb97V0jw0NoojutKtXoYydLLWTk9x9Ce0ibSUduV20DaHi7lvVDEJ5dvbFToqZOha3Oqpgi5dT2bXGi3djhzdBzJhIXXCkA4/cBA/biJJEdbiucWpO5MfQexJacAWhKe7mV/fi3fbjEy4Qbl1VnR4aeM5GUq0ipU3E/viKmp11vh9vtzE1Hhr5tFrDOkGqLBCFVLOIk9ne46yFE3uWDbkoaGIoJWc9BxC64WJ4l9cWQAv2bwtPh5hRp1n9A3qUuUaNnOGmfcB6td68M5IILT0XpoySI6aAN1OtaQGdBt8jm1Ls89dwHPCkS7NFWouM7iLjCgE+dyv1pxB5D87anw00Vaacobuo/hCnqGE5icneI5E3p4vgOIvKhOf8b6CzIDeKw7d8K6zrCjqjwEkhRw5BLtHWLDhED30HELnidAwD6CXMMHz2aMpeYTIVJRHHhvO9pLFb7Z30cKHq3Ocu4Ah+g1xena9qeDjfCDPR/gPQSyHCs9KJNovYFsOPGwvCyqvBJodblFem1ufpmIFSKEMMxuLG9498MpD9j/jfUc6/um6iv1/WHkvoGGI7DzuoCkOSl2wH3TWS9L3ddyrDcKVprhAMPIwPRvaRloppWwmX/0uX0MdNRVGN87zMeTIjmWD3p+pfSQVxWt70KV8bKvUGy5E7CuP1l71f4VlbVR1igKDEceLTAcIa+j/CqGgnzFEWGKyFo6AW9qk7CQ25dSWC4GoKmft6raiWsPTlgkf5XWph6sq+qr355rqzMsLWSLsnmvvqrGkT4jBLVtc6LftyOCdgREIVwBETEHR5CDoDoVidAVENoPoiFnW8xJGdo4LM78PEd5Ska5CCNFjlG4/DpaT7fvrm+xudonJ5e4MM7mmmG7rAdtzP1e6sMA8dQXRLrs7foASLkDvAZHujy9BiPtRa+PLoBfHVyeXJ9epAHPcHDdr5FdUbJYHJbHi7T505hkU5gYadoSE9RObuyUbcPqBmqGUP1AB4XsCNnLtzOKAEz/GN2bE1Oj62JMsshhcAgNkrXpWaolsF0gD8zszppRtLhPvZzZiwnQAzGaGgft6/pV+uOQ4qAwZhJ566pC6G6fcYM+EE/Pt2cXhVtTAt80C5nBTmfSTZkZz9dlWdNcdNKPgcYgx79yBhOlPQxuE+WnZtVXcR4oJXbeU8h58oNyePlVkPls5wxqOpkDNWkNr8bpnEuCErXTKuG49lyG6HuKXeyNtSGmJi/kqFqChM+LJ208WiZCtZAOJ67Fn52Hlf1I5+pTt9OGMOBauv5HWOhIaPzibKh5x/yd6Yc0tmgc48yVE2hUJfkUB8Fwf38w/CDZOulA7DHBNKfhCFQZsk/kbBz5P2Okw123uq9T7Gydt3ARpEwVCcYL9XgzhsH+JxDugDF6mRtcAP6rI8ZAjVB3GqsqYbaBL+zZMPPA64raMBSnMu4BfUo4KxL4BHy3ucBh0/FKoGonFqNMWi3oPXderES0LJO8D7TeQE5HTLrDHphjy2g8pw7+FBTeGsl6H8u9wJWkdVrA0dZYopQ4Uvl5Lk3LpW+IeBs9cYvwaO4X/qcYDQE7I6uDyDV1/ib0fvD2RLyeBZq+KuTtQuIoaJI67FeC+zq3XsT6GjeAYVEbrihNNRjgSGG1daU28CT9HqvjZkZEzaCE1NlSSLQH0xhWOnccaAa7d17q9Ea66E2o9xb0FUXkxWG1YHcgWcGpVvBswljJzSSKgdEOWJdYVg1S7FusNUQnC6YH3w+CvxD6l2rjVlkhqzC8yZMjabTYKvGEEyRlrErJaoSw84l/2l/gm0vdxtGMEVi3JTOpxLDUoz3w9RoOl0CQUQxdC6SVfy+5ICLDDOqigIP0FuCiFLshGpU7GTKDrjIkJqTYRqkRntbS1uEWA+0iyRQkPaaCgxLl0C3lc9C8H4hMyFiI9C7wVsppIJ/gSHNq7puepIIvl7A0Ku4C3xcazHvWJNXODrUNX8M8mV6b4JdNRjPAkV+nkvLGBxD2lQL2v9lRZr9sfSig18C1RaK+IRlDI4hCZGDjpVLi89B4ZIFz8NU6lVHWMaoGZKFiqBymt7WkqyEjI2g9NQgSvhljJohWagISf72DpaqY3iETcbzmG98VDEkCxXaXe16pPmfq6n7oQiS1N2YS/hWDHHK+NBfjfa2luKo6bERYjaeijppzxjihQr/5G+avVmZhDKMXgbIyGVRLWMwhoizf/K3N/1rFTpURsgwXrXZMkbJEMntQKkM/gkGkGL00ns2DiK2jFEybA+81Whv69/vMYAUZ9aSDhmTaemAU4bIfngmf3v5V4cihCVix9c2znL6f8qw8FxDS7MD74e6KI6fe4ZUT9QBJwyjFtxkUcvv/jsKaI0jT+NIbSIdQ5/tImlv6/OS4whn3PklOMhaFGbYfUrtxCp+028rqph0wpnPOBLXjYyhsXuVKJ9b376vglFx5zkf1XULE7/7zz9y/BieeelVZ4ZpLz/49KPmn4zRjnv235Fhmk2/7vwI/anFmetAujDEw/fxR08/FaO9HZeMnJVh2slf/wp1efgZcLy+c2a7NSPDNM0Qvb2flB7FaGNnz2hAtAzTXpZvvfr49qemV+JofV2/tAoxTAm7Nx92fhbV6QLMEqw6EhimiFsXkXv9/tPef4kdw+hoc319b/PumBe8tbyH0cmyLI+m9wfvPnzZePFfkEwDjo82NvfQP5t76N+N//326u9373//8PGfL5tvX6wya1bi/wHu6fK8C+0A9QAAAABJRU5ErkJggg=="},{id:"5",appURL:"https://www.att.com/",name:"AT&T",logoURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAjVBMVEX///8An9sAndsAnNwAnd4An98Am9wAn+D0+/0Ao+D5/f7v+fwAoeAApeHp9vv7/v7d8fmT0/LV7vjL6PZ0yfHa8PnJ6PbC5fW03/Or2/Hk9Pplv+iY0+694/Sj2PF7x+sbreU/s+VVuudfvehKtuaGzOwvruNowucVp99NuOQAneN0yfKGz+s/s+MAq+iovANsAAAReklEQVR4nO1dZ5ubPJSNJWHAdLDpvQ3Ju8n//3mLsD0GTBF9dh+fD8mMx4VjCenec4t+/frggw8++OCDDz744IMP/h/hIsqq9oQqi8zRF7QaGNVzgyQvBB5AiqIxKAoCXijyJHA99f80U9FQnFCACABw6kL5OEJsmGSGffSlzoBsOTkPYTe1FlGIToXjy0df8gRw3rVAiIRcnSZVfHnc0ZdOAtGKWQgnsXsCIja2xKMJDIMxY4poZg4MZWr+3MVHu7IT52YnScRetaOpdEGy8hXoPUlGlnQ0oRbETFiN352jkP2kO9IO2HlryxAgG/yUbdL+otbnV3Gkgp8wjlzArjk9mwB8dvjC6grbjN8TUHAP5WeE2/LDQLlxGD/OobaboC8AKjnImjM3WEC7AVnzCIIB2okfxlnZnZ+U7jWAD4r+3gzjfQmeTvzO24a15xStAHdeUaM9FtEG0L7+BiPsTfDE7jtLL7szhMFe3Dyv+i/eeZYCYa8htJwH0Z1XGkr9voSLtyVBV7g8ftp1twCsXrsIZ8OtMfvz/f1xxX7zFIYNLdX6s5m7EZzz1y/iDm5FBQCDpmbjg61suABCq/Yrk5734Iei9kZ4hSeYbUPwxDa9GJ/feqYClL95FdVejDagGJxPIG09Jjo9MZe1+EUdXpNb3R3n1Slm5fYA3nddNUEb3Y4AsV9qx4WI7P3v55WXGx/fc7BrmbaDdZXSOz3Ix1b3Hv9tEZ+tzr/PhEmd+hiWW7AZ8yuSBPA8EKBxXlMGrbj1q3z1lrB3YnCmUywLyTzZUXye6f0WWlC/J/iuWTwLz6nfcR++cNHcuIBw9tIDIIRCmhmDGrDT3KCElQRjKX9cNYhHnnm5WUEuQAT74tqd1EpuNCjSzJQvw2/PRK1VDeQjryDEa+oXJAGhi+y5QZoLFI1HtI8q/guEFMWGkaNYKslgaMLbe8FkKTkM/zUzqAkTn7FVz3cDJ47yomDvlMCdcVHkUeoEim9qNrkSmnVtS2sIVDJf+8rmbrMMw4gPcMwsT0/Nu/ddfnmCQ1qfGsI6834ymKBPXR9dG0ZhNFzd/v1iU1gD4R+kj79+EC25gj0goGfmQ4ICWLrYhE2GyyfFVHjtLaKNpSJc3pr/axu8w7hY4ag9SC8UUt9ENbRfGMhWCgLBCy20wJW3OULtRFFPyNIDlq5+6vu3iHaYqHJWkLori9f3jggFSrbdFm0/mhBc7vHpyGF03ApQ2E6Vld2ILGnzCXrphtgt4MP4tgadFhgjyKmp/he/eIvm2K73BVSymv9Z4aK6v9lpo3e/kGj5Z+tU91uj1fIkOd2NhRnsMNAaGr/ZI/0CJDjeQpKM5n/l7HxpYKW4otU9ihVJNnZn5dtLnGoqCc4FX6TvwG+BfxlTY0DdBpAS0sBSSX1ZRtRMN4hzllowct8fXnxvXMG0tCK39XR5OA4DAKL4InUy39Tl0sm9SE+9Q5IkhuFE+6Z7lp+VHn/B89N0nEHUovvxpJ1f+t1+5PI1biJW0gukeJYtsFCBkZc/CSzP8xSEQ7LNXIK1IFQkTGFodcgV5rsQNEJ3dUJtwK/aELDnKQZz2PXkfinhIDSUtnJPm7Azan+6d3M1Pf8gjmenfm1XcKLJbRAH9T3XyFfQ7tdBMxCMdXnw1XPVb+BYut/q9KL1Q00zANim8R/gi2JJNwwLDioDWrxR5voEoLRpb9/o6lFSdz8CcPipE/zTTQDZtjF6l5NIrXCbOoExcftippPdnLUAaKftMD2DbhSZAq4Aoi9DdKMjSALq3TX1n3cNIEtDwboFT1SuUvrj9L5ra6db+vJ9yKapjB0JQGrk2VYsoJ2GEkChq1DIol9PoUikB7e63JCQ4S+sPWQ5vzlLAOi0M3nBrRvMRCNzF9cm6qyiF5Su3mYsAaRzpfvGuTZ2LpJpyt293ZrjRQrOy+Ji/cEsHRY27auDtttRDYKEd/PxktENoxMX2cxSgUIrDSeAiI0yo/eqzbeqMjSe8P71fM2CwJxtuNdI4KneSnwSbhDxYeIOZJ784pJ3AYlgv3gFm4Rl1UYXWzczp/TpKUSRO/XYi0aILdLAN8ThxAiry2EdDyeKr7A9iNaoxZUYWTfdwEnz4h9LQZouvX1wd/cfwN4/pGga8Oy/InUC31O58U9Wu+OKIB97oVd7HWznIi6DxIiyqhum5SpZdv3v+sB/WZa5vmnoqkxA7AHb6TOMR1Pe3fo3s066yvoYqlsdFfndxkthelDyxRDsQTVllKHVitvnP6HWuI7bdTgzeZSh3ZK3gXBcjWoHjHhMDeNHdwCn/Q70Jlnjc8C5BG0bxm2x9iCWN2O+RaxwMjSHJfDUSAzT9ww5QGVHLziyQqibDObAPtERuQfhpsVGIxD9iCfVvoiSYcQOa6ijsGMn4LSFCToCWTGtxne8FFDx/hxvbjl6U4x34Iy/KYbXGREtnew95yqjByE91TchrqU16M7XAxT6u7Q3kFQ/Zmf40hMSC3uDvlBwFuevjEC2nHCmTjkhNvNL7k1aBajI1k00eeGi+okwXyCYlqXNDTRNACjP9LW3SNur9I8F6gfIJzq02dCnAUpwrLW6HNmGkhT8YgX9KWOTf/d6MZyeAGHoWLdFY8mpZhYXYBWBjnouEP9D/vmXgB75ZJxqEmfedJqSrVtBHLJwNfXx25oRJ2Vqaz1lDk2WCLK5k5maPUpUYmzNu2fTILRqyOOV2OtOFF98wkZQWCIDbH6vhTE0Vba5B0T5phme5VbZNCwAa4mpjU/nv91YSZiabc9kxGbv6aEG0jSkcFrNHTxFQYpeMU3oHfV6dgUOMew2zMVgCscDgJzX7XGjBg2bPm3tR3ME9S5SUggGGaa9hiunbNyYbS4AdOqmcgKHjdN0ICPlYuVb1W3PBzjnDTMZB/QHGTrUoOugXkmkkh0BW+lpAQ7VDPqIX2OF/IubzK6I0jpudTm9N1gbZJjB8bSiSjU5niSg3vzxRx30YORTAUTdiuzSPz2UZOnBBW2Jk3sGowZj+T4ky2bAIW1HWNfsIqcHqdh8sw/Vb/1sMAXBhFPqF25uXOyd4gYoNjY77iT3pfYP9lrQYT37nQCM6ia4O/kug1matGHQ2dVcrDd1oobUqKpwe2rvN8k2s0hYI/N+iBygi6QvI8NqdOEcjD5xmCGYE8Bnblb2O+RLk3ttnrgOgI0CS+6TKOy4mbAwWGMiFdV7zo1uS6JmZVUlxRpp+feuC0U0UsvhtkzmkUj+vfoeEirHPWBK/11x0lzAftNkrvfkBZ4vojjz9ZF8jI4+vyOa6SN6uE6nKUa8GXfHNy9OPI29eog5U6ANVD1eepGUUBL7ynxPJTrERE7e1bKRVKdnpuba/cIkpnT1Nd00Lct1laCE8wT+xXUtyzM0WeSmCD5iZ0B/JPqkPxP90P5tbSeCy7oTMgay8DFeTS236Be2Ikp+PbYGOzINgpdpsGy52RRiv3Y0uhHUmrXA9PCO792Qhw4qGE/dq/WaAsVWEZgl0GN6yBYe7xLUaKDL795jegSMFQ07NICg01Oj+eo5+UkzVc6EMeuBKBcjq5t5YMPmAtPA4CKWYXolEJF727RkkfMTTmFSA4HE3yY1qZstdN+rjPaGrISEQiZxN7KWP3LkERNY+SKW9ya4DE6zrhmg38ckDNn+3ymh4SmerdIq3QYo2Z2j7EbTmmpO639ktRcuQKU7ztWLPr3NydS+7epbFB+gfJ+EIXlWudj0xHvmvWADQGHrM9FEs6qgmsgOX1s4wzjxO7ZYgEJlq4xau2Q3V7OD4azpJXclKgBA5Yq68slvjOo74YKyMJjPvX+UznyTkmRxNVdK47/czCASJqchNglG8+1nOe1u+QEA4vPA7FUxiSBqPia3WDOHTnUZczvJ9XeeBABSYax4Y+1x38HIuhukIb+KUg4eHeS02cLLJRsq4sCJNELuZJY2XrfE2DfDUq5/QxYriyuFAWBxX96Zfwtum/5CqifNqt2xEOaxEyiu5XmaqqmyfCv/1QxczJUFTpyHwqnSiE8rKv8AOY9bMF0mLKnxWIrbkyqWrCkK0XQ5Sjh5iK6k4K161cDi6b9+/Vm6iWmEHPdErRIkO09L9mK6dheVsBvlXgDn+DvcpiA4zdiSuhNr8DEBR/N6AqBaflOGJgfMvJ6Vl/PXOxR3CQCql39c4ek8OcG+6/CMO/Tk6LwhANmv2rKCz/GbEfO8DWT2c5MajK7PL3TrO5+Njecp7eKfCAaDOLKS79Xwo0kPsa2CDw+HoGbFdKWCHd5gbsreyVHl7Exa/Tale6YXWbeZNrTz6BEZODlqp7yh0jgUvt5STW53925uQDc7U+OC90XPIn5jlpjdX6Xj61bunwvCeQRx3gJN1IlH9LJoq7HE7NLM6LJAvgsJqNmlWIwAHp4XwXM1NwlXzcMHsFxW8i+/pz0q9+0NLDkb8caWS/MEg1Ysvb6ooOiFPLGjwoa/s4FEmov7HSWdP0cxDHQC/MSW4Bdb97M4FMAklwLcu5qg0gVLA9cbOZfFqkmd/DKfwiwX43M05yAQSbx5fhbEUViwgKryZRotTe5NTfBfqBNbhHnqZIpl3MZShKqLqqcJLe2rX1EEfLZEjrlwdukKe6bvu0odvu+bpqbdZHtKGo1kNc67WOGA0qobGiwOORn7HYxbNNbswQIZUphVesb570Hl6nW8ZWGsdOKTViUfNf2VAyB5b2FuUKwURxHvWyuA6dZVzv24ZcJbA9zVCJZrxTPRH0XWynI+EarGCu8bzGwlvwvPEzkBLLK1yn8JYftpZ5gbxusWW9++gzS4GGC3LJubG4Fugxetfo61lH2riQAKjrF9QxfOC3pbDwB+1SMsH6iffYZ97c7CgJXAaEo60DcC5svPW+uEWw9glB533FcfsAicrqSDx10AFGy23olOQ/gubeXC6a8TmA5Gs66jzVBhuOnGrKYtvRRAqkhcfemMlUTDdyKCszwAr2y9YenvPctLP4HPkzmBxOooD891ItwSgyRxjXprBL0F9M4sQUyTzZPMMtRxX0G6cLJu+kESCVVfBTIvsrSq9krqVZ2+IM39iAshT5Mgcy3TM3T1Cd0wTNOvQolRIfDUvQUmEbX7W+/brEpUhtMh7y4ugufz3fctfz6fz/fQ76xY4gGNqiRvv5rg8gZ4KxrdBaKb70ESULn/tBO53Q8KvSnTDxKbRg8KwWt6WocknstuupUeDFHDAlbz1c3tTnRsBZw3M99uAADSYVA38OWE3kktsr86rVHbLF2BlURvUFr2qdtInrO/ULGRuf2OS+L0eMGiocQh7mk1nyY2HIRY0ZozRXXQmTTAsAos3uk1LiTbwFbY9J47eAeli7/Be3ctI0aQ3VnPFNM/qTf0nV5s3cqSqOBp+il19/KqCn75IvpyvY5WU6IbInBO929o7PN/imz0xpA4WTN9JUhSfELZiacrYCm/+oFlizyKr4rv9cj5Fy8pd1x4TAGWGJ8hlVrkbtOFEUXbVm+3m1HidlNle6QsVgv+lX4MQPFRHam9AgJUktzk8y96UFSVMq/UtQNwUXiA1Yxo7axo23KEuxd6eBNj8Qu7ijgUnfi3dVji806e1m7p8O6sznZAfTQRL9dDIc4Me1EcTr3LNM9llop/RhWr9i3dlPsZX8SZSXxk5wui5l9x/5CaYHnubz22Oxp5mThYzRd/r5ml38TLyJBWu4mCTzRpZUUD/uBQVxs4stfS4ABCFPsvj5L/HnqGoT2g3xOjr06cFwLoSPgGiA92s0GJwfjd/dywxVIOa7nDU+cHcIo06jdzANypIfN0aIGwOPkUoM1LqxaBMRcln+JAwX5xrblgPKeY4/HjPdXpanL1EyFpSjSpSguAMx9l2tEnMEwDoyuxAMYHs+qUFCtDJ1f9YEiyoTi5QD104MagYbkYASF3FG/F2NUxkGzVKze/JM3DJ/I0uWa+R9Ba+YMPPvjggw8++OCDDz744GfgfwFHZDmsVgSEzgAAAABJRU5ErkJggg=="},{id:"4",appURL:"https://www.appsflyer.com",name:"AppsFlyer",logoURL:"https://pbs.twimg.com/profile_images/1744333107384172544/YrEGkrvp_400x400.png"},{id:"2",appURL:"https://www.fiverr.com/",name:"Fiverr",logoURL:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTBz6gKpHY4meThBsk-wOnXyX3gKKridZCg8hQwzbCltQ&s"},{id:"1",appURL:"https://frontegg.com",name:"Frontegg",isDefault:!0,logoURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAjVBMVEUBAQH///8AAAD8/PwFBQX5+fkJCQn19fXr6+vg4OCdnZ3z8/Pn5+eioqIaGhrR0dGHh4fc3Nytra3AwMAmJiZhYWFNTU10dHQ8PDxWVla6uronJyc0NDTJyclubm6BgYGQkJBGRkYVFRVdXV1ycnIuLi6goKCqqqo5OTlCQkIeHh57e3uMjIwXFxeWlpY27kYFAAAMWElEQVR4nO1diULqOhAlky5AQXYEFFBcUPH5/5/3ZiZtuWrXdAVz7rs+5Raa08yeZOx0DK4A4P+92m8MDC4ALdEWo4cGBleNltgDY2kM/jRaoi1GDw0MrhotsQfG0hj8abREW4weGhhcNVpiD4ylMfjTaIm2GD00MLhqtMQeGEtj8KfREm0xemhgcNVoiT24UEsD12vMAP9YFv53pRyB6QGxs5Bk48PplK0AwLNH5OirA1ephxCiuns0AJ8R/+9+N5xujg+LG/Ui/216fIWBwuk4aFrg8WsizpiNiSXJ6zVQRCrz/UgKYQtJ7KSQ9MNswRybYlieZoMDzmcXeUnFjChK/kmMFkqAS7tXM5YGYDFBQrYtbBnMIRGkV8Rs9Y3iRcHq+P7gvylzUgTDOVTCKoT7yW4SxbXpAecHDhzNCCx7LJRq2qT4AXxhe4dybDm1m5zi6tfh+OXkKvui5i+CohS9J3A4lLs0PWSCfUniSWr4k1oorvjvt0BxzqUBiOGM5VBN3XbmG5p/ZdSX3HGTbkMHlm89RsyDTehkCbBzpRs5lUL02dSQZF8GlJG5GfmSiLN0tMjxd2OEFfGqMo9aB1lAjzmMOWwF80FW7h7opds4dSRlfCDnb12MpSGGIxEw7K7hgEo59qT9y5aGCil2xPBSdFHpYDBjkwOZkdXI9/HRFFGU1zTRTQ89I3AGN2rgOGkjQI8Oe/e3L/wpqe+1BjZFpByn4isMzyasgn3BYWgyJh/gV3DarodoU0Qgj5M5jXpKBNPmUIjNJWT/nLivwunqMcENGdRUhnjBOCxxhLFf+DWsf4B/l2aeBrDfo2AbVdC2vZVPMHX6CCjTjxiDW8rfWBT4Wf/UduC/D9JoBS5oNUURhhyLkmnZsQ6m2piAoJS9m8CgIjdL8Vnu9sNtz/M813Xx62i4X9z5zrPQSDuaKYUFT34cI+SU3MRexrrBHwzpsiP4H0YuFV7WD6Oe5/9z+EXIwej0AsXMkvaDceBmolIGKQY0iJUbkTNFM+Q3LcCXUngZbrvh9NrMX6pv6fO8/vxcsKsNVDtTWsfDWeI4D71M7HwpxS/dG1WBexmE2qsCBRk8Bul/b9N8O1CrPlIsswhF8kiu/piZoIIthjhsyob9sDYJGA6SYdJTSC1HT49zEmgMO4pFRgkNIaX7qD5oneGt3gnv4VAqmnvMek/F6cAplK09aUkvojaTwlCOQHmJWerFrrCfmWBdICEdBKLlkZl5EG42O/ovRfFEsmfBMvVSCiTe6lREpPQaDnNM5lCIjM7+G3pUAsF3T6JKVz8xONSYkaAB7PoPV3RpCod6DPHpcJnnmeYo9f19TYZ6KcWnuik++U/Uj3tPj6AYzIHLi7ZM/wCpIsPcY9Z4IlS48J2fFN0DT2FeSxqAa28W5VypHyDRvdQhpRwpoyG1/bseIRTZ/LApGqKo9N2NL12dGXp39UQ1FEf2gmeOPo2zXl2G9hjIk5PXz/AZpxr0UMWSYd6LLg1fG6QHJTHg0gdF7beZLt5CDR6fzftIBP79Fik/x9ed0gdNATgynA9SP4LqzXVIKQnVjbCD1bM5WtKZtp2hN24wQELNnma41sYQv4ziSwrwgZ9HM6OALaF2mAU3PImpcQ1PeJ8XEaolSHnh2XTe4o/7ggz7nIodJqkX4k2mOns68loaTCPON30CFTcXYTjiQkUWMeVrcy8/5oX1LRUYObAWUl8PeeBLFtN1hispRKx6QeCXf+fgRtdZqGG/ApkvyPQhNSx5WLArQCcSEx52hiwRcdBYYM0beWcbSR7Ya57EcZZr5zyH1Xp86BbSugiCmJ7QcuJ9lovvq5dSWLiFLGcUw5HKg7N88GP1+3Hgq5hhiWLoqi2Nxww2+b36jQ7+poQyIeWClWacwa/ea0xhTo8PBb1fBD8OxvDPOkMl447NTIWWBuA9S9EoL8MZSynasNSrP6rdiUv24KFMdgFcDsao5pp2pYOZSHXgJcP08FEHauNR+sKArWNKc8g01ae3lTB8B1U6SJvD3nkrThV6yJKkW3RKxok3x61TGW6r3afCDOk+5Xp8wpRzxLfUx7eBajeMIcO30sn5I6do7JDoa6k0NKz6VEOmYoMOtiq9SIkmaLuAhpPLobXQyVT108CI65T+/qpYfhLdYcXVxIrcIdrIAzP8TLxIqgC2QkAml6UFd06OLiW5tqkiXDHDTrIc6cO+Y6FKrNXYUjzopbSd7DJtVcowzVJzDlKtHqKqlF7C+MbwJZlg91CxlFbNsAPz5Nx6VPUyNy30VSSlaGkoffpvkHAN7xCvlCDPYTWpheh+sJSm7Kta69Vo8nh8Wo6uBIMDLSOClbh40fuAHAZG1+NnKmrmx8Rihslh26b6MhvvC6kEWz7ZnsJwV/2eKBzCYzUMKbegjWtJeujNq99Pg3eYV8PwyFuh/12Z/I2Z5kmbnJNoVcPwpIQ00R/egu72y8xQ9bBKGL7wEmLy0kUNRxfxCZLLL3lhhj8PlJTGRt6yniMaXE3U3aMXD1vYA8rwaS98wlN41uaXK7fowJPIu1U2FZIKUZ3EzEWKrvbp4ZwPo4p1C0m7jLkYGxvS2PgQtOYvNywqCZc8h1K4tO5J5/rinYX9VNNRBJSUT5G+jTAnxYk65ASLOA3ng3G16CEN4y39fGFefHEVFJKKQLRVvwY95DfStr1yCbpLdUAowdd2dSM2LYq7kle51aYo6msTv5Dfr/FcLTjxFk8LdCxYtQX7ivS0dBJB1njUgjKor1IZUmJrcdA2iLTS5E2mUGRFJq/6pmQA+aF6ZQCd9YsSf9o4u1K7aGqxNEBnXEpN9Lu8W99RrTWi9FBi3lRnm6lgmbQUe0r9UMa0RxgZzmV0PGgL9x2gzkZawOa0HJ8oPT6O0FGnwKNhqwKAnm8LRpxXuKHI1u5vDKlQrzZEvXtx19hL0Cnma3t89VTuSzI2cqqcfVIhdthAjwkobZNpV51HA1jGHijxPhroEwJ8UknY6e0h4kG9JaT7Bo5jqVAw6hqVWTVwHp/vuZXCi2sklAWezaf4HT4oO471FD0oXJ/RsTTqlEsxa2NTTkGeED/rw44O2NCBPMG50Wt9loZKUpivekWcIvccYEeotnjHCPy0qY6LdK4alm6hisar3/OCQu7fn6IO5vd453oTDNXh1kcSVA1dtKkp0QMbGSJ4ip5AfHjump5kAbfmD1ZHuIF3SL0McLT5DSoSdNlEMsFlNzri5kOjTvEGfdoPhuXrpSdcHTkdUH9BnEKconk3Up2pKcak0fZ1zNCJDycTMbsBlFGSUqogRnZEQRm1P3gKG0PQIWc5ODcpTYZUfSOFp1rSclfQqIKB9C9+akWnZXJVQ89vjJjC0OW2n96QpsZSHUHvJtGOHifQHpdFr5ge8zhX067K9ZJB/27PHn0nQQ/nPrq6xqSnQc/apiyNejo8VJS1+35c8vN9FqeUCXGkRu9682J0UPBSUxuaZHIJqcM9sWCXuJmIBj0aH0CdpnQ61BjqNipWo4l21XbnRs1MSJFTfrU5FJzbWSB1UobtTJWiDbbjedDUSq2GfkyjvISt9HlTZtOkglL+TyxO3byXp+lk8E1i3UFvtl8qeqo0z6We9SDSkyp7tQl6uDeuh+fHxL8jwFL+Y75cnPYP/eGw/zU+7Zbzc+M1dRoE3fzhKKMbg1EfLEr82yCg38HLY75p/QU/wFZpAmHXU029ovSVuqXQDrqmGf2G3wcwGBl0gn5sAMHvg/BlmfqaR6aDNnmc7rqxPoJFwIdEUUhp/rYyhiAr4eyudAktS6GTvwH1S0tuTiNbxB1vxxe9WyXJZd69JrDkrY49yg2Z3m8dRBE9fnALxRrHVQr8Bp2L4+DbdJ2JBV83K/aCF9fSnMLs9evI5/VdOvkFlXJ40xVU5CSq1kMqd7z1J7aI0L8w7pk83AdVw9KHUTmAE2VYPvRs8TMO5RZfbu9rwR6lFXGoBjhFUCHd83D0w4ba2/7+LnCYnUv9XTRBJOAHOPeL/XA63Uz7+8XKf0ldVGwJrTX4Ec/Vc89OHR7f/4bjNouDWBJK7iFc9U3rBvhiq3ayXZ53zwD/Afv0Ls27txO16mET3xgYGLQALbEHxtIY/Gm0RFuMHhoYXDVaYg+MpTH402iJthg9NDC4arTEHhhLY/Cn0RJtMXpoYHDVaIk9MJbG4E+jJdpi9NDA4KrREntgLI3Bn0ZLtMXooUEc/gd5eYsNGaklXwAAAABJRU5ErkJggg=="}],Ab=e=>{var t;return null!=(t=e.map((({appIds:e})=>e)).reduce(((e,t)=>(null==t||t.forEach((t=>{e&&!e.includes(t)&&e.push(t)})),e)),[]))?t:[]};function*bb(){yield Bi($a.setApplicationsState({loading:!0}));try{const e=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.id})),t=yield $i(Ip.applications.getUserApplicationsId,{userId:e}),n=yield $i(Ip.applications.getApplicationsData,{appIds:t});yield Bi($a.setApplicationsState({userApplications:n,loading:!1}))}catch(e){yield Bi($a.setApplicationsState({loading:!1,error:Bg(e)}))}}function*Tb(){yield Bi($a.setApplicationsState({loading:!0}));try{const e=yield $i(Ip.applications.getTenantsApplications),t=Ab(e),n=yield $i(Ip.applications.getApplicationsData,{appIds:t}),a=yield $i(Ip.applications.getUsersOfApplications,{appIds:[]}),i=n.map((e=>{var t;return x({},e,{userIds:(null==(t=a.find((t=>t.appId===e.id)))?void 0:t.userIds)||[]})}));yield Bi($a.setApplicationsState({accountApplications:i,loading:!1}))}catch(e){yield Bi($a.setApplicationsState({loading:!1,error:Bg(e)}))}}function*Eb({userIds:e}){try{const t=yield $i(Ip.applications.getUsersApplicationsId,{userIds:e}),n=Ab(t),a=yield $i(Ip.applications.getApplicationsData,{appIds:n});return e.reduce(((e,n)=>{var i,o;const r=null==(i=t.find((e=>e.userId==n)))?void 0:i.appIds;return e[n]=[...a.filter((e=>e.accessType===Ep.FREE_ACCESS)),...null!=(o=null==r?void 0:r.map((e=>a.find((t=>e===t.id)))))?o:[]],e}),{})}catch(e){yield Bi($a.setApplicationsState({error:Bg(e)}))}}function*Ib({payload:e}){const{userId:t,appIds:n,callback:a}=e;try{var i,o;const e=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));yield $i(Ip.applications.assignUserToApplications,{userId:t,appIds:n,tenantId:e});const r=yield null!=(i=qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.applicationsState)?void 0:n.accountApplications})))?i:[],s=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.teamState)?void 0:n.users})),l=null!=(o=null==r?void 0:r.filter((e=>n.includes(e.id))))?o:[];null!=mb&&mb.length&&(yield Bi($a.setTeamState({users:s.map((e=>{var n;return e.id===t?x({},e,{applications:[...null!=(n=e.applications)?n:[],...l]}):e}))}))),null==a||a(!0)}catch(e){yield Bi($a.setApplicationsState({error:Bg(e)})),null==a||a(!1)}}function*kb({payload:e}){const{userId:t,appIds:n,callback:a}=e;try{var i;const e=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));yield $i(Ip.applications.unassignUserFromApplications,{userId:t,appIds:n,tenantId:e});const o=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.teamState)?void 0:n.users})),r=null==(i=o.find((e=>e.id===t)))?void 0:i.applications;null!=r&&r.length&&(yield Bi($a.setTeamState({users:o.map((e=>e.id===t?x({},e,{applications:r.filter((e=>!n.includes(e.id)))}):e))}))),null==a||a(!0)}catch(e){yield Bi($a.setApplicationsState({error:Bg(e)})),null==a||a(!1)}}function*Ob(){yield Wo($a.loadUserApplications,bb),yield Wo($a.loadAccountApplications,Tb),yield Wo($a.assignUserToApps,Ib),yield Wo($a.unassignUserFromApps,kb)}const Pb=["callback","appIds"],Lb=["roles"],wb=["callback"],Db=["callback","profileImage"],Ub=["callback"],Cb=["callback","userId"],Rb=["callback"],_b=["callback"],Nb=["callback"],Mb=["callback"],Fb=["callback"],Gb=["callback"],xb=["callback"],Vb=["callback"],jb=["callback"],Bb=["callback","profileImage"],Wb=["callback"],zb=["callback"],$b=["callback"],Kb=["callback"],Hb=["callback"],qb=["callback"],Jb=["callback"],Yb=["callback"],Xb=()=>qi((e=>e.auth.teamState));function*Qb(){try{const{groups:e}=yield $i(Ip.groups.getGroups,{_groupsRelations:hb.roles});return e}catch(e){return[]}}function*Zb({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s,shouldLoadApps:l}=e,c=yield Xb(),d=null!=(t=e.pageSize)?t:c.pageSize,u=null!=(n=e.pageOffset)?n:c.pageOffset,y=null!=(a=e.filter)?a:c.filterV2,f=null!=(i=e.sort)?i:c.sortV2,p=null!=(o=null==e?void 0:e.shouldShowSubTenantUsersIfReseller)?o:null==c?void 0:c.shouldShowSubTenantUsersIfReseller;yield Bi($a.setTeamLoader({key:XA.USERS,value:!r})),yield Bi($a.setTeamState({pageSize:d,pageOffset:u,filterV2:y,sortV2:f}));try{const[{items:t,_metadata:{totalPages:n,totalItems:a}},{items:i},{items:o},r]=yield Wi([$i(Ip.users.getUsersV2,x({},(null==y?void 0:y.length)&&{_filter:y},f&&{_sortBy:f},e.order&&{_order:e.order},{_offset:u,_limit:d,_includeSubTenants:p})),$i(Ip.teams.loadAvailableRoles),$i(Ip.teams.loadAvailablePermissions),$i(Qb)]),c=t.map((e=>{var t;const n=null==e||null==(t=e.groups)?void 0:t.map((e=>r.filter((t=>t.id===e.id)))).flat();return x({},e,{groups:n})})),g=c.map((e=>x({},e,{roleIds:e.roles.map((e=>e.id))})));let S;l&&(S=yield $i(Eb,{userIds:t.map((e=>e.id))}));const v=S?g.map((e=>{var t;return null!=(t=S)&&t[e.id]?x({},e,{applications:S[e.id]}):e})):g;yield Bi($a.setTeamState({users:v,totalPages:n,totalItems:a,roles:i,permissions:o})),null==s||s(t)}catch(e){yield Bi($a.setTeamError({key:XA.USERS,value:Bg(e)})),yield Bi($a.setTeamState({totalPages:0,users:[]})),null==s||s(null,e)}yield Bi($a.setTeamLoader({key:XA.USERS,value:!1}))}function*eT({payload:e}){var t,n,a,i;const{silentLoading:o,callback:r}=e,s=yield Xb(),l=null!=(t=e.pageSize)?t:s.pageSize,c=null!=(n=e.pageOffset)?n:s.pageOffset,d=null!=(a=e.filter)?a:s.filter,u=null!=(i=e.sort)?i:s.sort;yield Bi($a.setTeamLoader({key:XA.USERS,value:!o})),yield Bi($a.setTeamState({pageSize:l,pageOffset:c,filter:d,sort:u}));try{const[{items:e,totalPages:t,totalItems:n},{items:a},{items:i}]=yield Wi([$i(Ip.teams.loadUsers,{pageSize:l,pageOffset:c,filter:d,sort:u}),$i(Ip.teams.loadAvailableRoles),$i(Ip.teams.loadAvailablePermissions)]);yield Bi($a.setTeamState({users:e,totalPages:t,totalItems:n,roles:a,permissions:i})),null==r||r(e)}catch(e){yield Bi($a.setTeamError({key:XA.USERS,value:e.message})),yield Bi($a.setTeamState({totalPages:0,users:[]})),null==r||r(null,e)}yield Bi($a.setTeamLoader({key:XA.USERS,value:!1}))}function*tT({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s}=e,l=yield Xb(),c={_limit:(null!=(t=e._limit)?t:l.allUsersQueryParams._limit)||20,_offset:(null!=(n=e._offset)?n:l.allUsersQueryParams._offset)||0,_filter:(null!=(a=e._filter)?a:l.allUsersQueryParams._filter)||"",_sortBy:(null!=(i=e._sortBy)?i:l.allUsersQueryParams._sortBy)||"name",_order:(null!=(o=e._order)?o:l.allUsersQueryParams._order)||"DESC"};yield Bi($a.setTeamLoader({key:XA.USERS,value:!r})),yield Bi($a.setTeamState({allUsersQueryParams:c}));try{const[{items:e,_metadata:{totalPages:t,totalItems:n}},{items:a},{items:i}]=yield Wi([$i(Ip.subTenants.loadAllUsers,x({},c)),$i(Ip.teams.loadAvailableRoles),$i(Ip.teams.loadAvailablePermissions)]);yield Bi($a.setTeamState({allUsers:e,totalPages:t,totalItems:n,roles:a,permissions:i})),null==s||s(e)}catch(e){yield Bi($a.setTeamError({key:XA.USERS,value:Bg(e)})),yield Bi($a.setTeamState({totalPages:0,users:[]})),null==s||s(null,e)}yield Bi($a.setTeamLoader({key:XA.USERS,value:!1}))}function*nT({payload:e}){yield Bi($a.setTeamLoader({key:XA.ROLES_AND_PERMISSIONS,value:!0}));try{var t;const[{items:n},{items:a}]=yield Wi([$i(Ip.teams.loadAvailableRoles),$i(Ip.teams.loadAvailablePermissions)]);yield Bi($a.setTeamState({roles:n,permissions:a})),null==e||null==(t=e.callback)||t.call(e,{roles:n,permissions:a})}catch(t){var n;null==e||null==(n=e.callback)||n.call(e,null,t),yield Bi($a.setTeamError({key:XA.ROLES_AND_PERMISSIONS,value:Bg(t)}))}yield Bi($a.setTeamLoader({key:XA.ROLES_AND_PERMISSIONS,value:!0}))}function*aT({payload:e}){const{callback:t,appIds:n}=e,a=ii(e,Pb),i=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!0})}));try{var o,r;const e=yield $i(Ip.teams.addUser,a),{roles:s}=e,l=x({},ii(e,Lb),{roleIds:null!=(o=null==s?void 0:s.map((e=>e.id)))?o:[]}),c=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.applicationsState)?void 0:n.accountApplications})),d=null!=(r=null==c?void 0:c.filter((e=>e.accessType===Ep.FREE_ACCESS)))?r:[];if(null!=n&&n.length){const e=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));yield $i(Ip.applications.assignUserToApplications,{userId:l.id,appIds:n,tenantId:e}),l.applications=n.map((e=>{var t;return null!=(t=null==c?void 0:c.find((t=>t.id===e)))?t:[]})).concat(d)}else l.applications=d;null==t||t(l),yield Bi($a.setTeamState({users:[l,...i.users],addUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!1,error:Bg(e)})})),null==t||t(null,e)}}function*iT({payload:e}){const{callback:t}=e,n=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},n.addUserDialogState,{loading:!0})}));const a=[],i=[],o=e.emails.map((t=>x({email:t,roleIds:e.roleIds},e.expirationInSeconds&&{expirationInSeconds:e.expirationInSeconds})));yield Bi($a.setTeamState({addUserDialogState:{open:!0,loading:!0}}));for(let e=0;e<o.length;e++){const t=o.at(e);try{yield $i(Ip.teams.addUser,t),a.push(t.email)}catch(e){i.push(t.email)}}const r={pageOffset:0,pageSize:10,filter:"",silentLoading:e.emails.length>0};yield Bi($a.loadUsersV2(r)),yield Bi($a.setTeamState({addUserDialogState:{loading:!1}})),null==t||t({unallowedEmails:i,allowedEmails:a})}function*oT({payload:e}){const{callback:t}=e,n=ii(e,wb),a=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},a.addUserDialogState,{loading:!0})}));try{yield $i(Ip.subTenants.addUserToTenantAndSubTenants,n);const{items:e,_metadata:{totalPages:a,totalItems:i}}=yield $i(Ip.subTenants.loadAllUsers,{_limit:20,_offset:0,_filter:"",_sortBy:"name",_order:"DESC"});yield Bi($a.setTeamState({allUsers:e,totalPages:a,totalItems:i,addUserDialogState:{open:!1,loading:!1}})),null==t||t(null)}catch(e){yield Bi($a.setTeamState({addUserDialogState:x({},a.addUserDialogState,{loading:!1,error:Bg(e)})})),null==t||t(null,e)}}function*rT({payload:e}){const{callback:t}=e,n=ii(e,Db),{id:a}=n,i=yield Xb(),o=i.users.find((e=>e.id===n.id));yield Bi($a.setTeamLoader({key:XA.UPDATE_USER,value:a||""})),yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!0})})),yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!0}),users:i.users.map((e=>e.id===n.id?x({},e,n):e))}));try{var r;o.roleIds.length>0&&0===(null==(r=n.roleIds)?void 0:r.length)&&(n.roleIds=[""]);const{item:e}=yield $i(Ip.teams.updateUser,n);null==t||t(e),yield Bi($a.setTeamState({users:i.users.map((t=>t.id===e.id?x({},t,e,{groups:t.groups,createdAt:t.createdAt,customData:t.customData,lastLogin:t.lastLogin}):t))})),yield Bi($a.setTeamLoader({key:XA.UPDATE_USER,value:!1}))}catch(e){yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!1,error:Bg(e)}),users:i.users.map((e=>e.id===n.id?x({},e,o):e))})),yield Bi($a.setTeamLoader({key:XA.UPDATE_USER,value:!1})),null==t||t(null,e)}}function*sT({payload:e}){const{callback:t}=e,n=ii(e,Ub),a=yield Xb();yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!0})}));try{yield $i(Ip.teams.deleteUser,n),null==t||t(!0),yield Bi($a.setTeamState({users:a.users.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!1,error:Bg(e)})})),null==t||t(null,e)}}function*lT({payload:e}){const{callback:t,userId:n}=e,a=ii(e,Cb),i=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!0})}));try{yield $i(Ip.subTenants.setUserRolesForSubTenants,n,a);const e=i.allUsers.find((e=>e.id===n));let o=[];e&&(o=e.tenants.map((e=>{var t;return x({},e,{roles:(null==(t=a.subTenantsRoles.find((t=>t.tenantId===e.tenantId)))?void 0:t.roleIds.map((e=>i.roles.find((({id:t})=>e===t)))).filter((e=>e)))||e.roles})}))),yield Bi($a.setTeamState({allUsers:[...i.allUsers.filter((e=>e.id!==n)),...e?[x({},e,{tenants:o})]:[]],addUserDialogState:{open:!1,loading:!1}})),null==t||t(!0)}catch(e){yield Bi($a.setTeamState({addUserDialogState:x({},i.addUserDialogState,{loading:!1,error:Bg(e)})})),null==t||t(null,e)}}function*cT({payload:e}){const{callback:t}=e,n=ii(e,Rb),a=yield Xb();yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!0})}));try{yield $i(Ip.subTenants.removeUserFromTenantAndSubTenants,n),null==t||t(!0),yield Bi($a.setTeamState({allUsers:a.allUsers.filter((e=>e.id!==n.userId&&e.tenants.length===n.subTenants.length)),deleteUserDialogState:{open:!1,loading:!1}}))}catch(e){yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!1,error:Bg(e)})})),null==t||t(null,e)}}function*dT({payload:e}){const{callback:t}=e,n=ii(e,_b);yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:n.userId}));try{yield $i(Ip.teams.resendActivationLink,n),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.RESEND_ACTIVATE_LINK,value:Bg(e)})),null==t||t(null,e)}yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:!1}))}function*uT({payload:e}){const{callback:t}=e,n=ii(e,Nb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email}));try{yield $i(Ip.teams.resendInvitationLink,n),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.RESEND_INVITATION_LINK,value:Bg(e)})),null==t||t(null,e)}yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*yT({payload:e}){const{callback:t}=e,n=ii(e,Mb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email}));try{yield $i(Ip.auth.resendInvitationEmail,n),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.RESEND_INVITATION_LINK,value:Bg(e)})),null==t||t(null,e)}yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*fT({payload:e}){const{callback:t}=e,n=ii(e,Fb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email}));try{yield $i(Ip.teams.resendInvitationLinkToAllTenants,n),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.RESEND_INVITATION_LINK,value:Bg(e)})),null==t||t(null,e)}yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*pT(){yield Bi($a.setTeamError({key:XA.CONFIG_TOKEN_LINK,value:!1}));try{const e=yield $i(Ip.teams.getInviteLinkConfiguration);yield Bi($a.setTeamState({inviteTokenState:x({},e)}))}catch(e){yield Bi($a.setTeamError({key:XA.CONFIG_TOKEN_LINK,value:Bg(e)}))}}function*gT(){yield Bi($a.setTeamError({key:XA.CONFIG_TEMPORARY_USERS,value:!1}));try{const e=yield $i(Ip.teams.getTemporaryUserConfiguration);yield Bi($a.setTeamState({temporaryUsersConfig:e}))}catch(e){yield Bi($a.setTeamError({key:XA.CONFIG_TEMPORARY_USERS,value:Bg(e)}))}}function*ST({payload:e}){const{callback:t}=e,n=ii(e,Gb),a=yield Xb();yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!0}));try{const e=yield $i(Ip.teams.updateUserExpirationTime,n);yield Bi($a.setTeamState({users:a.users.map((t=>t.id===n.userId?x({},t,{temporaryExpirationDate:new Date(e.temporaryExpirationDate)}):t))})),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.UPDATE_USER_EXPIRATION_TIME,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!1}))}}function*vT({payload:e}){const{callback:t}=e,n=ii(e,xb),a=yield Xb();yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!0}));try{yield $i(Ip.teams.setPermanentUser,n.userId),yield Bi($a.setTeamState({users:a.users.map((e=>e.id===n.userId?x({},e,{temporaryExpirationDate:void 0}):e))})),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.UPDATE_USER_EXPIRATION_TIME,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!1}))}}function*hT(){yield Bi($a.setTeamError({key:XA.GET_TOKEN_LINK,value:!1}));try{yield $i(pT);const e=yield $i(Ip.teams.getInviteUserLink),{inviteTokenState:t}=yield Xb();yield Bi($a.setTeamState({inviteTokenState:x({},t,e)}))}catch(e){yield Bi($a.setTeamError({key:XA.GET_TOKEN_LINK,value:Bg(e)}))}}function*mT({payload:{callback:e}}){yield Bi($a.setTeamError({key:XA.CREATE_TOKEN_LINK,value:!1}));const{inviteTokenState:t}=yield Xb();try{const n=yield $i(Ip.teams.createInviteUserLink,{expiresInMinutes:43200});yield Bi($a.setTeamState({inviteTokenState:x({},t,n)})),null==e||e(n.token)}catch(t){null==e||e(null,t),yield Bi($a.setTeamError({key:XA.CREATE_TOKEN_LINK,value:Bg(t)}))}}function*AT({payload:{callback:e,expiresInMinutes:t,shouldSendEmail:n}}){const{inviteTokenState:a}=yield Xb();yield Bi($a.setTeamError({key:XA.UPDATE_TOKEN_LINK,value:!1}));try{const i=yield $i(Ip.teams.updateInviteUserLink,{expiresInMinutes:t,shouldSendEmail:n});yield Bi($a.setTeamState({inviteTokenState:x({},a,i)})),null==e||e(!0)}catch(t){null==e||e(null,t),yield Bi($a.setTeamError({key:XA.UPDATE_TOKEN_LINK,value:Bg(t)}))}}function*bT({payload:e}){const{callback:t}=null!=e?e:{};yield Bi($a.setTeamError({key:XA.DELETE_TOKEN_LINK,value:!1}));try{yield $i(Ip.teams.deleteInviteUserLink),yield Bi($a.setTeamState({inviteTokenState:void 0})),null==t||t(!0)}catch(e){yield Bi($a.setTeamError({key:XA.DELETE_TOKEN_LINK,value:Bg(e)})),null==t||t(!1,e)}}function*TT({payload:e}){yield Bi($a.setTeamState({addUserDialogState:x({open:!0,loading:!1,error:!1},e)}))}function*ET({payload:e}){const t=yield Xb(),{addUserDialogState:{onClose:n}}=t;null==n||n(e),yield Bi($a.setTeamState({addUserDialogState:{loading:!1,error:!1,open:!1}}))}function*IT({payload:e}){yield Bi($a.setTeamState({deleteUserDialogState:x({open:!0,loading:!1,error:!1},e)}))}function*kT({payload:e}){const t=yield Xb(),{deleteUserDialogState:{onClose:n}}=t;null==n||n(e),yield Bi($a.setTeamState({deleteUserDialogState:{loading:!1,error:!1,open:!1}}))}function*OT(){yield Bo($a.loadUsers,eT),yield Bo($a.loadUsersV2,Zb),yield Bo($a.loadAllSubTenantsUsers,tT),yield Bo($a.loadRoles,nT),yield jo($a.addUser,aT),yield jo($a.addUsersBulk,iT),yield jo($a.addUserToSubTenants,oT),yield jo($a.updateUser,rT),yield jo($a.setUserRolesForSubTenants,lT),yield jo($a.deleteUser,sT),yield jo($a.deleteUserFromSubTenants,cT),yield jo($a.resendActivationLink,dT),yield jo($a.resendInvitationLink,uT),yield jo($a.resendInvitationEmail,yT),yield jo($a.resendInvitationLinkToAllSubTenants,fT),yield jo($a.getTemporaryUsersConfig,gT),yield jo($a.updateUserExpirationTime,ST),yield jo($a.setUserAsPermanent,vT),yield jo($a.getInvitationLink,hT),yield jo($a.createInvitationLink,mT),yield jo($a.updateInvitationLink,AT),yield jo($a.deleteInvitationLink,bT),yield jo($a.openAddUserDialog,TT),yield jo($a.closeAddUserDialog,ET),yield jo($a.openDeleteUserDialog,IT),yield jo($a.closeDeleteUserDialog,kT)}function*PT({payload:e}){var t,n,a,i;const{silentLoading:o,callback:r}=e,s=yield Xb(),l=null!=(t=e.pageSize)?t:s.pageSize,c=null!=(n=e.pageOffset)?n:s.pageOffset,d=null!=(a=e.filter)?a:s.filterV2,u=null!=(i=e.sort)?i:s.sortV2;yield Bi($a.setTeamLoader({key:XA.USERS,value:!o})),yield Bi($a.setTeamState({pageSize:l,pageOffset:c,filterV2:d,sortV2:u})),yield It(),yield Bi($a.setTeamState({users:fg,totalPages:2,totalItems:10,roles:og,permissions:sg})),yield Bi($a.setTeamLoader({key:XA.USERS,value:!1})),null==r||r(fg)}function*LT({payload:e}){var t,n,a,i,o;const{silentLoading:r,callback:s}=e,l=yield Xb(),c=null!=(t=e._limit)?t:l.allUsersQueryParams._limit,d=null!=(n=e._offset)?n:l.allUsersQueryParams._offset,u=null!=(a=e._filter)?a:l.allUsersQueryParams._filter,y=null!=(i=e._sortBy)?i:l.allUsersQueryParams._sortBy,f=null!=(o=e._order)?o:l.allUsersQueryParams._order;yield Bi($a.setTeamLoader({key:XA.USERS,value:!r})),yield Bi($a.setTeamState({allUsersQueryParams:{_limit:c,_offset:d,_filter:u,_sortBy:y,_order:f}})),yield It(),yield Bi($a.setTeamState({allUsers:gg,totalPages:2,totalItems:10,roles:og,permissions:sg})),yield Bi($a.setTeamLoader({key:XA.USERS,value:!1})),null==s||s(gg)}function*wT({payload:e}){var t;yield Bi($a.setTeamLoader({key:XA.ROLES_AND_PERMISSIONS,value:!0})),yield It(),yield Bi($a.setTeamState({roles:og,permissions:sg})),yield Bi($a.setTeamLoader({key:XA.ROLES_AND_PERMISSIONS,value:!0})),null==e||null==(t=e.callback)||t.call(e,{roles:og,permissions:sg})}function*DT({payload:e}){const{callback:t}=e,n=ii(e,Vb),a=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},a.addUserDialogState,{loading:!0})})),yield It();const i=new Date,o=x({},dg,{groups:[]},n,{id:`${Sb()}`,temporaryExpirationDate:n.expirationInSeconds?new Date(i.setSeconds(i.getSeconds()+n.expirationInSeconds)):void 0});null==t||t(o),yield Bi($a.setTeamState({users:[o,...a.users],addUserDialogState:{open:!1,loading:!1}}))}function*UT({payload:e}){const{callback:t}=e,n=ii(e,jb),a=yield Xb();yield Bi($a.setTeamState({addUserDialogState:x({},a.addUserDialogState,{loading:!0})})),yield It();const i=x({},dg,n,{id:`${Sb()}`});yield Bi($a.setTeamState({users:[i,...a.users],addUserDialogState:{open:!1,loading:!1}})),null==t||t(null)}function*CT({payload:e}){var t;const{callback:n}=e,a=ii(e,Bb),{id:i}=a,o=yield Xb(),r=o.users.find((e=>e.id===a.id));yield Bi($a.setTeamLoader({key:XA.UPDATE_USER,value:i||""})),yield Bi($a.setTeamState({addUserDialogState:x({},o.addUserDialogState,{loading:!0})})),yield Bi($a.setTeamState({addUserDialogState:x({},o.addUserDialogState,{loading:!0}),users:o.users.map((e=>e.id===a.id?x({},e,a):e))})),r.roleIds.length>0&&0===(null==(t=a.roleIds)?void 0:t.length)&&(a.roleIds=[""]),yield It();const s=x({},r,a);null==n||n(s),yield Bi($a.setTeamState({users:o.users.map((e=>e.id===s.id?x({},e,s,{createdAt:e.createdAt,customData:e.customData,lastLogin:e.lastLogin}):e))})),yield Bi($a.setTeamLoader({key:XA.UPDATE_USER,value:!1}))}function*RT({payload:e}){const{callback:t}=e,n=ii(e,Wb),a=yield Xb();yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!0})})),yield It(),null==t||t(!0),yield Bi($a.setTeamState({users:a.users.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}function*_T({payload:e}){const{callback:t}=e,n=ii(e,zb),a=yield Xb();yield Bi($a.setTeamState({deleteUserDialogState:x({},a.deleteUserDialogState,{loading:!0})})),yield It(),null==t||t(!0),yield Bi($a.setTeamState({allUsers:a.allUsers.filter((e=>e.id!==n.userId)),deleteUserDialogState:{open:!1,loading:!1}}))}function*NT({payload:e}){const{callback:t}=e,n=ii(e,$b);yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:n.userId})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.RESEND_ACTIVATE_LINK,value:!1}))}function*MT({payload:e}){const{callback:t}=e,n=ii(e,Kb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*FT({payload:e}){const{callback:t}=e,n=ii(e,Hb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*GT({payload:e}){const{callback:t}=e,n=ii(e,qb);yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:n.email})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.RESEND_INVITATION_LINK,value:!1}))}function*xT({payload:e}){const{callback:t}=e,n=ii(e,Jb),a=yield Xb();yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!0}));const i=new Date;yield Bi($a.setTeamState({users:a.users.map((e=>e.id===n.userId?x({},e,{temporaryExpirationDate:n.expirationInSeconds?new Date(i.setSeconds(i.getSeconds()+n.expirationInSeconds)):void 0}):e))})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!1}))}function*VT({payload:e}){const{callback:t}=e,n=ii(e,Yb),a=yield Xb();yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!0})),yield Bi($a.setTeamState({users:a.users.map((e=>e.id===n.userId?x({},e,{temporaryExpirationDate:void 0}):e))})),yield It(),null==t||t(!0),yield Bi($a.setTeamLoader({key:XA.UPDATE_USER_EXPIRATION_TIME,value:!1}))}function*jT(){yield Bo($a.loadUsersV2,PT),yield Bo($a.loadAllSubTenantsUsers,LT),yield Bo($a.loadRoles,wT),yield jo($a.addUser,DT),yield jo($a.addUserToSubTenants,UT),yield jo($a.updateUser,CT),yield jo($a.deleteUser,RT),yield jo($a.updateUserExpirationTime,xT),yield jo($a.setUserAsPermanent,VT),yield jo($a.deleteUserFromSubTenants,_T),yield jo($a.resendActivationLink,NT),yield jo($a.resendInvitationLink,MT),yield jo($a.resendInvitationEmail,FT),yield jo($a.resendInvitationLinkToAllSubTenants,GT),yield jo($a.openAddUserDialog,TT),yield jo($a.closeAddUserDialog,ET),yield jo($a.openDeleteUserDialog,IT),yield jo($a.closeDeleteUserDialog,kT)}const BT=["authorizationUrl"],WT=["events","url"];function*zT(){try{yield Bi($a.setSocialLoginsState({loading:!0}));const e=yield $i(Ip.auth.getSocialLoginProviders);yield Bi($a.setSocialLoginsState({socialLoginsConfig:e,loading:!1,firstLoad:!1}))}catch(e){yield Bi($a.setSocialLoginsState({error:Bg(e),loading:!1,firstLoad:!1}))}}function*$T(){const e=yield qi((({auth:e})=>e.isAuthenticated));let t;return t=e?yield $i(Ip.auth.getSocialLoginProvidersV2ForAuthenticatedUser):yield $i(Ip.auth.getSocialLoginProvidersV2),t}function*KT(e){try{var t,n;const a=yield qi((e=>e.root.context));yield Bi($a.setSocialLoginsState({loading:!0}));const i=yield $i($T),{providers:o}=yield $i(Ip.auth.getCustomSocialLoginProvidersV1),r={socialLoginsConfigV2:i.map((e=>{let{authorizationUrl:t}=e,n=ii(e,BT);const i=Nr(a,null!=t?t:"");return x({},n,{authorizationUrl:t?`${i}${t}`:null})})),customSocialLoginsConfig:o,loading:!1,firstLoad:!1};yield Bi($a.setSocialLoginsState(r)),null==e||null==(t=e.payload)||null==(n=t.callback)||n.call(t,r)}catch(t){var a,i;null==e||null==(a=e.payload)||null==(i=a.callback)||i.call(a,null,t),yield Bi($a.setSocialLoginsState({error:Bg(t),loading:!1,firstLoad:!1}))}}function*HT(e){let{payload:{events:t,url:n}}=e,a=ii(e.payload,WT);try{yield Bi($a.setSocialLoginsState({loading:!0}));const{email:e,isNewUser:r,userId:s,tenantId:l,name:c}=yield $i(Ip.auth.loginViaSocialLogin,a);if(r){var i,o;const r={email:e,url:n,createdAt:new Date,id:s,tenantId:l},d=x({},r,{socialProvider:a.provider,authenticationType:Cg.SOCIAL_LOGIN});null==t||null==(i=t.signUpComplete)||i.call(t,d),zg(Wg.SIGNUP_COMPLETED,d);const u=x({},r,{origin:Ug.SOCIAL_LOGIN,name:c});null==t||null==(o=t.userVerified)||o.call(t,u),zg(Wg.USER_VERIFIED,u)}s&&localStorage.setItem("userId",s),yield Bi($a.setLoginState({email:e,isNewUser:r})),yield function*(){const{hostedLoginBox:e}=yield qi((e=>e.auth));e?yield $i(Ih):yield $i(Oh)}(),localStorage.removeItem("register-quick-login"),yield Bi($a.setSocialLoginsState({loading:!1}))}catch(e){yield Bi($a.setSocialLoginsState({loading:!1,error:Bg(e,"Failed to authenticate"),firstLoad:!1}))}}function*qT({payload:e}){yield Bi($a.setSocialLoginsState({error:e.error,loading:!1,firstLoad:!1}))}function*JT(){yield Wo($a.loadSocialLoginsConfiguration,zT),yield jo($a.loadSocialLoginsConfigurationV2,KT),yield Wo($a.loginViaSocialLogin,HT),yield Bo($a.setSocialLoginError,qT)}let YT,XT;function*QT({payload:e}){const{description:t,expires:n,callback:a}=e,{apiTokensDataUser:i}=yield qi((e=>e.auth.apiTokensState)),{policy:o}=yield qi((e=>e.auth.securityPolicyState.publicPolicy)),r=(null==o?void 0:o.machineToMachineAuthStrategy)===Pa.AccessToken;try{let e;yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!0}));let o=null;n&&(o=1440*n),e=r?yield $i(Ip.auth.createUserAccessToken,{description:t,expiresInMinutes:o}):yield $i(Ip.auth.updateUserApiTokensData,{description:t,expiresInMinutes:o}),yield Bi($a.setApiTokensState({showAddTokenDialog:!1})),yield Ji(200),yield Bi($a.setApiTokensState({apiTokensDataUser:[x({},e,{type:r?Pa.AccessToken:Pa.ClientCredentials}),...i],successDialog:{open:!0,secret:e.secret,clientId:r?void 0:e.clientId}})),yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!1})),null==a||a(null)}catch(e){yield Bi($a.setApiTokensError({key:YT.ADD_API_TOKEN,value:Bg(e)})),yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!1})),null==a||a(null,e)}}function*ZT({payload:e}){const{description:t,roleIds:n,expires:a,callback:i}=e,{apiTokensDataTenant:o}=yield qi((e=>e.auth.apiTokensState)),{policy:r}=yield qi((e=>e.auth.securityPolicyState.publicPolicy)),s=(null==r?void 0:r.machineToMachineAuthStrategy)===Pa.AccessToken;try{let e;yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!0}));let r=null;a&&(r=1440*a),e=s?yield $i(Ip.auth.createTenantAccessToken,{description:t,expiresInMinutes:r,roleIds:n}):yield $i(Ip.auth.updateTenantApiTokensData,{description:t,roleIds:n,expiresInMinutes:r}),yield Bi($a.setApiTokensState({showAddTokenDialog:!1})),yield Ji(200),yield Bi($a.setApiTokensState({apiTokensDataTenant:[x({},e,{type:s?Pa.AccessToken:Pa.ClientCredentials}),...o],successDialog:{open:!0,secret:e.secret,clientId:s?void 0:e.clientId}})),yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!1})),null==i||i(null)}catch(e){yield Bi($a.setApiTokensError({key:YT.ADD_API_TOKEN,value:Bg(e)})),yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!1})),null==i||i(null,e)}}function*eE({payload:e}){const{apiTokensDataUser:t}=yield qi((e=>e.auth.apiTokensState)),n=t.some((t=>t.id===e));try{yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!0})),n?(yield $i(Ip.auth.deleteUserAccessToken,{id:e}),yield Bi($a.setApiTokensState({apiTokensDataUser:t.filter((t=>t.id!==e)),deleteTokenDialog:{open:!1,id:e}}))):(yield $i(Ip.auth.deleteUserApiToken,{tokenId:e}),yield Bi($a.setApiTokensState({apiTokensDataUser:t.filter((t=>t.clientId!==e)),deleteTokenDialog:{open:!1,clientId:e}}))),yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!1}))}catch(e){yield Bi($a.setApiTokensError({key:YT.DELETE_API_TOKEN,value:Bg(e)})),yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!1}))}}function*tE({payload:e}){const{apiTokensDataTenant:t}=yield qi((e=>e.auth.apiTokensState)),n=t.some((t=>t.id===e));let a=t;try{yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!0})),n?(yield $i(Ip.auth.deleteTenantAccessToken,{id:e}),a=t.filter((t=>t.id!==e))):(yield $i(Ip.auth.deleteTenantApiToken,{tokenId:e}),a=t.filter((t=>t.clientId!==e))),yield Bi($a.setApiTokensState({apiTokensDataTenant:a,deleteTokenDialog:{open:!1,id:e}})),yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!1}))}catch(e){yield Bi($a.setApiTokensError({key:YT.DELETE_API_TOKEN,value:Bg(e)})),yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!1}))}}function*nE({payload:e}){null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));try{var t;const[n=[],a=[]]=yield Wi([$i(Ip.auth.getUserApiTokensData),$i(Ip.auth.getTenantApiTokensData)]);yield Bi($a.setApiTokensState({apiTokensDataUser:n,apiTokensDataTenant:a})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setApiTokensError({key:YT.LOAD_API_TOKENS,value:Bg(t)})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*aE({payload:e}){null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));try{var t,n,a,i;const o=yield null!=(t=$i(Ip.auth.getUserApiTokensData))?t:[],r=(null!=(a=(yield null!=(n=$i(Ip.auth.getUserAccessTokensData))?n:[]).accessTokens)?a:[]).map((e=>x({},e,{type:Pa.AccessToken}))).concat(o.map((e=>x({},e,{type:Pa.ClientCredentials})))).sort(((e,t)=>new Date(t.createdAt)-new Date(e.createdAt)));yield Bi($a.setApiTokensState({apiTokensDataUser:null!=r?r:[]})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(i=e.callback)||i.call(e,!0)}catch(t){var o;yield Bi($a.setApiTokensError({key:YT.LOAD_API_TOKENS,value:Bg(t)})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(o=e.callback)||o.call(e,null,t)}}function*iE({payload:e}){null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));try{var t,n,a,i;const o=yield null!=(t=$i(Ip.auth.getTenantApiTokensData))?t:[],r=yield null!=(n=$i(Ip.auth.getTenantAccessTokensData))?n:[],s=(null!=(a=null==r?void 0:r.accessTokens)?a:[]).map((e=>x({},e,{type:Pa.AccessToken}))).concat(o.map((e=>x({},e,{type:Pa.ClientCredentials})))).sort(((e,t)=>new Date(t.createdAt)-new Date(e.createdAt)));yield Bi($a.setApiTokensState({apiTokensDataTenant:null!=s?s:[]})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(i=e.callback)||i.call(e,!0)}catch(t){var o;yield Bi($a.setApiTokensError({key:YT.LOAD_API_TOKENS,value:Bg(t)})),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(o=e.callback)||o.call(e,null,t)}}function*oE(){yield Wo($a.loadApiTokens,nE),yield Wo($a.loadUserApiTokens,aE),yield Wo($a.loadTenantApiTokens,iE),yield jo($a.addUserApiToken,QT),yield jo($a.addTenantApiToken,ZT),yield Bo($a.deleteTenantApiToken,tE),yield Bo($a.deleteUserApiToken,eE)}function*rE({payload:e}){const{description:t,roleIds:n,callback:a}=e;yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!0}));const{apiTokensDataTenant:i}=yield qi((e=>e.auth.apiTokensState)),o=x({},Hp,{description:t,roleIds:n,clientId:`CLIENT_ID_${Sb()}`});yield Bi($a.setApiTokensState({showAddTokenDialog:!1})),yield Ji(200),yield Bi($a.setApiTokensState({apiTokensDataTenant:[...i,o],successDialog:{open:!0,secret:o.secret,clientId:o.clientId}})),yield Ji(200),yield Bi($a.setApiTokensLoader({key:YT.ADD_API_TOKEN,value:!1})),null==a||a(null)}function*sE({payload:e}){yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!0})),yield Ji(200);const t=[Hp];yield Bi($a.setApiTokensState({apiTokensDataTenant:t.filter((t=>t.clientId!==e)),deleteTokenDialog:{open:!1,clientId:e}})),yield Bi($a.setApiTokensLoader({key:YT.DELETE_API_TOKEN,value:!1}))}function*lE({payload:e}){var t;null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));const n=[Kp],a=[Hp];yield Bi($a.setApiTokensState({apiTokensDataUser:n,apiTokensDataTenant:a})),yield Ji(200),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*cE({payload:e}){var t;null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));const n=[Kp];yield Bi($a.setApiTokensState({apiTokensDataUser:n})),yield Ji(200),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*dE({payload:e}){var t;null!=e&&e.silentLoading||(yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!0})));const n=[Hp];yield Bi($a.setApiTokensState({apiTokensDataTenant:n})),yield Ji(200),yield Bi($a.setApiTokensLoader({key:YT.LOAD_API_TOKENS,value:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}function*uE(){yield Wo($a.loadApiTokens,lE),yield Wo($a.loadUserApiTokens,cE),yield Wo($a.loadTenantApiTokens,dE),yield jo($a.addTenantApiToken,rE),yield Bo($a.deleteTenantApiToken,sE)}function*yE({payload:e}){try{var t;yield Bi($a.setAccountSettingsState({loading:!0}));const{accountSettingsState:n}=yield qi((e=>e.auth)),{address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l}=n,c=yield $i(Ip.accountSettings.updateSettings,x({address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l},e));yield Bi($a.setAccountSettingsState(x({},c,{loading:!1}))),null==(t=e.callback)||t.call(e,c)}catch(t){var n;yield Bi($a.setAccountSettingsState({loading:!1,error:Bg(t)})),null==(n=e.callback)||n.call(e,null,t)}}function*fE({payload:e}){yield Bi($a.setAccountSettingsState({loading:!(null!=e&&e.silentLoading),error:null}));try{const e=yield $i(Ip.accountSettings.getSettings);yield Bi($a.setAccountSettingsState(x({},e,{loading:!1})))}catch(e){yield Bi($a.setAccountSettingsState({loading:!1,error:Bg(e)}))}}function*pE(){yield Wo($a.saveAccountSettings,yE),yield Wo($a.loadAccountSettings,fE)}function*gE({payload:e}){var t;yield Bi($a.setAccountSettingsState({loading:!0})),yield It();const{accountSettingsState:n}=yield qi((e=>e.auth)),{address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l}=n,c=x({address:a,timezone:i,dateFormat:o,timeFormat:r,currency:s,logo:l},e);yield Bi($a.setAccountSettingsState(x({},c,{loading:!1}))),null==(t=e.callback)||t.call(e,c)}function*SE({payload:e}){yield Bi($a.setAccountSettingsState({loading:!(null!=e&&e.silentLoading),error:null})),yield It(),yield Bi($a.setAccountSettingsState({address:"Tel-aviv",timezone:"Asia/Jerusalem",dateFormat:"DD/MM/YYYY",timeFormat:"HH:mm",currency:"USD",loading:!1}))}function*vE(){yield Wo($a.saveAccountSettings,gE),yield Wo($a.loadAccountSettings,SE)}function*hE({payload:{tenantId:e,callback:t}}){yield Bi($a.setState({isLoading:!0}));try{yield $i(Ip.tenants.switchTenant,{tenantId:e}),yield $i(Th),(null==t?void 0:t(!0))||(yield Bi($a.setState({isLoading:!1})))}catch(e){yield Bi($a.setState({isLoading:!1})),null==t||t(!1,e)}}function*mE({payload:e}){yield Bi($a.setTenantsState({loading:!0}));try{var t;const n=yield $i(cs());yield Bi($a.setTenantsState({tenants:n.tenants,activeTenant:n.activeTenant,loading:!1})),null==e||null==(t=e.callback)||t.call(e,[])}catch(t){var n;null==e||null==(n=e.callback)||n.call(e,[],t),yield Bi($a.setTenantsState({loading:!1}))}}function*AE({payload:e}){yield Bi($a.setTenantsState({loading:!0}));try{var t;const n=yield $i(Ip.tenants.getSubTenants);yield Bi($a.setTenantsState({subTenants:n,loading:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setTenantsState({loading:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*bE({payload:e}){yield Bi($a.setTenantsState({loading:!0}));try{var t;const n=yield $i(Ip.tenants.getSubTenantsAsTree);yield Bi($a.setTenantsState({tenantTree:n,loading:!1})),null==e||null==(t=e.callback)||t.call(e,!0)}catch(t){var n;yield Bi($a.setTenantsState({loading:!1})),null==e||null==(n=e.callback)||n.call(e,null,t)}}function*TE(){yield jo($a.loadTenants,mE),yield jo($a.loadSubTenants,AE),yield jo($a.switchTenant,hE),yield jo($a.loadSubTenantsTree,bE)}function*EE(){yield Bi($a.setTenantsState({loading:!0})),yield It(),yield Bi($a.setTenantsState({tenants:Sg,activeTenant:Sg[0],loading:!1}))}function*IE(){yield jo($a.loadTenants,EE)}!function(e){e.LOAD_API_TOKENS="LOAD_API_TOKENS",e.ADD_API_TOKEN="ADD_API_TOKEN",e.DELETE_API_TOKEN="DELETE_API_TOKEN"}(YT||(YT={})),function(e){e.EDIT_ROLE_DIALOG="editRoleDialog",e.DELETE_ROLE_DIALOG="deleteRoleDialog",e.LOAD_ROLES="loadRoles",e.ADD_ROLE="addRole",e.MANAGE_PERMISSIONS="managePermissions"}(XT||(XT={}));const kE=["callback"],OE=["callback"],PE=["callback"],LE=["callback"],wE=["callback"];function*DE({payload:e}){var t;const n=XT.LOAD_ROLES;yield Bi($a.setRolesStateLoader({key:n,value:!(null!=(t=null==e?void 0:e.silentLoading)&&t)}));try{const e=yield Wi([$i(Ip.roles.getRoles),$i(Ip.roles.getPermissions),$i(Ip.roles.getPermissionCategories)]),[t,a,i]=e,{selectedRole:o}=yield qi((e=>e.auth.rolesState)),r=null==t?void 0:t.find((({id:e})=>(null==o?void 0:o.id)===e));yield Bi($a.setRolesState({roles:t,permissions:a,permissionCategories:i,selectedRole:r}))}catch(e){yield Bi($a.setRolesStateError({key:n,value:Bg(e)}))}finally{yield Bi($a.setRolesStateLoader({key:n,value:!1}))}}function*UE(e){let{payload:{callback:t}}=e,n=ii(e.payload,kE);const a=XT.ADD_ROLE;yield Bi($a.setRolesStateLoader({key:a,value:!0}));try{const e=yield $i(Ip.roles.addRole,n),i=yield $i(Ip.roles.getRoles);yield Bi($a.loadRolesAndPermissions({silentLoading:!0})),yield Bi($a.setRolesState({roles:i})),null==t||t(e)}catch(e){yield Bi($a.setRolesStateError({key:a,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setRolesStateLoader({key:a,value:!1}))}}function*CE(e){let{payload:{callback:t}}=e,n=ii(e.payload,OE);const a=XT.ADD_ROLE;yield Bi($a.setRolesStateLoader({key:a,value:!0}));try{const e=yield $i(Ip.roles.addRoleV2,n);yield Bi($a.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Bi($a.setRolesStateError({key:a,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setRolesStateLoader({key:a,value:!1}))}}function*RE(e){let{payload:{callback:t}}=e,n=ii(e.payload,PE);const a=XT.DELETE_ROLE_DIALOG;yield Bi($a.setRolesStateLoader({key:a,value:!0}));try{yield $i(Ip.roles.deleteRole,n),yield Bi($a.loadRolesAndPermissions({silentLoading:!0})),null==t||t(!0)}catch(e){yield Bi($a.setRolesStateError({key:a,value:Bg(e)})),null==t||t(!1,e)}finally{yield Bi($a.setRolesStateLoader({key:a,value:!1}))}}function*_E(e){let{payload:{callback:t}}=e,n=ii(e.payload,LE);const a=XT.EDIT_ROLE_DIALOG;yield Bi($a.setRolesStateLoader({key:a,value:!0}));try{const e=yield $i(Ip.roles.updateRole,n);yield Bi($a.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Bi($a.setRolesStateError({key:a,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setRolesStateLoader({key:a,value:!1}))}}function*NE(e){let{payload:{callback:t}}=e,n=ii(e.payload,wE);const a=XT.MANAGE_PERMISSIONS;yield Bi($a.setRolesStateLoader({key:a,value:!0}));try{const e=yield $i(Ip.roles.attachPermissionsToRole,n);yield Bi($a.loadRolesAndPermissions({silentLoading:!0})),null==t||t(e)}catch(e){yield Bi($a.setRolesStateError({key:a,value:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setRolesStateLoader({key:a,value:!1}))}}function*ME(){yield Wo($a.loadRolesAndPermissions,DE),yield jo($a.addRole,UE),yield jo($a.addRoleV2,CE),yield jo($a.deleteRole,RE),yield jo($a.updateRole,_E),yield jo($a.attachPermissionsToRole,NE)}function*FE({payload:e}){var t;const n=XT.LOAD_ROLES;yield Bi($a.setRolesStateLoader({key:n,value:!(null!=(t=null==e?void 0:e.silentLoading)&&t)}));try{yield Bi($a.setRolesState({roles:qp,permissionCategories:Dg,permissions:wg,selectedRole:qp[2]}))}catch(e){yield Bi($a.setRolesStateError({key:n,value:Bg(e)}))}finally{yield Bi($a.setRolesStateLoader({key:n,value:!1}))}}function*GE(){yield Wo($a.loadRolesAndPermissions,FE)}const xE=["callback"],VE=["callback"],jE=["callback"];function*BE(e){let{payload:{callback:t}}=e,n=ii(e.payload,xE);yield Bi($a.setResetPhoneNumberState({loading:!0}));try{const e=yield $i(Ip.auth.resetPhoneNumber,n);yield Bi($a.setResetPhoneNumberState({loading:!1,error:void 0,resetPhoneNumberToken:e.resetPhoneNumberToken,step:en.VerifyResetPhoneNumber})),yield Bi($a.setLoginState({email:n.email}))}catch(e){yield Bi($a.setResetPhoneNumberState({loading:!1,error:Bg(e)})),null==t||t(null,e)}}function*WE(e){let{payload:{callback:t}}=e,n=ii(e.payload,VE);yield Bi($a.setResetPhoneNumberState({loading:!0}));try{const e=yield $i(Ip.auth.verifyResetPhoneNumber,n);yield Bi($a.setResetPhoneNumberState({loading:!1,error:void 0,changePhoneNumberToken:e.changePhoneNumberToken,step:en.ChangePhoneNumber})),null==t||t(!0)}catch(e){yield Bi($a.setResetPhoneNumberState({loading:!1,error:Bg(e)})),null==t||t(null,e)}}function*zE(e){let{payload:{callback:t}}=e,n=ii(e.payload,jE);yield Bi($a.setResetPhoneNumberState({loading:!0}));try{const{onRedirectTo:e,routes:a}=yield qi((({auth:{onRedirectTo:e,routes:t}})=>({onRedirectTo:e,routes:t})));yield $i(Ip.auth.changePhoneNumber,{phoneNumber:n.phoneNumber,changePhoneNumberToken:n.changePhoneNumberToken}),yield Bi($a.setLoginState({step:wt.loginWithSmsOtc})),yield Bi($a.passwordlessPreLogin({type:Oa.SmsCode,email:n.email,recaptchaToken:n.recaptchaToken})),e(a.loginUrl),yield Bi($a.setResetPhoneNumberState({loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setResetPhoneNumberState({loading:!1,error:Bg(e)})),null==t||t(null,e)}}function*$E(){yield Wo($a.resetPhoneNumber,BE),yield Wo($a.verifyResetPhoneNumber,WE),yield Wo($a.changePhoneNumber,zE)}function*KE(){yield Bi($a.setSessionsState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getCurrentUserSessions);yield Bi($a.setSessionsState({sessions:e,loading:!1}))}catch(e){yield Bi($a.setSessionsState({error:e,loading:!1}))}}function*HE(){yield Bi($a.setSessionsState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getCurrentUserSession);yield Bi($a.setSessionsState({currentSession:e,loading:!1}))}catch(e){yield Bi($a.setSessionsState({error:e,loading:!1}))}}function*qE({payload:{id:e}}){yield Bi($a.setSessionsState({loading:!0,error:null}));try{yield $i(Ip.auth.deleteSessionForUser,e),yield Bi($a.loadUserSessions())}catch(e){yield Bi($a.setSessionsState({error:e,loading:!1}))}}function*JE({payload:{callback:e,userId:t}}){yield Bi($a.setSessionsState({loading:!0,error:null}));try{yield $i(Ip.auth.revokeSessionsForUser,t),null==e||e(!0)}catch(t){yield Bi($a.setSessionsState({error:t,loading:!1})),null==e||e(!1)}}function*YE(){yield Bi($a.setSessionsState({loading:!0,error:null}));try{yield $i(Ip.auth.deleteAllSessionsForUser),yield Bi($a.loadUserSessions())}catch(e){yield Bi($a.setSessionsState({error:e,loading:!1}))}}function*XE(){yield Bo($a.loadUserSessions,KE),yield Bo($a.deleteUserSession,qE),yield Bo($a.deleteAllUserSessions,YE),yield Bo($a.loadCurrentUserSession,HE),yield jo($a.revokeUserSessions,JE)}function*QE(){yield Bi($a.setSessionsState({loading:!0,error:null})),yield Bi($a.setSessionsState({sessions:vg,loading:!1}))}function*ZE({payload:{id:e}}){yield Bi($a.setSessionsState({loading:!0,error:null}));const t=(yield qi((e=>{var t;return null!=(t=e.auth.sessionsState.sessions)?t:[]}))).filter((t=>t.id!==e));yield Bi($a.setSessionsState({sessions:t,loading:!1}))}function*eI(){yield Bi($a.setSessionsState({loading:!0,error:null}));const e=vg.filter((e=>e.current));yield Bi($a.setSessionsState({sessions:e,loading:!1}))}function*tI(){yield Bo($a.loadUserSessions,QE),yield Bo($a.deleteUserSession,ZE),yield Bo($a.deleteAllUserSessions,eI)}const nI=["callback"],aI=["callback"];function*iI(){yield Bi($a.setSessionsPolicyState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getSessionConfigurations);yield Bi($a.setSessionsPolicyState({configurations:e,loading:!1}))}catch(e){yield Bi($a.setSessionsState({error:e,loading:!1}))}}function*oI({payload:e}){yield Bi($a.setSessionsPolicyState({loading:!0,error:null}));try{const{callback:t}=e,n=ii(e,nI);yield $i(Ip.auth.createOrUpdateSessionConfigrations,n),yield Bi($a.loadSessionsPolicy()),null==t||t(!0)}catch(e){yield Bi($a.setSessionsPolicyState({error:e,loading:!1}))}}function*rI(){yield Wo($a.loadSessionsPolicy,iI),yield Bo($a.createOrUpdateSessionsPolicy,tS(oI))}function*sI(){yield Bi($a.setSessionsPolicyState({loading:!0,error:null}));const e=yield qi((e=>{var t,n;return null!=(t=null==e||null==(n=e.auth)?void 0:n.sessionsPolicyState)?t:hg}));yield Bi($a.setSessionsPolicyState(x({},e,{loading:!1})))}function*lI({payload:e}){yield Bi($a.setSessionsPolicyState({loading:!0,error:null}));const{callback:t}=e,n=ii(e,aI);null==t||t(!0),yield Bi($a.setSessionsPolicyState({configurations:n,loading:!1}))}function*cI(){yield Wo($a.loadSessionsPolicy,sI),yield Bo($a.createOrUpdateSessionsPolicy,lI)}const dI=["callback"],uI=["callback"],yI=["callback"],fI=["callback"],pI=["callback"],gI=["callback"],SI=["callback"],vI=["callback"],hI=()=>qi((e=>e.auth.restrictionsState.ipRestrictions)),mI=()=>qi((e=>e.auth.restrictionsState.emailDomainRestrictions));function*AI(){yield Bi($a.setEmailDomainRestrictionsState({loading:!0,error:null}));try{const e=yield $i(Ip.auth.getDomainRestrictionsConfig),t=(yield $i(Ip.auth.getDomainRestrictions)).items.filter((t=>t.type===e.listType));yield Bi($a.setEmailDomainRestrictionsState({data:{restrictions:t,config:e},loading:!1}))}catch(e){yield Bi($a.setEmailDomainRestrictionsState({error:Bg(e),loading:!1}))}}function*bI(e){let{payload:{callback:t}}=e,n=ii(e.payload,dI);yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null}));const a=yield mI();try{var i;yield $i(Ip.auth.createDomainRestriction,n);const e=(yield $i(Ip.auth.getDomainRestrictions)).items.filter((e=>{var t;return e.type===(null==(t=a.data)?void 0:t.config.listType)}));yield Bi($a.setEmailDomainRestrictionsState({data:{config:(null==(i=a.data)?void 0:i.config)||{active:!1,blockPublicDomains:!1,listType:n.type},restrictions:e},saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setEmailDomainRestrictionsState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*TI(e){let{payload:{callback:t}}=e,n=ii(e.payload,uI);yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null}));try{const e=yield $i(Ip.auth.updateDomainRestrictionConfig,n),a=(yield $i(Ip.auth.getDomainRestrictions)).items.filter((t=>t.type===e.listType));yield Bi($a.setEmailDomainRestrictionsState({data:{config:e,restrictions:a},saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setEmailDomainRestrictionsState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*EI({payload:{id:e}}){yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null}));const t=yield mI();try{var n;yield $i(Ip.auth.deleteDomainRestriction,e);const a=(yield $i(Ip.auth.getDomainRestrictions)).items.filter((e=>{var n;return e.type===(null==(n=t.data)?void 0:n.config.listType)}));yield Bi($a.setEmailDomainRestrictionsState({data:{config:(null==(n=t.data)?void 0:n.config)||{active:!1,blockPublicDomains:!1,listType:Kn.ALLOW},restrictions:a},saving:!1}))}catch(e){yield Bi($a.setEmailDomainRestrictionsState({saving:!1,error:Bg(e)}))}}const II=e=>{var t,n,a;return{_filter:null!=(t=null==e?void 0:e._filter)?t:Kn.ALLOW,_limit:null!=(n=null==e?void 0:e._limit)?n:10,_offset:null!=(a=null==e?void 0:e._offset)?a:0}};function*kI(){yield Bi($a.setIpRestrictionsState({loading:!0,error:null}));try{const e=yield hI(),t=yield $i(Ip.auth.getIPRestrictionsConfig),n=II({_filter:t.strategy,_limit:e.pagination._limit,_offset:e.pagination._offset}),{items:a,_metadata:{totalPages:i}}=yield $i(Ip.auth.getIPRestrictions,n);yield Bi($a.setIpRestrictionsState({data:{restrictions:a,config:t},totalPages:i,pagination:n,loading:!1}))}catch(e){yield Bi($a.setIpRestrictionsState({error:Bg(e),loading:!1}))}}function*OI(){try{const{valid:e}=yield $i(Ip.auth.testCurrentIpInAllowList);yield Bi($a.setIpRestrictionsState({userIpValid:e}))}catch(e){yield Bi($a.setIpRestrictionsState({error:Bg(e)}))}}function*PI({payload:{callback:e}}){yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));try{const t=yield qi((e=>e.auth.userIp));yield Wi([$i(Ip.auth.createIPRestriction,{ip:t,isActive:!0,description:"My IP",strategy:Kn.ALLOW}),$i(Ip.auth.updateIPRestrictionConfig,{isActive:!0})]);const n=yield hI(),a=II(n.pagination),{items:i,_metadata:{totalPages:o}}=yield $i(Ip.auth.getIPRestrictions,a);yield Bi($a.setIpRestrictionsState({data:{config:{isActive:!0,strategy:Kn.ALLOW},restrictions:i},userIpValid:!0,pagination:a,totalPages:o,saving:!1})),null==e||e(!0)}catch(t){yield Bi($a.setIpRestrictionsState({saving:!1,error:t})),null==e||e(!1,t)}}function*LI(e){let{payload:{callback:t}}=e,n=ii(e.payload,yI);yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));const a=yield hI();try{var i,o;yield $i(Ip.auth.createIPRestriction,n);const e=yield hI(),r=II(e.pagination),{items:s,_metadata:{totalPages:l}}=yield $i(Ip.auth.getIPRestrictions,r);yield OI(),yield Bi($a.setIpRestrictionsState({data:{config:null!=(i=null==(o=a.data)?void 0:o.config)?i:{isActive:!1,strategy:Kn.ALLOW},restrictions:s},pagination:r,totalPages:l,saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setIpRestrictionsState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*wI(e){let{payload:{callback:t}}=e,n=ii(e.payload,fI);yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));try{yield $i(Ip.auth.updateIPRestrictionConfig,n);const e=yield hI(),a=yield $i(Ip.auth.getIPRestrictionsConfig),i=II(x({},e.pagination,{_filter:a.strategy})),{items:o,_metadata:{totalPages:r}}=yield $i(Ip.auth.getIPRestrictions,i);yield OI(),yield Bi($a.setIpRestrictionsState({data:{config:a,restrictions:o},pagination:i,totalPages:r,saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setIpRestrictionsState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*DI({payload:{id:e,callback:t}}){yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));const n=yield hI();try{var a;yield $i(Ip.auth.deleteIPRestriction,e);const i=yield hI(),o=II(i.pagination),{items:r,_metadata:{totalPages:s}}=yield $i(Ip.auth.getIPRestrictions,o);yield OI(),yield Bi($a.setIpRestrictionsState({data:{config:(null==(a=n.data)?void 0:a.config)||{isActive:!1,strategy:Kn.ALLOW},restrictions:r},pagination:o,totalPages:s,saving:!1})),null==t||t(!0)}catch(e){yield Bi($a.setIpRestrictionsState({saving:!1,error:Bg(e)})),null==t||t(null,e)}}function*UI(){yield Wo($a.loadIpRestrictions,tS(kI)),yield Wo($a.loadEmailDomainRestrictions,tS(AI)),yield jo($a.saveIpRestriction,tS(LI)),yield jo($a.saveIpRestrictionsConfig,tS(wI)),yield jo($a.deleteIpRestriction,tS(DI)),yield jo($a.checkIfUserIpValid,tS(OI)),yield jo($a.addCurrentUserIpAndActivate,tS(PI)),yield jo($a.saveEmailDomainRestriction,tS(bI)),yield jo($a.saveEmailDomainRestrictionsConfig,tS(TI)),yield jo($a.deleteEmailDomainRestriction,tS(EI))}function*CI(){yield Bi($a.setIpRestrictionsState({loading:!0,error:null})),yield Bi($a.setIpRestrictionsState({data:{restrictions:Ag.filter((e=>e.strategy===mg.strategy)),config:mg},totalPages:1,pagination:{_filter:Kn.ALLOW,_limit:50,_offset:0},loading:!1}))}function*RI(){yield Bi($a.setIpRestrictionsState({loading:!0,error:null}));try{const e=yield hI(),t=Ag[0].ip,n=!!e.data.restrictions.find((e=>e.isActive&&e.ip===t));yield Bi($a.setIpRestrictionsState({userIpValid:n,loading:!1}))}catch(e){yield Bi($a.setIpRestrictionsState({error:Bg(e),loading:!1}))}}function*_I(e){var t,n,a;let{payload:{callback:i}}=e,o=ii(e.payload,pI);yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));const r=yield hI(),s=r.data.restrictions.filter((e=>e.ip!==o.ip));yield Bi($a.setIpRestrictionsState({data:{config:null!=(t=null==(n=r.data)?void 0:n.config)?t:{isActive:!1,strategy:Kn.ALLOW},restrictions:[...s,x({},o,{createdAt:new Date,updatedAt:new Date,id:Sb(),isActive:null==(a=o.isActive)||a,strategy:r.data.config.strategy})]},totalPages:1,pagination:{_filter:Kn.ALLOW,_limit:50,_offset:0},saving:!1})),null==i||i(!0)}function*NI(e){var t,n,a;let{payload:{callback:i}}=e,o=ii(e.payload,gI);const r=yield hI();yield Bi($a.setIpRestrictionsState({saving:!0,error:null})),yield Bi($a.setIpRestrictionsState({data:{config:x({},null==(t=r.data)?void 0:t.config,o),restrictions:null!=(n=null==(a=r.data)?void 0:a.restrictions)?n:[]},pagination:{_filter:Kn.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1})),yield Bi($a.setIpRestrictionsState({saving:!1,error:null})),null==i||i(!0)}function*MI({payload:{id:e,callback:t}}){var n;yield Bi($a.setIpRestrictionsState({saving:!0,error:null}));const a=yield hI();yield Bi($a.setIpRestrictionsState({data:{config:(null==(n=a.data)?void 0:n.config)||{isActive:!1,strategy:Kn.ALLOW},restrictions:a.data.restrictions.filter((t=>t.id!==e))},pagination:{_filter:Kn.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1,error:null})),null==t||t(!0)}function*FI(){yield Bi($a.setEmailDomainRestrictionsState({loading:!0,error:null})),yield Bi($a.setEmailDomainRestrictionsState({loading:!1,data:{restrictions:[{domain:"mock.com",id:"1",type:Kn.ALLOW}],config:{active:!0,listType:Kn.ALLOW,blockPublicDomains:!1}}}))}function*GI(e){var t,n;let{payload:{callback:a}}=e,i=ii(e.payload,SI);const o=yield mI();yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null})),yield It(),null==a||a(!0),yield Bi($a.setEmailDomainRestrictionsState({data:{config:(null==(t=o.data)?void 0:t.config)||{active:!1,blockPublicDomains:!1,listType:i.type},restrictions:[...(null==(n=o.data)?void 0:n.restrictions)||[],x({},i,{id:Date.now().toString()})]},saving:!1}))}function*xI(e){var t;let{payload:{callback:n}}=e,a=ii(e.payload,vI);const i=yield mI();yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null})),yield It(),null==n||n(!0),yield Bi($a.setEmailDomainRestrictionsState({data:{config:{active:a.active,blockPublicDomains:a.blockPublicDomains||!1,listType:a.type||Kn.ALLOW},restrictions:[...(null==(t=i.data)?void 0:t.restrictions)||[]]},saving:!1}))}function*VI({payload:{id:e}}){var t,n;const a=yield mI();yield Bi($a.setEmailDomainRestrictionsState({saving:!0,error:null})),yield It(),yield Bi($a.setEmailDomainRestrictionsState({data:{config:(null==(t=a.data)?void 0:t.config)||{active:!1,blockPublicDomains:!1,listType:Kn.ALLOW},restrictions:((null==(n=a.data)?void 0:n.restrictions)||[]).filter((t=>t.id===e))},saving:!1}))}function*jI(){yield Wo($a.loadIpRestrictions,CI),yield Wo($a.loadEmailDomainRestrictions,FI),yield jo($a.saveIpRestriction,_I),yield jo($a.saveIpRestrictionsConfig,NI),yield jo($a.deleteIpRestriction,MI),yield jo($a.checkIfUserIpValid,RI),yield jo($a.saveEmailDomainRestriction,GI),yield jo($a.saveEmailDomainRestrictionsConfig,xI),yield jo($a.deleteEmailDomainRestriction,VI)}const BI=["callback"],WI=["id"];function*zI(e){const{count:t}=yield $i(Ip.directory.countConfigurationUsers,e.id);return x({},e,{count:t})}function*$I(){yield Bi($a.setProvisioningState({loading:!0,error:null}));try{const e=yield $i(Ip.directory.getConfigs),t=yield Wi(e.map((e=>zI(e))));yield Bi($a.setProvisioningState({connections:t,loading:!1}))}catch(e){yield Bi($a.setProvisioningState({error:Bg(e),loading:!1}))}}function*KI(e){let{payload:{callback:t}}=e,n=ii(e.payload,BI);yield Bi($a.setProvisioningState({loading:!0,error:null}));try{const e=yield $i(Ip.directory.createConfiguration,n),a=yield $i(Ip.directory.getConfigs),i=yield Wi(a.map((e=>zI(e))));yield Bi($a.setProvisioningState({connections:i,loading:!1})),null==t||t(e)}catch(e){yield Bi($a.setProvisioningState({error:Bg(e),loading:!1}))}}function*HI(e){let{payload:{id:t}}=e,n=ii(e.payload,WI);yield Bi($a.setProvisioningState({loading:!0,error:null}));try{yield $i(Ip.directory.updateConfiguration,t,n);const e=yield $i(Ip.directory.getConfigs),a=yield Wi(e.map((e=>zI(e))));yield Bi($a.setProvisioningState({connections:a,loading:!1}))}catch(e){yield Bi($a.setProvisioningState({error:Bg(e),loading:!1}))}}function*qI({payload:{id:e,callback:t}}){yield Bi($a.setProvisioningState({loading:!0,error:null}));try{yield $i(Ip.directory.deleteConfiguration,e);const n=yield $i(Ip.directory.getConfigs),a=yield Wi(n.map((e=>zI(e))));yield Bi($a.setProvisioningState({connections:a,loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setProvisioningState({error:Bg(e),loading:!1})),null==t||t(!1,e)}}function*JI(){yield Wo($a.loadProvisionConnections,$I),yield jo($a.createProvisionConnection,KI),yield jo($a.deleteProvisionConnection,qI),yield jo($a.updateProvisionConnection,HI)}const YI=["callback","events"];function*XI(e){let{payload:{callback:t}}=e,n=ii(e.payload,YI);yield Bi($a.setImpersonateState({loading:!0}));try{yield $i(Ip.impersonate.impersonate,n),yield Bi($a.setImpersonateState({step:xa.success})),yield Ji(1e3),yield Lv(),yield Bi($a.resetImpersonateState()),null==t||t(!0)}catch(e){yield Bi($a.setImpersonateState({loading:!1,error:Bg(e)}))}}function*QI(){yield Wo($a.impersonate,XI)}function*ZI({payload:e}){const{callback:t,deviceId:n}=e;yield Bi($a.setPasskeysState({loading:!0}));try{yield $i(Ip.auth.deleteWebAuthnDevice,n);const{devices:e}=yield qi((e=>e.auth.passkeysState)),a=e.filter((e=>e.id!==n));yield Bi($a.setPasskeysState({devices:a,loading:!1})),null==t||t(!0)}catch(e){yield Bi($a.setPasskeysState({loading:!1,error:Bg(e,null)})),null==t||t(null,e)}}function*ek(){yield Bi($a.setPasskeysState({loading:!0}));try{const{devices:e}=yield $i(Ip.auth.getWebAuthnDevices);yield Bi($a.setPasskeysState({devices:e,loading:!1}))}catch(e){yield Bi($a.setPasskeysState({loading:!1,error:Bg(e,null)}))}}function*tk(){yield jo($a.loadWebAuthnDevices,ek),yield jo($a.deleteWebAuthnDevice,ZI)}const nk=["roleIds","userIds"],ak=()=>qi((e=>e.auth.groupsState));function*ik({payload:e}){const t=vb.GET_TEAM_USERS;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{const{items:n}=yield $i(Ip.users.getUsersV2,{_filter:e.filter,_offset:e.pageOffset,_limit:e.pageSize,_includeSubTenants:!1});yield Bi($a.setGroupsState({teamUsers:n}))}catch(e){yield Bi($a.setUsersGroupsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*ok({payload:e}){const t=vb.GET_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{const n=yield $i(Ip.groups.getGroupById,{groupId:e.groupId},{_groupsRelations:hb.rolesAndUsers});yield Bi($a.setGroupsState({selectedGroup:n}))}catch(e){yield Bi($a.setUsersGroupsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*rk(){const e=vb.GET_GROUPS,t=yield ak();yield Bi($a.setUsersGroupsLoader({key:e,value:!0}));try{const{groups:n}=yield $i(Ip.groups.getGroups,{_groupsRelations:hb.rolesAndUsers});yield Bi($a.setGroupsState(x({groups:n},t.selectedGroup&&{selectedGroup:n.find((e=>{var n;return e.id===(null==(n=t.selectedGroup)?void 0:n.id)}))})))}catch(t){yield Bi($a.setUsersGroupsError({key:e,value:Bg(t)}))}finally{yield Bi($a.setUsersGroupsLoader({key:e,value:!1}))}}function*sk({payload:e}){const t=vb.CREATE_GROUP,{roleIds:n,userIds:a}=e,i=ii(e,nk);yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var o;const r=yield $i(Ip.groups.createGroup,x({name:i.name},!!i.description&&{description:i.description},{color:i.color}));null!=a&&a.length&&(yield Bi($a.addUsersToGroup({groupId:r.id,userIds:a}))),null!=n&&n.length&&(yield Bi($a.addRolesToGroup({groupId:r.id,roleIds:n}))),yield Bi($a.loadGroups()),null==e||null==(o=e.callback)||o.call(e,!0)}catch(n){var r;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(r=e.callback)||r.call(e,!1)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*lk({payload:e}){const t=vb.UPDATE_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.updateGroup,e),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*ck({payload:e}){const t=vb.DELETE_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.deleteGroup,e.groupId),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(a=e.callback)||a.call(e,!1,n)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*dk({payload:e}){const t=vb.ADD_ROLES_TO_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.addRolesToGroup,e.groupId,{roleIds:e.roleIds}),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*uk({payload:e}){const t=vb.DELETE_ROLES_FROM_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.deleteRolesFromGroup,e.groupId,{roleIds:e.roleIds}),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*yk({payload:e}){const t=vb.ADD_USERS_TO_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.addUsersToGroup,e.groupId,{userIds:e.userIds}),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;null==e||null==(a=e.callback)||a.call(e,!1),yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)}))}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*fk({payload:e}){const t=vb.DELETE_USERS_FROM_GROUP;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{var n;yield $i(Ip.groups.deleteUsersFromGroup,e.groupId,{userIds:e.userIds}),yield Bi($a.loadGroups()),null==e||null==(n=e.callback)||n.call(e,!0)}catch(n){var a;yield Bi($a.setUsersGroupsError({key:t,value:Bg(n)})),null==e||null==(a=e.callback)||a.call(e,!1)}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*pk(){const e=vb.GET_GROUP_CONFIGURATION;yield Bi($a.setUsersGroupsLoader({key:e,value:!0}));try{const t=yield $i(Ip.groups.getGroupConfiguration);yield Bi($a.setGroupsState({groupsConfiguration:t}))}catch(t){yield Bi($a.setUsersGroupsError({key:e,value:Bg(t)}))}finally{yield Bi($a.setUsersGroupsLoader({key:e,value:!1}))}}function*gk({payload:e}){const t=vb.UPDATE_GROUP_CONFIGURATION;yield Bi($a.setUsersGroupsLoader({key:t,value:!0}));try{yield $i(Ip.groups.updateGroupConfiguration,e),yield Bi($a.getGroupConfiguration())}catch(e){yield Bi($a.setUsersGroupsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}}function*Sk(){yield Bo($a.loadGroups,rk),yield Bo($a.getGroupById,ok),yield Bo($a.createGroup,sk),yield Bo($a.updateGroup,lk),yield Bo($a.deleteGroup,ck),yield Bo($a.addRolesToGroup,dk),yield Bo($a.deleteRolesFromGroup,uk),yield Bo($a.addUsersToGroup,yk),yield Bo($a.deleteUsersFromGroup,fk),yield Bo($a.getGroupConfiguration,pk),yield Bo($a.updateGroupConfiguration,gk),yield Bo($a.getTeamUsers,ik)}function*vk(){const e=vb.GET_GROUPS;yield Bi($a.setUsersGroupsLoader({key:e,value:!0}));const t=Eg;yield Bi($a.setGroupsState({groups:t})),yield Bi($a.setUsersGroupsLoader({key:e,value:!1}))}function*hk({payload:e}){var t;const n=vb.CREATE_GROUP,{groups:a}=yield ak();yield Bi($a.setUsersGroupsLoader({key:n,value:!0})),yield Bi($a.setGroupsState({groups:[x({},e,{id:`${e.name}ID`,managedBy:vp.FRONTEGG}),...null!=a?a:[]]})),yield Ji(500),null==e||null==(t=e.callback)||t.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:n,value:!1}))}function*mk({payload:e}){var t,n,a,i,o;const r=vb.UPDATE_GROUP,s=yield ak();yield Bi($a.setUsersGroupsLoader({key:r,value:!0})),yield Bi($a.setGroupsState({groups:null==s||null==(t=s.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?x({},e,{id:e.groupId,name:null!=(n=null==e?void 0:e.name)?n:"",managedBy:vp.FRONTEGG}):t})),selectedGroup:x({},null==s?void 0:s.selectedGroup,{name:null!=(n=null==e?void 0:e.name)?n:"",color:null!=(a=null==e?void 0:e.color)?a:"",description:null!=(i=null==e?void 0:e.description)?i:""})})),yield Ji(500),null==e||null==(o=e.callback)||o.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:r,value:!1}))}function*Ak({payload:e}){var t,n;const a=vb.DELETE_GROUP,i=yield ak();yield Bi($a.setUsersGroupsLoader({key:a,value:!0})),yield Bi($a.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.filter((t=>t.id!==e.groupId))})),yield Ji(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:a,value:!1}))}function*bk({payload:e}){var t,n;const a=vb.ADD_ROLES_TO_GROUP,i=yield ak();yield Bi($a.setUsersGroupsLoader({key:a,value:!0})),yield Bi($a.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?x({},t,{roles:[...null!=(n=null==t?void 0:t.roles)?n:[],...e.roleIds.map((e=>({id:e,name:e})))]}):t}))})),yield Ji(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:a,value:!1}))}function*Tk({payload:e}){var t,n;const a=vb.DELETE_ROLES_FROM_GROUP,i=yield ak();yield Bi($a.setUsersGroupsLoader({key:a,value:!0})),yield Bi($a.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?x({},t,{roles:null==t||null==(n=t.roles)?void 0:n.filter((t=>!e.roleIds.includes(t.id)))}):t}))})),yield Ji(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:a,value:!1}))}function*Ek({payload:e}){var t,n;const a=vb.ADD_USERS_TO_GROUP,i=yield ak();yield Bi($a.setUsersGroupsLoader({key:a,value:!0})),yield Bi($a.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?x({},t,{users:[...null!=(n=null==t?void 0:t.users)?n:[],...e.userIds.map((e=>({id:e,name:e})))]}):t}))})),yield Ji(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:a,value:!1}))}function*Ik({payload:e}){var t,n;const a=vb.DELETE_USERS_FROM_GROUP,i=yield ak();yield Bi($a.setUsersGroupsLoader({key:a,value:!0})),yield Bi($a.setGroupsState({groups:null==i||null==(t=i.groups)?void 0:t.map((t=>{var n;return t.id===e.groupId?x({},t,{users:null==t||null==(n=t.users)?void 0:n.filter((t=>!e.userIds.includes(t.id)))}):t}))})),yield Ji(500),null==e||null==(n=e.callback)||n.call(e,!0),yield Bi($a.setUsersGroupsLoader({key:a,value:!1}))}function*kk(){const e=vb.GET_GROUP_CONFIGURATION,{groupsConfiguration:t}=yield ak();yield Bi($a.setUsersGroupsLoader({key:e,value:!0})),t&&(yield Bi($a.setGroupsState({groupsConfiguration:x({},t)}))),yield Bi($a.setUsersGroupsLoader({key:e,value:!1}))}function*Ok({payload:e}){const t=vb.UPDATE_GROUP_CONFIGURATION,{groupsConfiguration:n}=yield ak();yield Bi($a.setUsersGroupsLoader({key:t,value:!0})),n&&(yield Bi($a.setGroupsState({groupsConfiguration:x({},n,e)}))),yield Bi($a.setUsersGroupsLoader({key:t,value:!1}))}function*Pk(){yield Bo($a.loadGroups,vk),yield Bo($a.createGroup,hk),yield Bo($a.updateGroup,mk),yield Bo($a.deleteGroup,Ak),yield Bo($a.addRolesToGroup,bk),yield Bo($a.deleteRolesFromGroup,Tk),yield Bo($a.addUsersToGroup,Ek),yield Bo($a.deleteUsersFromGroup,Ik),yield Bo($a.getGroupConfiguration,kk),yield Bo($a.updateGroupConfiguration,Ok)}let Lk;!function(e){e.GET_ACCOUNTS="GET_ACCOUNTS",e.SEARCH_ACCOUNTS="SEARCH_ACCOUNTS",e.SET_ROOT_ACCOUNT_DATA="SET_ROOT_ACCOUNT_DATA",e.SET_SELECTED_SUB_ACCOUNT_DATA="SET_SELECTED_SUB_ACCOUNT_DATA",e.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT="LOAD_NUMBER_OF_USERS_FOR_ACCOUNT",e.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER="UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER",e.CREATE_SUB_ACCOUNT="CREATE_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT="UPDATE_SUB_ACCOUNT",e.DELETE_SUB_ACCOUNT="DELETE_SUB_ACCOUNT",e.GET_ACCOUNT_USERS="GET_ACCOUNT_USERS",e.ADD_USERS_TO_ACCOUNT="ADD_USERS_TO_ACCOUNT",e.DELETE_USERS_FROM_ACCOUNT="DELETE_USERS_FROM_ACCOUNT",e.SET_USER_ROLES_FOR_SUB_ACCOUNT="SET_USER_ROLES_FOR_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT_SETTINGS="UPDATE_SUB_ACCOUNT_SETTINGS",e.GET_USER_JWT="GET_USER_JWT",e.GET_TEAM_USERS="GET_TEAM_USERS"}(Lk||(Lk={}));const wk=(e,t,n)=>{var a,i;return e.tenantId===t?x({},e,{name:n}):x({},e,{children:null!=(a=null==e||null==(i=e.children)?void 0:i.map((e=>wk(e,t,n))))?a:[]})};function Dk(e,t){var n;return x({},e,{children:null!=(n=e.children)&&n.length?e.children.filter((e=>e.tenantId!==t)).map((e=>Dk(e,t))):[]})}function Uk(e,t,n){var a,i;if(e.tenantId===t){var o;const t=[...null!=(o=null==e?void 0:e.children)?o:[],...n].filter(((e,t,n)=>t===n.findIndex((t=>t.tenantId===e.tenantId))));return x({},e,{children:t})}return x({},e,{children:null!=(a=null==e||null==(i=e.children)?void 0:i.map((e=>Uk(e,t,n))))?a:[]})}const Ck=({items:e},t)=>e.map((e=>{var n,a;return{name:e.name,tenantId:e.tenantId,numberOfUsers:null!=(n=null==(a=t.find((t=>t.tenantId===e.tenantId)))?void 0:a.totalUsers)?n:0,createdAt:e.createdAt,metadata:e.metadata}})),Rk=()=>qi((e=>e.auth.allAccountsState));function*_k({payload:e}){const t=Lk.GET_ACCOUNTS;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{accountsQueryParams:n}=yield Rk(),{jwt:a,_limit:i,_offset:o}=e,r={_offset:null!=o?o:n._offset,_limit:null!=i?i:n._limit,_subTenantId:null==e?void 0:e._subTenantId};try{if(a){var s;const{selectedAccount:t}=yield Rk(),{items:n,_links:i}=yield $i(Ip.tenants.searchSubTenants,r,{jwt:a}),o=yield $i(Ip.tenants.getTenantsUsersCount,{tenantIds:n.map((e=>e.tenantId))},{jwt:a}),l=Ck({items:n},o),c=Uk(t.accounts?t.accounts:t,null!=(s=null==e?void 0:e._subTenantId)?s:"",l.map((e=>({name:e.name,tenantId:e.tenantId,numberOfUsers:e.numberOfUsers,createdAt:e.createdAt,metadata:e.metadata,children:[],loadMoreLink:null==i?void 0:i.next}))));yield Bi($a.setSelectedAccountState({accounts:c}))}else{var l;const{accounts:t}=yield Rk(),{items:n,_links:a}=yield $i(Ip.tenants.searchSubTenants,r),i=yield $i(Ip.tenants.getTenantsUsersCount,{tenantIds:n.map((e=>e.tenantId))}),o=Ck({items:n},i),s=Uk(t,null!=(l=null==e?void 0:e._subTenantId)?l:"",o.map((e=>({name:e.name,tenantId:e.tenantId,numberOfUsers:e.numberOfUsers,createdAt:e.createdAt,metadata:e.metadata,children:[],loadMoreLink:null==a?void 0:a.next}))));yield Bi($a.setAllAccountsState({accounts:s}))}}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Nk({payload:e}){const t=Lk.SEARCH_ACCOUNTS;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{rootAccount:n}=yield Rk(),{jwt:a}=e;try{if(null!=e&&e._subTenantId){var i;const{items:t}=yield $i(Ip.tenants.searchSubTenants,{_offset:0,_limit:50,_filter:null!=(i=null==e?void 0:e._filter)?i:"",_subTenantId:e._subTenantId},{jwt:a});yield Bi($a.setAllAccountsState({searchAccountsData:[...t,{name:n.name,tenantId:n.tenantId}]}))}}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Mk({payload:e}){const t=Lk.GET_USER_JWT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{tenantId:n,callback:a}=e;try{const e=yield $i(Ip.users.GetUserJwt,{tenantId:n});yield Bi($a.setSelectedAccountState({userJwt:e,accessPermission:!0})),null==a||a(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),yield Bi($a.setSelectedAccountState({accessPermission:!1})),null==a||a(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Fk({payload:e}){const t=Lk.CREATE_SUB_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{name:n,parentTenantId:a,tenantId:i,jwt:o,callback:r}=e;try{if(o){const{accounts:e}=yield Rk(),{selectedAccount:t}=yield Rk(),r=yield $i(Ip.subTenants.createSubTenant,{name:n,parentTenantId:a,tenantId:i},{jwt:o}),s=Uk(e,null!=a?a:"",[{name:r.name,tenantId:r.tenantId,numberOfUsers:0,createdAt:new Date}]),l=Uk(x({name:"",tenantId:""},null==t?void 0:t.accounts),null!=a?a:"",[{name:r.name,tenantId:r.tenantId,numberOfUsers:0,createdAt:new Date}]);yield Bi($a.setAllAccountsState({accounts:s})),yield Bi($a.setSelectedAccountState({accounts:l}))}else{const{accounts:e}=yield Rk(),t=yield $i(Ip.subTenants.createSubTenant,{name:n,tenantId:i,parentTenantId:a}),o=Uk(e,null!=a?a:"",[{name:t.name,tenantId:t.tenantId,numberOfUsers:0,createdAt:new Date}]);yield Bi($a.setAllAccountsState({accounts:o}))}null==r||r(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==r||r(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Gk({payload:e}){const t=Lk.DELETE_SUB_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{jwt:n,tenantId:a,callback:i}=e;try{if(n){const{selectedAccount:e,accounts:t}=yield Rk();yield $i(Ip.subTenants.deleteSubTenant,a,{jwt:n});const i=Dk(t,a),o=Dk(null==e?void 0:e.accounts,a);yield Bi($a.setAllAccountsState({accounts:i})),yield Bi($a.setSelectedAccountState({accounts:o}))}else{const{accounts:e}=yield Rk();yield $i(Ip.subTenants.deleteSubTenant,a);const t=Dk(e,a);yield Bi($a.setAllAccountsState({accounts:t}))}null==i||i(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==i||i(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*xk({payload:e}){const t=Lk.UPDATE_SUB_ACCOUNT_SETTINGS;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{jwt:n,name:a,callback:i,tenantId:o}=e;try{if(n){const{selectedAccount:e,accounts:t}=yield Rk();yield $i(Ip.subTenants.updateSubTenant,{tenantId:o},{name:a},{jwt:n});const i=wk(e.accounts,o,a);yield Bi($a.setSelectedAccountState({name:a,accounts:i}));const r=wk(t,o,a);yield Bi($a.setAllAccountsState({accounts:r}))}else{const{accounts:e}=yield Rk();yield $i(Ip.subTenants.updateSubTenant,{tenantId:o},{name:a});const t=wk(e,o,a);yield Bi($a.setAllAccountsState({accounts:t}))}null==i||i(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==i||i(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Vk({payload:e}){const t=Lk.DELETE_USERS_FROM_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{userId:n,subTenants:a,jwt:i,callback:o}=e;try{yield $i(Ip.subTenants.removeUserFromTenantAndSubTenants,{userId:n,subTenants:a},{jwt:i}),yield Bi($a.getAccountUsers({jwt:i,_tenantId:a[0].tenantId})),null==o||o(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==o||o(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*jk({payload:e}){const t=Lk.SET_USER_ROLES_FOR_SUB_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{userId:n,subTenantsRoles:a,jwt:i,callback:o}=e,{selectedAccount:r}=yield Rk();try{yield $i(Ip.subTenants.setUserRolesForSubTenants,n,{subTenantsRoles:a},{jwt:i}),yield Bi($a.getAccountUsers({jwt:i,_tenantId:r.tenantId})),null==o||o(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==o||o(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Bk({payload:e}){const t=Lk.ADD_USERS_TO_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{users:n,tenantId:a,jwt:i,callback:o,allowSubAccountAccess:r=!1,roleIds:s}=e;try{yield $i(Ip.subTenants.addUsersToSubTenant,{users:n,tenantId:a,allowSubAccountAccess:r,roleIds:s},{jwt:i}),yield Bi($a.getAccountUsers({jwt:i,_tenantId:a})),null==o||o(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==o||o(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Wk({payload:e}){const t=Lk.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{selectedAccount:n}=yield Rk(),{userId:a,allowAccess:i,jwt:o,callback:r}=e;try{var s;yield $i(Ip.subTenants.updateSubAccountAccess,a,{allowAccess:i},{jwt:o}),yield Bi($a.setSelectedAccountState({users:null==n||null==(s=n.users)?void 0:s.map((e=>e.id===a?x({},e,{subAccountAccessAllowed:i}):e))})),null==r||r(!0)}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)})),null==r||r(!1)}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*zk({payload:e}){var t,n,a,i,o,r,s,l;const c=Lk.GET_ACCOUNT_USERS;yield Bi($a.setAllAccountsLoader({key:c,value:!0}));const d=yield Rk(),{jwt:u,_tenantId:y,_email:f}=e,p=null!=(t=null!=(n=null==e?void 0:e._offset)?n:null==d||null==(a=d.selectedAccount)||null==(i=a.usersQueryParams)?void 0:i._offset)?t:0,g=null!=(o=null!=(r=null==e?void 0:e._limit)?r:null==d||null==(s=d.selectedAccount)||null==(l=s.usersQueryParams)?void 0:l._limit)?o:10,S=x({_offset:p,_limit:g,_tenantId:y,_includeSubTenants:!1},!!f&&{_email:f});try{const{items:e,_metadata:{totalItems:t,totalPages:n}}=yield $i(Ip.users.getUsersV3,S,{jwt:u}),a={totalUsersItems:t,totalUsersPages:n,usersQueryParams:x({_offset:null!=p?p:0,_limit:null!=g?g:10},!!f&&{_email:f})};if(e.length){const t=e.map((e=>e.id)),n=yield $i(Ip.roles.getRoles),i=yield $i(Ip.users.getUsersRoles,{ids:t},{jwt:u}),o=e.map((e=>{var t,a;const o=null==i||null==(t=i.find((t=>t.userId===e.id)))?void 0:t.roleIds;return x({},e,{roles:null!=(a=null==o?void 0:o.map((e=>{var t;return null!=(t=null==n?void 0:n.find((t=>t.id===e)))?t:[]})))?a:[]})}));yield Bi($a.setSelectedAccountState(x({users:o},a)))}else yield Bi($a.setSelectedAccountState(x({users:[]},a)))}catch(e){yield Bi($a.setAllAccountsError({key:c,value:Bg(e)}))}finally{yield Bi($a.setAllAccountsLoader({key:c,value:!1}))}}function*$k({payload:e}){const t=Lk.SET_SELECTED_SUB_ACCOUNT_DATA;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{jwt:n}=e;try{var a,i,o,r,s,l,c;const e=yield $i(Ip.accountSettings.getSettings,{jwt:n}),d=yield $i(Ip.tenants.getTenantsUsersCount,{tenantIds:[null!=(a=null==e?void 0:e.tenantId)?a:""]},{jwt:n}),u=yield $i(Ip.tenants.getParentTenants,{jwt:n}),y=yield $i(Ip.tenants.getHierarchyMetadata,{_tenantIds:[null!=(i=null==e?void 0:e.tenantId)?i:""]},{jwt:n});yield Bi($a.setSelectedAccountState({tenantId:null!=(o=e.tenantId)?o:"",name:e.name,numberOfUsersObject:d[0],parentsAccounts:u,numberOfSubAccounts:null==(r=y[0])?void 0:r.totalSubTenants,accountSettings:e,accounts:{name:e.name,tenantId:null!=(s=e.tenantId)?s:"",numberOfUsers:null==(l=d[0])?void 0:l.totalUsers,createdAt:void 0,children:[]}})),yield Bi($a.getAccountUsers({jwt:n,_tenantId:null!=(c=null==e?void 0:e.tenantId)?c:""}))}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*Kk(){const e=Lk.SET_ROOT_ACCOUNT_DATA;yield Bi($a.setAllAccountsLoader({key:e,value:!0}));const{activeTenant:t}=yield qi((e=>e.auth.tenantsState)),{accounts:n}=yield Rk();if(t)try{var a;const i=yield $i(Ip.tenants.getTenantsUsersCount,{tenantIds:[null==t?void 0:t.tenantId]}),o={name:null==t?void 0:t.name,tenantId:null==t?void 0:t.tenantId,numberOfUsers:null==(a=i[0])?void 0:a.totalUsers,createdAt:null==t?void 0:t.createdAt};yield Bi($a.setAllAccountsState({rootAccount:o,accounts:x({},n,o)}))}catch(t){yield Bi($a.setAllAccountsError({key:e,value:Bg(t)}))}finally{yield Bi($a.setAllAccountsLoader({key:e,value:!1}))}}function*Hk({payload:e}){const t=Lk.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT;yield Bi($a.setAllAccountsLoader({key:t,value:!0}));const{tenantId:n,jwt:a}=e;try{const e=yield $i(Ip.tenants.getTenantsUsersCount,{tenantIds:[n]},{jwt:a});yield Bi($a.setSelectedAccountState({numberOfUsersObject:e[0]}))}catch(e){yield Bi($a.setAllAccountsError({key:t,value:Bg(e)}))}finally{yield Bi($a.setAllAccountsLoader({key:t,value:!1}))}}function*qk(){yield Bo($a.loadAccounts,_k),yield Bo($a.searchAccounts,Nk),yield Bo($a.updateSubAccountAccessForUser,Wk),yield Bo($a.getUserJwtForSubAccount,Mk),yield Bo($a.createSubAccount,Fk),yield Bo($a.deleteSubAccount,Gk),yield Bo($a.updateSubAccountSettings,xk),yield Bo($a.addUsersToAccount,Bk),yield Bo($a.deleteUsersFromAccount,Vk),yield Bo($a.setUserRolesForSubAccount,jk),yield Bo($a.getAccountUsers,zk),yield Bo($a.setRootAccountData,Kk),yield Bo($a.setSelectedSubAccountData,$k),yield Bo($a.loadNumberOfUsersForSelectedSubAccount,Hk)}const Jk=["callback"],Yk=["callback"],Xk=["callback","phoneId"],Qk=["callback","phoneId"],Zk=["callback"];function*eO(){yield Bi($a.setSmsState({loading:!0}));const e={_limit:10,_offset:0};try{const{items:t}=yield $i(Ip.userPhoneNumbers.getUserPhoneNumbers,e);yield Bi($a.setSmsState({phoneNumbers:t}))}catch(e){yield Bi($a.setSmsState({error:Bg(e)}))}finally{yield Bi($a.setSmsState({loading:!1}))}}function*tO(e){let{payload:{callback:t}}=e,n=ii(e.payload,Jk);yield Bi($a.setSmsState({loading:!0}));try{const e=yield $i(Ip.userPhoneNumbers.createPhoneNumber,n);yield Bi($a.setSmsState({otcToken:e.otcToken})),yield $i(eO),null==t||t(!0)}catch(e){yield Bi($a.setSmsState({error:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSmsState({loading:!1}))}}function*nO(e){let{payload:{callback:t}}=e,n=ii(e.payload,Yk);yield Bi($a.setSmsState({loading:!0}));try{yield $i(Ip.userPhoneNumbers.verifyPhoneNumber,n),yield $i(eO),null==t||t(!0)}catch(e){yield Bi($a.setSmsState({error:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSmsState({loading:!1}))}}function*aO(e){let{payload:{callback:t,phoneId:n}}=e;ii(e.payload,Xk),yield Bi($a.setSmsState({loading:!0}));try{const e=yield $i(Ip.userPhoneNumbers.deletePhoneNumber,n);yield Bi($a.setSmsState({otcToken:e.otcToken})),null==t||t(!0)}catch(e){yield Bi($a.setSmsState({error:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSmsState({loading:!1}))}}function*iO(e){let{payload:{callback:t,phoneId:n}}=e,a=ii(e.payload,Qk);yield Bi($a.setSmsState({loading:!0}));try{yield $i(Ip.userPhoneNumbers.verifyDeletePhoneNumber,n,a),yield $i(eO),null==t||t(!0)}catch(e){yield Bi($a.setSmsState({error:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSmsState({loading:!1}))}}function*oO(e){let{payload:{callback:t}}=e,n=ii(e.payload,Zk);yield Bi($a.setSmsState({loading:!0}));try{const e=yield $i(Ip.userPhoneNumbers.preVerifyPhoneNumber,n);yield Bi($a.setSmsState({otcToken:e.otcToken})),null==t||t(!0)}catch(e){yield Bi($a.setSmsState({error:Bg(e)})),null==t||t(null,e)}finally{yield Bi($a.setSmsState({loading:!1}))}}function*rO(){yield jo($a.loadPhoneNumbers,eO),yield jo($a.setUpPhoneNumber,tO),yield jo($a.verifyPhoneNumber,nO),yield jo($a.deletePhoneNumber,aO),yield jo($a.verifyDeletePhoneNumber,iO),yield jo($a.preVerifyPhoneNumber,oO)}function*sO(e){yield $i(Av,e),yield $i(wv)}function*lO({mfaToken:e,mfaDevices:t}){yield Bi($a.setStepUpState({mfaDevices:t,mfaToken:e}));const n=yield $i(xg,t);yield Bi($a.setMfaState({step:n}))}function*cO(e){if((e=>"MFA is not enrolled"===(null==e?void 0:e.message))(e))return void(yield Bi($a.setMfaState({step:un.noMFAEnrolledStepUp})));window.localStorage.setItem(Ev,"true");const{routes:t}=yield qi((e=>e.auth));zo.onRedirectTo(t.logoutUrl,{preserveQueryParams:!0})}function*dO({payload:{maxAge:e,callback:t}}){yield Bi($a.setStepUpState({mfaDevices:void 0,mfaToken:""}));try{const n=yield $i(Ip.auth.generateStepupSession,{maxAge:e});n.user?yield $i(sO,n):yield $i(lO,n),null==t||t(!0)}catch(e){null==t||t(!1),yield $i(cO,e)}}function*uO({payload:e}){const t={acr_values:bv},{maxAge:n}=e||{};void 0!==n&&(t.max_age=n.toString());const a=yield qi((({auth:e})=>{var t,n;return null==(t=e.tenantsState)||null==(n=t.activeTenant)?void 0:n.alias}));a&&(t.organization=a),kv(),window.localStorage.setItem(Ev,"true"),yield Mh(t)}function*yO({payload:e}){yield _v(e,$a.setStepUpState,!0)}function*fO({payload:e}){yield Hv(e,$a.setStepUpState)}function*pO({payload:e}){yield qv(e,$a.setStepUpState,!0)}function*gO({payload:e}){yield jv(e,$a.setStepUpState)}function*SO({payload:e}){yield Bv(e,$a.setStepUpState,!0)}function*vO({payload:e}){yield eh(e,$a.setStepUpState)}function*hO({payload:e}){yield Zv(e,$a.setStepUpState)}function*mO(){yield Wo($a.stepUpHostedLogin,uO),yield Wo($a.generateStepUpSession,dO),yield Wo($a.stepUpWithAuthenticator,yO),yield Wo($a.preVerifyMFASMSForStepUp,gO),yield Wo($a.verifyMFASMSForStepUp,SO),yield Wo($a.preVerifyMFAWebAuthnForStepUp,fO),yield Wo($a.verifyMFAWebAuthnForStepUp,pO),yield Wo($a.verifyMFAEmailCodeForStepUp,vO),yield Wo($a.preVerifyMFAEmailCodeForStepUp,hO)}const AO={sagas:function*(){yield Wi([$i(lm),$i(mO),$i(rb),$i(lb),$i(YA),$i($E),$i(Im),$i(Qm),$i(iA),$i(Qg),$i(MA),$i(OT),$i(Sk),$i(JT),$i(ov),$i(oE),$i(VS),$i(pE),$i(TE),$i(ME),$i(XE),$i(rI),$i(UI),$i(JI),$i(QI),$i(tk),$i(qk),$i(vv),$i(dS),$i(rO),$i(Ob)])},mockSagas:function*(){yield Wi([$i(um),$i(Um),$i(lA),$i($A),$i(jT),$i(uE),$i(ZS),$i(tI),$i(vE),$i(IE),$i(cI),$i(jI),$i(GE),$i(Pk),$i(vS)])},storeName:Nt,initialState:Ga,reducer:Wa,actions:$a},bO=e=>({prepare:e=>({payload:e}),reducer:(t,{payload:n})=>x({},t,{[e]:x({},t[e],n)})}),TO={loading:!0,pageOffset:0,pageSize:20,logs:[],sort:[],filter:[],totalPages:0,isDownloadingCsv:!1},EO={setAuditLogsState:bO("auditLogsState"),resetAuditLogsState:e=>x({},e,{auditLogsState:TO})},IO={exportAuditsCsv:ft("auditLogs/exportAuditsCsv"),loadAuditLogs:ft("auditLogs/loadAuditLogs",(e=>({payload:e})))},kO={loading:!0},OO={setAuditsMetadataState:bO("auditsMetadataState"),resetAuditsMetadataState:e=>x({},e,{auditsMetadataState:kO})},PO={loadAuditsMetadata:ft("auditLogs/loadAuditsMetadata")},LO={auditLogsState:TO,auditsMetadataState:kO},{reducer:wO,actions:DO}=gt({name:Ft,initialState:LO,reducers:x({resetState:e=>x({},e,LO),setState:(e,{payload:t})=>x({},e,t)},EO,OO)}),UO=x({},DO,IO,PO),CO=e=>"createdAt"!==e.id,RO={total:20,data:Array.from(Array(5).keys()).map((e=>x({ip:"198.143.51.1",user:"Demo User Name",email:"demo-user@frontegg.com"},(()=>{switch(Math.floor(6*Math.random())){case 0:return{action:"Updated profile",description:"User updated profile details",severity:"Info"};case 1:return{action:"User logged in",severity:"Info",description:"User logged in to the product"};case 2:return{action:"User failed to login",severity:"High",description:"User failed to login with password"};case 3:return{action:"Added user",severity:"Info",description:"Added user david+535@frontegg.com to tenant"};case 4:return{action:"Assigned roles",severity:"Info",description:"Assigned 0 roles for user"};case 5:return{action:"Removed user david+108@frontegg.com from account",severity:"Info",description:"Removed access from the account for user david+108@frontegg.com"}}})(),{json:{key1:"value1",key2:"value2",key3:"value3",key4:"value4"},tenantId:"my-tenant-id",vendorId:"my-vendor-id",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",createdAt:`2022-04-07 10:${50-e}:40.201`})))},_O={properties:[{showInTable:!0,name:"createdAt",displayName:"Time",type:"Timestamp",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!1},{showInTable:!0,name:"email",displayName:"User",type:"Email",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"action",displayName:"Action",type:"AlphaNumeric",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!0,name:"description",type:"AlphaNumeric",sortable:!1,filterable:!1,displayName:"Description",isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"ip",displayName:"IP Address",type:"IpAddress",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"severity",displayName:"Severity",type:"Severity",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"userAgent",displayName:"User Agent",type:"AlphaNumeric",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!1,name:"json",type:"Json",sortable:!0,filterable:!0,displayName:"Json Data",showInMoreInfo:"Always",isPredefined:!1}]},NO=()=>qi((e=>e.auditLogs.auditLogsState)),MO=()=>qi((e=>e.auditLogs.auditsMetadataState));function*FO(){const e=yield NO(),{columns:t}=yield MO();try{const n=e.filter,a=e.sort.reduce(((e,t)=>x({},e,{sortBy:t.id,sortDirection:t.desc?"desc":"asc"})),{}),i=n.reduce(((e,t)=>x({},e,{[t.id]:t.value})),{});yield Bi(UO.setAuditLogsState({isDownloadingCsv:!0}));const o="audits.csv";yield Ip.audits.exportAudits(x({endpoint:"csv/v2",headerProps:t,offset:0,outputFileName:o},a,i))}catch(e){console.error("failed to export audits - ",e)}yield Bi(UO.setAuditLogsState({isDownloadingCsv:!1}))}function*GO({payload:e}){yield Bi(UO.setAuditLogsState({loading:!(null!=e&&e.silentLoading),error:null}));const t=yield NO(),{columns:n}=yield MO();try{var a,i,o,r,s;const l=null!=(a=e.pageSize)?a:t.pageSize,c=null!=(i=e.pageOffset)?i:t.pageOffset,d=null!=(o=e.filter)?o:t.filter,u=null!=(r=e.sort)?r:t.sort;yield Bi(UO.setAuditLogsState({pageSize:l,pageOffset:c,filter:d,sort:u}));const y=u.reduce(((e,t)=>x({},e,{sortBy:t.id,sortDirection:t.desc?"desc":"asc"})),{}),f=d.reduce(((e,t)=>x({},e,{[t.id]:t.value})),{});n||(yield Bi(UO.loadAuditsMetadata()));const{data:p,total:g}=yield $i(Ip.audits.getAudits,x({offset:c,count:l},y,f));yield Bi(UO.setAuditLogsState({loading:!1,logs:null!=p?p:[],totalPages:+Math.ceil(g/l)})),null==e||null==(s=e.callback)||s.call(e,!0)}catch(t){var l;yield Bi(UO.setAuditLogsState({loading:!1,error:Bg(t)})),null==e||null==(l=e.callback)||l.call(e,null,t)}}function*xO(){yield jo(UO.exportAuditsCsv,FO),yield jo(UO.loadAuditLogs,GO)}function*VO({payload:e}){yield Bi(UO.setAuditLogsState({loading:!(null!=e&&e.silentLoading),error:null}));const t=yield NO(),{columns:n}=yield MO();try{var a,i,o,r,s;const l=null!=(a=e.pageSize)?a:t.pageSize,c=null!=(i=e.pageOffset)?i:t.pageOffset,d=null!=(o=e.filter)?o:t.filter,u=null!=(r=e.sort)?r:t.sort;yield Bi(UO.setAuditLogsState({pageSize:l,pageOffset:c,filter:d,sort:u})),n||(yield Bi(UO.loadAuditsMetadata()));const{data:y,total:f}=((e,t)=>{const{data:n}=RO;let a=n.filter((e=>t=>e.filter(CO).every((e=>t[e.id].includes(e.value))))(e));if(t.length){const{id:e,desc:n=!1}=t[0];a=a.sort(((e,t)=>(n,a)=>n[e]>a[e]?t?-1:1:a[e]>n[e]?t?1:-1:0)(e,n))}return{data:a,total:a.length}})(d,u);yield Bi(UO.setAuditLogsState({loading:!1,logs:null!=y?y:[],totalPages:+Math.ceil(f/l)})),null==e||null==(s=e.callback)||s.call(e,!0)}catch(t){var l;yield Bi(UO.setAuditLogsState({loading:!1,error:Bg(t)})),null==e||null==(l=e.callback)||l.call(e,null,t)}}function*jO(){yield jo(UO.loadAuditLogs,VO)}function*BO(){yield Bi(UO.setAuditsMetadataState({loading:!0,error:null}));try{const{properties:e}=yield $i(Ip.metadata.getAuditsMetadata);yield Bi(UO.setAuditsMetadataState({columns:e,loading:!1}))}catch(e){yield Bi(UO.setAuditsMetadataState({error:e,loading:!1}))}}function*WO(){yield jo(UO.loadAuditsMetadata,BO)}function*zO(){yield Bi(UO.setAuditsMetadataState({loading:!0,error:null}));try{const{properties:e}=_O;yield Bi(UO.setAuditsMetadataState({columns:e,loading:!1}))}catch(e){yield Bi(UO.setAuditsMetadataState({error:e,loading:!1}))}}function*$O(){yield jo(UO.loadAuditsMetadata,zO)}const KO={sagas:function*(){yield Wi([$i(xO),$i(WO)])},mockSagas:function*(){yield Wi([$i(jO),$i($O)])},storeName:Ft,initialState:LO,reducer:wO,actions:UO},HO={total:0,offset:0,filter:"",sortBy:"createdAt",context:null,filters:[],rowsData:[],lastUpdated:new Date,isLoading:!0,isFetchMore:!1,totalToday:0,currentPage:0,headerProps:[],sortDirection:"desc",severeThisWeek:0,predefinedFilters:[],isDownloadingCsv:!1,virtualScroll:!1},{name:qO,actions:JO,reducer:YO}=gt({name:"audits",initialState:HO,reducers:{setContext:(e,{payload:t})=>{e.context=t},startLoading:e=>{e.isLoading=!0},setVirtualScroll:(e,{payload:t})=>{e.virtualScroll=t},startRefresh:e=>{e.isLoading=!0},startFetching:e=>{e.isFetchMore=!0},finishLoading:e=>{e.isLoading=!1},startDownloadingCsv:e=>{e.isDownloadingCsv=!0},stopDownloadingCsv:e=>{e.isDownloadingCsv=!1},loadStatsSuccess:(e,{payload:t})=>{e.error=void 0,e.totalToday=t.totalToday,e.severeThisWeek=t.severeThisWeek},loadItemFailedAction:(e,{payload:t})=>{e.error=x({},e.error,{[t.name]:t.error})},loadMetadataSuccess:(e,{payload:t})=>{e.error={},e.headerProps=t.properties,e.themeAudits=t.theme?t.theme.styles:{}},loadAuditsSuccess:(e,{payload:t})=>{e.error={},e.rowsData=t.rowsData,e.lastUpdated=new Date,e.total=t.total},fetchMoreSuccess:(e,{payload:t})=>{e.error={},e.offset=t.offset,e.currentPage=t.currentPage,e.isFetchMore=!1},setFilterData:(e,{payload:t})=>{e.filters=t,e.currentPage=0,e.offset=0,e.isLoading=!0},textSearch:(e,{payload:t})=>{e.filter=t,e.currentPage=0,e.offset=0,e.isLoading=!0},onPageChange:(e,{payload:t})=>{e.currentPage=t-1,e.offset=20*e.currentPage,e.isLoading=!0},setDataSorting:(e,{payload:t})=>{e.sortBy=t.sortBy,e.currentPage=0,e.sortDirection="asc"===t.sortDirection?"desc":"asc",e.offset=0,e.isLoading=!0},setPredefinedFilters:(e,{payload:t})=>{e.predefinedFilters=t,e.filters=Object.keys(t).map((e=>({key:e,value:t[e]})))}}}),XO=x({},JO,{initData:ft(`${qO}/initData`),loadAudits:ft(`${qO}/loadAudits`),removeFilter:ft(`${qO}/removeFilter`),filterData:ft(`${qO}/filterData`),exportCSV:ft(`${qO}/exportCSV`),deleteAudits:ft(`${qO}/deleteAudits`)}),QO=()=>qi((e=>e[qO]));function*ZO(){const{sortBy:e,sortDirection:t}=yield QO();try{const n=yield $i(Ip.audits.getAuditsStats,{sortBy:e,sortDirection:t,count:20});yield Bi(XO.loadStatsSuccess(n))}catch(e){const t={name:"stats",error:e};console.error("failed to load stats - ",e),yield Bi(XO.loadItemFailedAction(t))}}function*eP(){try{const e=yield $i(Ip.metadata.getAuditsMetadata);yield Bi(XO.loadMetadataSuccess(e))}catch(e){const t={name:"metadata",error:e};console.error("failed to load metadata - ",e),yield Bi(XO.loadItemFailedAction(t))}}const tP=e=>e.reduce(((e,t)=>(e[t.key]=t.value,e)),{});function*nP({payload:e}){const{filters:t,sortBy:n,sortDirection:a,filter:i,offset:o,virtualScroll:r}=yield QO(),{appendMode:s=r,onlyOneLoad:l=!0,offset:c}=e||{},{rowsData:d}=s?yield QO():{rowsData:[]};try{const e=tP(t),{data:s,total:u}=yield $i(Ip.audits.getAudits,x({},r&&{paginationMode:"virtual"},{sortDirection:a,sortBy:n,filter:i},e,{offset:r?d.length+c||d.length+o:c||o,count:20}));yield Bi(XO.loadAuditsSuccess({rowsData:[...d,...s],total:u})),l&&(yield Bi(XO.finishLoading()))}catch(e){const t={name:"audits",error:e};console.error("failed to load audits - ",e),yield Bi(XO.loadItemFailedAction(t))}}function*aP(){yield Bi(XO.startLoading()),yield Wi([ZO(),eP(),nP({payload:{onlyOneLoad:!1},type:""})]),yield Bi(XO.finishLoading())}function*iP({payload:e}){const{filters:t}=yield QO(),n=t.findIndex((t=>t.key===e.key));if(n<0)return;const a=[...t.slice(0,n),...t.slice(n+1)];yield Bi(XO.setFilterData(a))}function*oP({payload:e}){const{filters:t}=yield QO();let n=t.findIndex((t=>t.key===e.key));n<0&&(n=t.length);const a=[...t.slice(0,n),e,...t.slice(n+1)];yield Bi(XO.setFilterData(a))}function*rP(){const{filters:e,sortBy:t,sortDirection:n,filter:a,headerProps:i}=yield QO(),o=tP(e);yield Bi(XO.startDownloadingCsv());try{yield Ip.audits.exportAudits(x({endpoint:"csv/v2",headerProps:i,sortDirection:n,sortBy:t,filter:a},o,{offset:0,outputFileName:"audits.csv"}))}catch(e){console.error("failed to export audits - ",e)}finally{yield Bi(XO.stopDownloadingCsv())}}function*sP(){yield Bo(XO.initData,aP),yield Bo(XO.removeFilter,iP),yield Bo(XO.filterData,oP),yield Bo([XO.loadAudits,XO.textSearch,XO.onPageChange],nP),yield Bo([XO.setFilterData,XO.setDataSorting,XO.startRefresh],(()=>nP({payload:{appendMode:!1},type:""}))),yield Bo(XO.exportCSV,rP)}const lP={isLoading:!1,isSaving:!1,list:[],processIds:[],slackChannels:{isLoading:!1}},cP={initData:()=>x({},lP),setConnectivityState:(e,{payload:t})=>x({},e,t),cleanWebhookTestData:e=>x({},e,{testResult:void 0}),cleanWebhookLogsData:e=>x({},e,{webhookLogs:void 0}),cleanWebhookTestMessage:e=>{var t;return x({},e,{testResult:{status:null==(t=e.testResult)?void 0:t.status,message:void 0}})},cleanError:e=>x({},e,{error:void 0}),cleanSlackData:e=>x({},e,{slackChannels:{isLoading:!1}}),postWebhookRetryAction:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>x({},e,{retryResult:x({},e.retryResult,{[t]:{isProcess:!0,success:!1}})})},postWebhookRetryResult:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>x({},e,{retryResult:x({},e.retryResult,t)})}},dP={loadSlackActions:ft("connectivity/loadSlackActions"),loadDataAction:ft("connectivity/loadDataAction",(e=>({payload:e}))),postDataAction:ft("connectivity/postDataAction",(e=>({payload:e}))),postCodeAction:ft("connectivity/postCodeAction",(e=>({payload:e}))),loadScope:ft("connectivity/loadScope"),deleteWebhookConfigAction:ft("connectivity/deleteWebhookConfigAction",(e=>({payload:e}))),postWebhookTestAction:ft("connectivity/postWebhookTestAction",(e=>({payload:e}))),loadWebhookLogsAction:ft("connectivity/loadWebhookLogsAction",((e,t=0,n=10)=>({payload:{id:e,offset:t,limit:n}})))},uP={isLoading:!1,isSaving:!1,list:[],processIds:[],slackChannels:{isLoading:!1}},{reducer:yP,actions:fP}=gt({name:Mt,initialState:uP,reducers:x({},cP)}),pP=x({},fP,dP),gP={slack:Ip.connectivity.getSlackConfiguration,email:Ip.connectivity.getEmailConfiguration,sms:Ip.connectivity.getSMSConfiguration,webhook:Ip.connectivity.getWebhooksConfigurations,categories:Ip.connectivity.getCategories,channelMap:Ip.connectivity.getChannelMaps},SP={slack:Ip.connectivity.postSlackConfiguration,email:Ip.connectivity.postEmailConfiguration,sms:Ip.connectivity.postSMSConfiguration,webhook:Ip.connectivity.postWebhooksConfiguration},vP=["email","slack","sms","webhook"],hP={sms:{title:"connectivity.sms",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({enabled:e})=>e)))&&t},image:"sms"},email:{title:"common.email",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({enabled:e})=>e)))&&t},image:"email"},slack:{title:"connectivity.slack",events:e=>{var t;return(null==e||null==(t=e.slackSubscriptions)?void 0:t.length)||0},isActive:e=>{var t;return null!=(t=!(null==e||!e.slackSubscriptions.some((({isActive:e})=>e))))&&t},image:"slack"},webhook:{title:"connectivity.webhook",events:e=>(null==e?void 0:e.length)||0,isActive:e=>{var t;return null!=(t=null==e?void 0:e.some((({isActive:e})=>e)))&&t},image:"webhook"}},mP=["id"],AP=["id","enabled"],bP=["categories","channelMap"];function*TP(e){return yield $i(IP,{payload:{api:e},type:""})}function*EP({payload:e=vP}){yield Bi(pP.setConnectivityState({isLoading:!0}));try{const t=yield Wi([...e.map(TP),yield IP({payload:{api:"categories"},type:""}),yield function*(){return(yield Wi(e.map((function*(e){return yield IP({payload:{api:"channelMap",params:e},type:""})})))).reduce(((t,n,a)=>x({},t,{[`${e[a]}`]:n})),{})}()]),n=yield IP({payload:{api:"webhook"},type:""}),a=t.reduce(((n,a,i)=>e[i]?t[t.length-1][e[i]].length?x({},n,{[`${e[i]}`]:a,list:[...n.list,{id:i,key:e[i],events:hP[e[i]].events(a),active:hP[e[i]].isActive(a),platform:hP[e[i]].title,image:hP[e[i]].image}]}):n:x({},n,{[`${bP[i-e.length]}`]:a})),{list:[],webhook:n});yield Bi(pP.setConnectivityState(x({},a,{error:void 0,isSaving:!1,isLoading:!1})))}catch(e){yield Bi(pP.setConnectivityState({isLoading:!1}))}}function*IP({payload:{api:e,params:t}}){try{return yield $i(gP[e],t)}catch(e){return}}function*kP(){try{yield Bi(pP.setConnectivityState({slackChannels:{isLoading:!0}}));const e=yield $i(Ip.connectivity.getSlackChannels);yield Bi(pP.setConnectivityState({error:void 0,slackChannels:{isLoading:!1,data:e}}))}catch(e){yield Bi(pP.setConnectivityState({error:void 0,slackChannels:{isLoading:!1}}))}}function*OP(e,t){const{connectivity:{list:n}}=yield qi(),a=n.find((({key:t})=>t===e));if(!a)return;const i=hP[e].isActive(t);i!==a.active&&(yield Bi(pP.setConnectivityState({list:n.map((t=>t.key===e?x({},t,{active:i}):t))})))}function*PP({payload:{platform:e,data:t,callback:n}}){const{processIds:a}=yield qi((e=>e.connectivity));try{if(yield Bi(pP.setConnectivityState({isSaving:!0,processIds:"webhook"===e?[t._id,...a]:a})),"slack"===e?yield function*({payload:e}){const{connectivity:{slack:t}}=yield qi();if(!t)return;const{slackSubscriptions:n}=t,{slackSubscriptions:a}=e;yield Wi([...a.reduce(((e,t)=>{var a,i;return!t.id&&t.slackEvents&&null!=(a=t.slackEvents[0].channelIds)&&a.length||(null==n?void 0:n.find((e=>{let{id:n}=e,a=ii(e,mP);return n===t.id&&JSON.stringify(x({id:n},a))!==JSON.stringify(t)})))&&t.slackEvents&&null!=(i=t.slackEvents[0].channelIds)&&i.length?[...e,t]:e}),[]).map((function*(e){return yield $i(SP.slack,e)})),...a.reduce(((e,t)=>t.id&&!t.slackEvents[0].channelIds.length?[...e,t]:e),[]).map((function*(e){return yield $i(Ip.connectivity.deleteSlackConfiguration,e)}))])}({payload:t,type:""}):["sms","email"].includes(e)?yield function*({payload:e,type:t}){const{connectivity:n}=yield qi(),{processIds:a}=yield qi((e=>e.connectivity)),i=n[t];if(!i)return;let o=[];try{o=yield Wi([...e.reduce(((e,t)=>!i.find((({eventKey:e})=>e===t.eventKey))&&t.subscriptions[0].recipients.filter((e=>e)).length?[...e,t]:e),[]).map((function*(e){return yield $i("email"===t?Ip.connectivity.postEmailConfiguration:Ip.connectivity.postSMSConfiguration,e)})),...e.reduce(((e,t)=>{const n=i.find((({eventKey:e})=>e===t.eventKey));return n&&JSON.stringify(n)!==JSON.stringify(t)?[...e,t]:e}),[]).map((function*(e){const{subscriptions:n,eventKey:a}=e,i=n[0],{id:o="",enabled:r}=i,s=ii(i,AP);return yield Wi([yield $i("email"===t?Ip.connectivity.patchEmailConfiguration:Ip.connectivity.patchSMSConfiguration,{eventKey:a,enabled:r}),yield $i("email"===t?Ip.connectivity.putEmailSubscriptions:Ip.connectivity.putSMSSubscriptions,o,a,x({},s,{enabled:r}))])})),...e.reduce(((e,t)=>{const n=i.find((({eventKey:e})=>e===t.eventKey));return n&&n.subscriptions[0].recipients.length&&!t.subscriptions[0].recipients.filter((e=>!!e)).length?[...e,t]:e}),[]).map((function*({eventKey:e,subscriptions:n}){return $i("email"===t?Ip.connectivity.deleteEmailSubscriptions:Ip.connectivity.deleteSMSSubscriptions,e,n[0].id||"")}))])}catch{}if(o.length){const e=yield IP({payload:{api:t},type:""});yield Bi(pP.setConnectivityState({error:void 0,isSaving:!1,[`${t}`]:e,processIds:e.id?a.filter((t=>t!==e.id)):a})),yield OP(t,e)}else yield Bi(pP.setConnectivityState({error:void 0,isSaving:!1,[`${t}`]:i,processIds:a}))}({payload:t,type:e}):yield $i(SP[e],t),!["sms","email"].includes(e)){const i=yield IP({payload:{api:e},type:""});"webhook"===e&&(i.id=t._id),yield Bi(pP.setConnectivityState({error:void 0,isSaving:!1,[`${e}`]:i,processIds:i.id?a.filter((e=>e!==i.id)):a})),yield OP(e,i),null==n||n(!0)}}catch(e){yield Bi(pP.setConnectivityState({error:Bg(e,e.toString()),isSaving:!1,isLoading:!1}))}}function*LP({payload:e}){try{yield Ip.connectivity.postSlackCode(e)}catch{}yield Bi(pP.setConnectivityState({error:void 0,isSaving:!1}))}function*wP(){const{slackChannels:e}=yield qi((e=>e.connectivity));try{yield Bi(pP.setConnectivityState({slackChannels:x({},e,{isLoadingScope:!0})}));const{clientId:t}=yield $i(Ip.connectivity.getSlackScope);yield Bi(pP.setConnectivityState({slackChannels:{error:void 0,clientId:t,isLoadingScope:!1,isLoading:!1}}))}catch{yield Bi(pP.setConnectivityState({slackChannels:{error:void 0,isLoadingScope:!1,isLoading:!1}}))}}function*DP({payload:e}){const{callback:t,webhookId:n}=e,{processIds:a}=yield qi((e=>e.connectivity));try{yield Bi(pP.setConnectivityState({isSaving:!0})),yield $i(Ip.connectivity.deleteWebhooksConfiguration,n)}catch(e){null==t||t(null,Bg(e))}const i=yield IP({payload:{api:"webhook"},type:""});i&&(yield Bi(pP.setConnectivityState({error:void 0,isSaving:!1,webhook:i,processIds:i.id?a.filter((e=>e!==i.id)):a}))),null==t||t(!0)}function*UP({payload:e}){try{yield Bi(pP.setConnectivityState({isTesting:!0}));const{statusCode:t,body:n}=yield $i(Ip.connectivity.postWebhookTest,e);if([201,200].includes(t)){const e=JSON.stringify(n,null,2);yield Bi(pP.setConnectivityState({isTesting:!1,testResult:{status:"success",message:e}}))}else yield Bi(pP.setConnectivityState({isTesting:!1,testResult:{status:"failed"}}))}catch(e){yield Bi(pP.setConnectivityState({isTesting:!1,testResult:{status:"failed",message:e.toString()}}))}}function*CP({payload:e}){try{const{statusCode:t}=yield $i(Ip.connectivity.postWebhookRetry,e);yield Bi(pP.postWebhookRetryResult({[e]:{isProcess:!1,success:202===t}}))}catch(t){yield Bi(pP.postWebhookRetryResult({[e]:{isProcess:!1,success:!1}}))}}function*RP({payload:{id:e,limit:t,offset:n}}){const{webhookLogs:a}=yield qi((e=>e.connectivity));try{yield Bi(pP.setConnectivityState({webhookLogs:x({},a,{isLoading:!0})}));const i=yield $i(Ip.connectivity.getWebhookLog,e,n,t);yield Bi(pP.setConnectivityState({error:void 0,webhookLogs:x({isLoading:!1},i)}))}catch(e){yield Bi(pP.setConnectivityState({error:void 0,webhookLogs:{isLoading:!1}}))}}const _P={sagas:function*(){yield jo(pP.loadDataAction,EP),yield Bo(pP.loadSlackActions,kP),yield jo(pP.postDataAction,PP),yield jo(pP.postCodeAction,LP),yield jo(pP.loadScope,wP),yield jo(pP.deleteWebhookConfigAction,DP),yield jo(pP.postWebhookTestAction,UP),yield jo(pP.postWebhookRetryAction,CP),yield Bo(pP.loadWebhookLogsAction,RP)},storeName:Mt,initialState:uP,reducer:yP,actions:pP};function NP(){return{setLoading:{prepare:e=>({payload:e}),reducer:(e,t)=>x({},e,{loading:t.payload},t.payload?{error:null}:{})},setError:{prepare:e=>({payload:e}),reducer:(e,t)=>x({},e,{error:t.payload,loading:!1,fetching:!1})},setState:{prepare:e=>({payload:e}),reducer:(e,t)=>x({},e,t.payload)}}}function MP(e,t){return{prepare:e=>({payload:e}),reducer:(n,a)=>x({},n,{[e]:t(n[e],a)})}}function FP(e){return MP(e,((e,t)=>x({},e,{loading:t.payload})))}function GP(e){return MP(e,((e,t)=>x({},e,{error:t.payload,loading:!1})))}const xP={loading:!1,error:null,fetching:!0,plans:[]},{actions:VP,reducer:jP,name:BP}=gt({name:"subscriptions/plans",initialState:xP,reducers:x({},NP())}),WP=x({loadPlans:ft(`${BP}/loadPlans`)},VP),zP={loading:!1,error:null,fetching:!0,config:null},$P=x({},NP()),{actions:KP,reducer:HP,name:qP}=gt({name:"subscriptions/config",initialState:zP,reducers:$P}),JP=x({loadPaymentConfiguration:ft(`${qP}/loadPaymentConfiguration`)},KP),YP={loading:!1,error:null,fetching:!0,cancellation:{loading:!1,error:null},renewal:{loading:!1,error:null}},XP=x({},NP(),{setCancellationLoading:FP("cancellation"),setCancellationError:GP("cancellation"),setRenewalLoading:FP("renewal"),setRenewalError:GP("renewal")}),{reducer:QP,actions:ZP,name:eL}=gt({name:"subscriptions/billing/subscription",initialState:YP,reducers:XP}),tL=x({load:ft(`${eL}/loadSubscription`),cancelSubscription:ft(`${eL}/cancelSubscription`),renewSubscription:ft(`${eL}/renewSubscription`)},ZP),nL={loading:!1,error:null,fetching:!0},aL=x({},NP()),{reducer:iL,actions:oL,name:rL}=gt({name:"subscriptions/billing/information",initialState:nL,reducers:aL}),sL=x({loadBillingInformation:ft(`${rL}/loadBillingInformation`),cancelSubscription:tL.cancelSubscription,renewSubscription:tL.renewSubscription},oL),lL={loading:!1,error:null,fetching:!0},cL=x({},NP(),{setState:{prepare:e=>({payload:e}),reducer:(e,t)=>x({},e,t.payload)}}),{reducer:dL,actions:uL,name:yL}=gt({name:"subscriptions/billing/payment",initialState:lL,reducers:cL}),fL=x({loadPaymentMethod:ft(`${yL}/loadPaymentMethod`),submitPaymentMethod:ft(`${yL}/submitPaymentMethod`),submitPaymentMethodError:ft(`${yL}/submitPaymentMethodError`),submitPaymentMethodSuccess:ft(`${yL}/submitPaymentMethodSuccess`),updatePaymentMethodBillingDetails:ft(`${yL}/updateBillingDetails`,(e=>({payload:e})))},uL),pL={loading:!1,error:null,fetching:!0,invoices:[],invoiceDownload:{loading:!1,error:null}},gL=x({},NP(),{setInvoiceDownloadState:{prepare:e=>({payload:e}),reducer:(e,t)=>x({},e,{invoiceDownload:x({},e.invoiceDownload,t.payload)})}}),{reducer:SL,actions:vL,name:hL}=gt({name:"subscriptions/billing/invoices",initialState:pL,reducers:gL}),mL=x({loadInvoices:ft(`${hL}/loadInvoices`),downloadInvoice:ft(`${hL}/downloadInvoice`,(e=>({payload:e})))},vL),AL={information:nL,invoices:pL,paymentMethod:lL,subscription:YP},bL={invoices:mL,information:sL,paymentMethod:fL,subscription:tL},TL=He({invoices:SL,information:iL,paymentMethod:dL,subscription:QP}),EL={fetching:!0,loading:!1,error:null,confirmed:!1},IL=x({},NP()),{actions:kL,reducer:OL,name:PL}=gt({name:"subscriptions/checkout",initialState:EL,reducers:IL}),LL=x({loadCheckout:ft(`${PL}/loadCheckout`),resetCheckout:ft(`${PL}/resetCheckout`),submitCheckout:ft(`${PL}/submitCheckout`),confirmCheckout:ft(`${PL}/confirmCheckout`,(e=>({payload:e}))),errorCheckout:ft(`${PL}/errorCheckout`,(e=>({payload:e})))},kL),wL={loading:!1,error:null,cardSetupIntentSecret:null},DL=x({},NP()),{reducer:UL,actions:CL,name:RL}=gt({name:"subscriptions/stripe",initialState:wL,reducers:DL}),_L=x({loadCustomer:ft(`${RL}/loadCustomer`),createCardSetupIntentSecret:ft(`${RL}/createCardSetupIntentSecret`)},CL),NL={loading:!1,fetching:!0,vendorPublicConfig:null},{actions:ML,reducer:FL,name:GL}=gt({name:"subscriptions/vendorPublicConfig",initialState:NL,reducers:x({},NP())}),xL=x({loadVendorPublicConfiguration:ft(`${GL}/loadVendorPublicConfiguration`)},ML),VL={config:zP,plans:xP,checkout:EL,billing:AL,stripe:wL,vendorPublicConfig:NL},jL={config:JP,billing:bL,plans:WP,checkout:LL,stripe:_L,vendorPublicConfig:xL},BL=He({config:HP,billing:TL,plans:jP,checkout:OL,stripe:UL,vendorPublicConfig:FL});let WL,zL,$L;function KL({policy:e}){return{policy:$L.AT_PERIOD_END}}function HL(e){switch(e){case sf.ACTIVE:return zL.ACTIVE;case sf.INCOMPLETE:return zL.INCOMPLETE;case sf.CANCELED:return zL.CANCELED;case sf.EXPIRED:return zL.EXPIRED;case sf.TRIALING:return zL.TRIALING;default:return zL.EXPIRED}}!function(e){e.STRIPE="Stripe"}(WL||(WL={})),function(e){e.ACTIVE="ACTIVE",e.CANCELED="CANCELED",e.INCOMPLETE="INCOMPLETE",e.EXPIRED="EXPIRED",e.TRIALING="TRIALING"}(zL||(zL={})),function(e){e.AT_PERIOD_END="atPeriodEnd"}($L||($L={}));const qL={id:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",externalId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",startDate:"2021-09-20T08:08:51.000Z",status:sf.ACTIVE,externallyManaged:!1,cancellation:null,currentPeriodStart:"2021-09-20T08:08:51.000Z",currentPeriodEnd:"2021-10-20T08:08:51.000Z",plan:{slug:"test"}},JL=[{id:"prod_J60fUEvI7qV1eL",externalId:"prod_J60fUEvI7qV1eL",name:"Premium",description:"",price:{id:"price_1IToe8Ewsu4qiqnndAV76J69",externalId:"price_1IToe8Ewsu4qiqnndAV76J69",currency:"usd",amount:1e4},slug:"premium"},{id:"prod_J60duauCpXfcur",externalId:"prod_J60duauCpXfcur",name:"Free",description:"Totally free plan. Nothing to pay.",price:{id:"price_1ITocfEwsu4qiqnnnBHDx9fQ",externalId:"price_1ITocfEwsu4qiqnnnBHDx9fQ",currency:"usd",amount:0},slug:"free"}],YL=[{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-09-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""},{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-08-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""}],XL=[{id:"id",externalId:"externalId",type:lf.CARD,isDefault:!0,last4:"4242",expMonth:11,expYear:25,brand:"visa",billingDetails:{name:"Dummy",email:"dummy@email.com"}}],QL={allowPlanDowngrade:!0,allowPlanCancellation:!0};function*ZL(){yield Bi(tL.setLoading(!0));try{const[e]=yield $i(Ip.subscriptions.getManagedSubscriptions);yield Bi(tL.setState({subscription:e,fetching:!1,loading:!1,error:null}))}catch(e){yield Bi(tL.setError(e))}}function*ew(){yield jo(sL.loadBillingInformation,tw)}function*tw(){yield function*(e){const t=yield qi((e=>{var t;return null==(t=e.subscriptions.config.config)?void 0:t.paymentProvider})),n=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));t&&n?yield nw(n,!1):yield Bi(sL.setError(t?"Not authorized":"Internal feature failure"))}()}function*nw(e,t){yield Bi(sL.setLoading(!0));try{var n,a;const i=yield $i(Ip.subscriptions.getSubscriptionSummaries,e),{currentPlanId:o,externallyManaged:r}=i;let s,l=null;r?s=yield $i(Ip.subscriptions.getSubscriptionPlan,o):([,s]=yield Wi([$i(ZL),$i(Ip.subscriptions.getSubscriptionPlan,o)]),l=yield qi((e=>e.subscriptions.billing.subscription.subscription||null))),yield Bi(sL.setState(x({loading:!1,fetching:!1,summary:i},l?{subscription:{id:l.id,externalId:l.externalId,startDate:l.startDate,currentPeriodStart:l.currentPeriodStart,currentPeriodEnd:l.currentPeriodEnd,status:t?zL.ACTIVE:HL(l.status),cancellation:l.cancellation&&KL(l.cancellation),trialEnd:l.trialEnd?l.trialEnd:null}}:{},s?{plan:{id:s.id,name:s.name,description:s.description,price:(null==(n=s.price)?void 0:n.amount)||0,currency:(null==(a=s.price)?void 0:a.currency)||"usd",recurringInterval:"month",slug:s.slug}}:{})))}catch(e){yield Bi(sL.setError(Bg(e)))}}function*aw(){yield function*(){var e,t;yield Bi(sL.setLoading(!0)),yield Ji(500),yield Bi(sL.setState({loading:!1,fetching:!1,summary:{subscriptionId:qL.id,paymentMethodId:"mockPaymentMethodId",tenantConfigurationId:"mockTenantConfigurationId",providerType:df.Stripe,externallyManaged:!1,currentPlanId:JL[0].id,defaultPlanId:JL[0].id},plan:x({},JL[0],{price:null==(e=JL[0].price)?void 0:e.amount,currency:null==(t=JL[0].price)?void 0:t.currency,recurringInterval:"month"})}))}()}function*iw(){yield jo(sL.loadBillingInformation,aw)}function*ow(){yield jo(fL.loadPaymentMethod,rw),yield jo(fL.submitPaymentMethod,lw),yield jo(fL.submitPaymentMethodError,cw),yield jo(fL.submitPaymentMethodSuccess,dw),yield jo(fL.updatePaymentMethodBillingDetails,sw)}function*rw(){yield Bi(fL.setLoading(!0));try{const e=(yield $i(Ip.subscriptions.getPaymentMethods))[0];yield Bi(fL.setState({paymentMethod:e,loading:!1,fetching:!1}))}catch(e){yield Bi(fL.setError(Bg(e)))}}function*sw({payload:e}){yield Bi(fL.setLoading(!0));const{id:t,email:n,address:a,callback:i}=e;try{yield $i(Ip.subscriptions.updatePaymentMethodBillingDetails,t,x({email:n},a)),yield $i(rw),null==i||i(!0)}catch(e){yield Bi(fL.setError(Bg(e))),null==i||i(!1)}yield Bi(fL.setLoading(!1))}function*lw(){yield Bi(fL.setLoading(!0))}function*cw({payload:e}){yield Bi(fL.setError(e))}function*dw(){yield Bi(fL.loadPaymentMethod())}function*uw(){yield Bi(fL.setLoading(!0)),yield Ji(500);const e=XL[0];yield Bi(fL.setState({paymentMethod:e,loading:!1,fetching:!1}))}function*yw(){yield jo(fL.loadPaymentMethod,uw)}function*fw(){yield jo(mL.loadInvoices,pw),yield jo(mL.downloadInvoice,gw)}function*pw(){yield Bi(mL.setLoading(!0));try{const e=(yield $i(Ip.subscriptions.getSubscriptionInvoices)).map((e=>({id:e.id,externalId:e.externalId,subscriptionId:e.subscriptionId,paymentDate:new Date(Date.parse(e.paymentDate)),totalAmount:+((e.totalAmount||0)/100).toFixed(2),currency:e.currency||"usd",paid:e.paid||!1,receiptNumber:e.receiptNumber})));yield Bi(mL.setState({loading:!1,fetching:!1,invoices:e}))}catch(e){yield Bi(mL.setError(Bg(e)))}}function*gw({payload:e}){yield Bi(mL.setInvoiceDownloadState({loading:!0,error:null}));try{yield $i(Ip.subscriptions.getSubscriptionInvoicePdf,e.invoiceId,e.filename),yield Bi(mL.setInvoiceDownloadState({loading:!1,error:null}))}catch(e){yield Bi(mL.setInvoiceDownloadState({loading:!1,error:Bg(e,null)}))}}function*Sw(){yield Bi(mL.setLoading(!0)),yield Ji(500),yield Bi(mL.setState({loading:!1,fetching:!1,invoices:YL.map((e=>x({},e,{selectedPlan:"Premium",paymentDate:new Date(Date.parse(e.paymentDate)),totalAmount:+((e.totalAmount||0)/100).toFixed(2)})))})),yield Bi(mL.setLoading(!1))}function*vw(){yield jo(mL.loadInvoices,Sw)}function*hw(){yield jo(tL.load,mw),yield jo(tL.cancelSubscription,Aw),yield jo(tL.renewSubscription,bw)}function*mw(){const e=yield qi((e=>{var t,n;return null==(t=e.auth)||null==(n=t.user)?void 0:n.tenantId}));yield nw(e)}function*Aw(){const{subscription:e}=yield qi((e=>e.subscriptions.billing.subscription));if(!e)return void(yield Bi(tL.setCancellationError("Subscription not found.")));if(null!=e&&e.externallyManaged)return void(yield Bi(tL.setCancellationError("Billing is externally managed.")));const{id:t,cancellation:n,status:a}=e||{};if(!n&&a===sf.ACTIVE)try{yield Bi(tL.setCancellationLoading(!0)),yield $i(Ip.subscriptions.cancelManagedSubscription,t),yield ZL(),yield Bi(tL.setCancellationLoading(!1))}catch(e){yield Bi(tL.setCancellationError(Bg(e)))}}function*bw(){const{subscription:e}=yield qi((e=>e.subscriptions.billing.subscription));if(!e)return void(yield Bi(tL.setCancellationError("Subscription not found.")));if(null!=e&&e.externallyManaged)return void(yield Bi(tL.setCancellationError("Billing is externally managed")));const{id:t,cancellation:n}=e||{};if((null==n?void 0:n.policy)===cf.AT_PERIOD_END)try{yield Bi(tL.setRenewalLoading(!0)),yield $i(Ip.subscriptions.renewManagedSubscription,t),yield ZL(),yield Bi(tL.setRenewalLoading(!1))}catch(e){yield Bi(tL.setCancellationError(Bg(e)))}}function*Tw(){yield Bi(tL.setLoading(!0)),yield Ji(500),yield Bi(tL.setState({subscription:qL,fetching:!1,loading:!1,error:null}))}function*Ew(){yield jo(tL.load,Tw)}function*Iw(){yield Wi([$i(ew),$i(ow),$i(fw),$i(hw)])}function*kw(){yield Wi([$i(iw),$i(yw),$i(vw),$i(Ew)])}function*Ow(){yield jo(LL.loadCheckout,Pw),yield jo(LL.resetCheckout,Lw),yield jo(LL.submitCheckout,ww),yield jo(LL.confirmCheckout,Dw),yield jo(LL.errorCheckout,Cw)}function*Pw(){yield Bi(LL.setState({fetching:!1,loading:!1,error:null,confirmed:!1}))}function*Lw(){yield Bi(LL.setState({loading:!1,error:null,confirmed:!1}))}function*ww(){yield Bi(LL.setState({loading:!0,error:null}))}function*Dw({payload:{paymentMethodId:e,planId:t}}){const n=yield qi((e=>e.subscriptions.billing.subscription.subscription)),a=yield qi((e=>e.subscriptions.billing.information.summary)),i=(null==n?void 0:n.status)===sf.TRIALING,o=!(null==a||!a.paymentMethodId);if(n){if(yield Bi(LL.setState({loading:!0,error:null})),i&&o)return yield Uw(),void(yield Bi(tL.setState({subscription:x({},n,{status:sf.ACTIVE})})));try{yield $i(Ip.subscriptions.updateManagedSubscription,n.id,{paymentMethodId:e,planId:t}),yield Wi([tw(),rw(),pw()]),yield Uw()}catch(e){yield Bi(LL.setState({loading:!1,error:Bg(e)}))}}else yield Bi(LL.setState({loading:!1,error:"Subscription not found"}))}function*Uw(){yield Bi(LL.setState({loading:!1,error:null,confirmed:!0}))}function*Cw({payload:e}){yield Bi(LL.setState({loading:!1,error:e}))}function*Rw(){yield jo(LL.resetCheckout,Lw)}function*_w(){yield jo(WP.loadPlans,Nw)}function*Nw(){yield Bi(WP.setLoading(!0));try{const e=(yield $i(Ip.subscriptions.getSubscriptionPlans)).map((e=>{var t,n;return{id:e.id,name:e.name,description:e.description,price:(null==(t=e.price)?void 0:t.amount)||0,currency:(null==(n=e.price)?void 0:n.currency)||"usd",recurringInterval:"month",slug:e.slug}}));yield Bi(WP.setState({fetching:!1,loading:!1,plans:e}))}catch(e){yield Bi(WP.setError(Bg(e)))}}function*Mw(){yield Bi(WP.setLoading(!0)),yield Ji(500),yield Bi(WP.setState({fetching:!1,loading:!1,plans:JL.map((e=>{var t,n;return x({},e,{price:(null==(t=e.price)?void 0:t.amount)||0,currency:(null==(n=e.price)?void 0:n.currency)||"usd",recurringInterval:"month"})}))}))}function*Fw(){yield jo(WP.loadPlans,Mw)}function*Gw(){yield jo(JP.loadPaymentConfiguration,xw)}function*xw(){yield Bi(JP.setLoading(!0));try{(yield $i(Ip.subscriptions.getPaymentProviders)||[]).find((e=>"1"===e.status&&e.providerType===df.Stripe))?yield function*(){yield Bi(JP.setLoading(!0));try{const e=yield $i(Ip.subscriptions.getStripePaymentProviderConfiguration);yield Bi(JP.setState({loading:!1,fetching:!1,config:{paymentProvider:WL.STRIPE,apiKey:e.publishableKey}}))}catch(e){yield Bi(JP.setError(Bg(e)))}}():yield Bi(JP.setError("Payment provider not configured"))}catch(e){yield Bi(JP.setError(Bg(e)))}}function*Vw(){yield Bi(JP.setLoading(!0)),yield Ji(500),yield Bi(JP.setState({loading:!1,fetching:!1,config:{paymentProvider:WL.STRIPE,apiKey:""}}))}function*jw(){yield jo(JP.loadPaymentConfiguration,Vw)}function*Bw(){yield jo(_L.createCardSetupIntentSecret,Ww)}function*Ww({payload:e}){yield Bi(_L.setState({loading:!0,error:null,cardSetupIntentSecret:null}));try{const t={};e&&(t.paymentMethodId=e);const{setupIntentSecret:n}=yield $i(Ip.subscriptions.createStripePaymentMethodSetupIntentSecret,t);yield Bi(_L.setState({cardSetupIntentSecret:n,loading:!1}))}catch(e){yield Bi(_L.setError(Bg(e)))}}function*zw(){yield jo(xL.loadVendorPublicConfiguration,$w)}function*$w(){yield Bi(xL.setLoading(!0));try{const e=yield $i(Ip.subscriptions.getVendorPublicConfigurations);yield Bi(xL.setState({fetching:!1,loading:!1,vendorPublicConfig:e}))}catch(e){yield Bi(xL.setError(Bg(e)))}}function*Kw(){yield Bi(xL.setLoading(!0)),yield Ji(500),yield Bi(xL.setState({fetching:!1,loading:!1,vendorPublicConfig:QL}))}function*Hw(){yield jo(xL.loadVendorPublicConfiguration,Kw)}const qw={sagas:function*(){yield Wi([$i(Iw),$i(Ow),$i(_w),$i(Gw),$i(Bw),$i(zw)])},mockSagas:function*(){yield Wi([$i(kw),$i(Rw),$i(Fw),$i(jw),$i(Hw)])},reducer:BL,actions:jL,initialState:VL,storeName:"subscriptions"},Jw={sagas:function*(){yield jo(uv.loadVendorPublicInfo,yv)},storeName:Gt,initialState:lv,reducer:cv,actions:uv},{reducer:Yw}=gt({name:"root",initialState:{context:void 0,urlStrategy:"path",previewMode:!1,appName:"default"},reducers:{setContext:{prepare:e=>({payload:e}),reducer:(e,{payload:t})=>(zo.setContext(t),x({},e,{context:t}))}}}),Xw=(e,t,n=!1,a,i,o=!1,r="path")=>{const s="undefined"==typeof window;let l=t;if(s&&null==t)throw Error("createFronteggStore(initState, storeHolder) failed, storeHolder must not be null in Server-Side rendering");if(l||(l=window),!l.store){var c,d,u,y,f,p,g,S,v,h;n||o||zo.setContext(e.context);const t=Co(),s=[...ut({thunk:!1,immutableCheck:!1,serializableCheck:!1}),t];l.store=yt({middleware:s,preloadedState:{root:x({},e,{previewMode:n,urlStrategy:r}),[AO.storeName]:x({},AO.initialState,a,null!=(c=null==i?void 0:i.auth)?c:{},{routes:x({},AO.initialState.routes,null!=(d=null==a?void 0:a.routes)?d:{},null!=(u=null==i||null==(y=i.auth)?void 0:y.routes)?u:{})}),[KO.storeName]:x({},KO.initialState,null!=(f=null==i?void 0:i.auditLogs)?f:{},{auditLogsState:x({},KO.initialState.auditLogsState,null!=(p=null==i||null==(g=i.auditLogs)?void 0:g.auditLogsState)?p:{}),auditsMetadataState:x({},KO.initialState.auditsMetadataState,null!=(S=null==i||null==(v=i.auditLogs)?void 0:v.auditsMetadataState)?S:{})}),[qO]:x({},HO,null!=(h=null==i?void 0:i.audits)?h:{}),[_P.storeName]:_P.initialState,[qw.storeName]:qw.initialState,[Jw.storeName]:Jw.initialState},reducer:He({root:Yw,[AO.storeName]:AO.reducer,[KO.storeName]:KO.reducer,[qO]:YO,[_P.storeName]:_P.reducer,[qw.storeName]:qw.reducer,[Jw.storeName]:Jw.reducer})});const m=function*(){yield Wi([$i(AO.sagas),$i(KO.sagas),$i(sP),$i(_P.sagas),$i(qw.sagas),$i(Jw.sagas)])},A=function*(){yield Wi([$i(AO.mockSagas),$i(KO.mockSagas),$i(qw.mockSagas)])};n?(l.store.destroy=t.run(A).cancel,l.store.dispatch($a.requestAuthorize(!0))):l.store.destroy=t.run(m).cancel,l.store.subscribeStateChanged=e=>{let t=l.store.getState();return l.store.subscribe((()=>{const n=l.store.getState();t!=n&&(t=n,e(n))}))}}return l.store};var Qw=n(9314);const Zw=()=>{if(!zo.shouldLoadEntitlements())throw new Error("You must first enable entitlements via Frontegg options to use this function")},eD=(e,t)=>e?e.isEntitled?{isEntitled:!0}:{isEntitled:!1,justification:e.justification}:{isEntitled:!1,justification:t};var tD=n(9714),nD=n.n(tD);function aD(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function iD(e){if(e.type)return e;if("#"===e.charAt(0))return iD(function(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map((e=>e+e))),n?`rgb${4===n.length?"a":""}(${n.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const a=e.substring(t+1,e.length-1);let i,o;if("color"===n){if(o=a.split(" "),i=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].substr(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i))throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020."+i)}else o=a.split(",");return{type:n,values:o.map((e=>parseFloat(e))),colorSpace:i}}function oD(e){const{type:t,colorSpace:n}=e;let{values:a}=e;return-1!==t.indexOf("rgb")?a=a.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(a[1]=`${a[1]}%`,a[2]=`${a[2]}%`),a=-1!==t.indexOf("color")?`${n} ${a.join(" ")}`:`${a.join(", ")}`,`${t}(${a})`}function rD(e){if(0===e.indexOf("#"))return e;const{values:t}=iD(e);return`#${t.map(((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e))).join("")}`}function sD(e,t){return e=iD(e),t=aD(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,oD(e)}function lD(e,t){if(e=iD(e),t=aD(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return oD(e)}function cD(e,t){if(e=iD(e),t=aD(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return oD(e)}const dD=e=>{if(e)return{main:e,light:rD(cD(e,.4)),dark:rD(lD(e,.15)),hover:rD(lD(e,.15)),active:rD(lD(e,.2))}},uD=e=>{if(e)return{main:e,light:cD(e,.7),dark:lD(e,.2)}},yD=(e,t)=>{var n,a,i,o,r,s,l,c,d,u,y,f;return null!=e&&e.palette&&"string"==typeof(null==e||null==(n=e.palette)?void 0:n.primary)?x({},t,{palette:{primary:x({},dD(null==e||null==(a=e.palette)?void 0:a.primary),{contrastText:null!=(i=null==e||null==(o=e.palette)?void 0:o.primaryText)?i:"#000000"}),secondary:x({},dD(null==e||null==(r=e.palette)?void 0:r.secondary),{contrastText:null!=(s=null==e||null==(l=e.palette)?void 0:l.secondaryText)?s:"#000000"}),danger:x({},dD(null==e||null==(c=e.palette)?void 0:c.error),{contrastText:"#FFF"}),success:x({},uD(null==e||null==(d=e.palette)?void 0:d.success),{contrastText:"#FFF"}),error:x({},uD(null==e||null==(u=e.palette)?void 0:u.error),{contrastText:"#FFF"}),warning:x({},uD(null==e||null==(y=e.palette)?void 0:y.warning),{contrastText:"#FFF"}),info:x({},uD(null==e||null==(f=e.palette)?void 0:f.info),{contrastText:"#FFF"})}}):{}},fD={theme:{},themeV2:{},localizations:{},navigation:{usage:{visibility:"hidden",permissions:["fe.usage.read"],featureFlag:"fe-usage-page"},webhooks:{visibility:"hidden",permissions:["fe.connectivity.read.webhooks"]},roles:{visibility:"hidden",permissions:["fe.secure.read.roles"]},users:{visibility:"always",permissions:["fe.secure.read.users"],inviteDialog:{phoneNumberField:"optional"}},personalApiTokens:{visibility:"hidden",permissions:["fe.secure.read.userApiTokens"]},apiTokens:{visibility:"hidden",permissions:["fe.secure.read.tenantApiTokens"]},profile:{visibility:"always"},privacy:{visibility:"always",permissions:["fe.secure.read.securityPolicy"]},account:{visibility:"always",permissions:["fe.secure.read.accountSettings"]},security:{visibility:"always",permissions:["fe.secure.read.securityPolicy"]},sso:{visibility:"hidden",permissions:["fe.secure.read.samlConfiguration"]},provisioning:{visibility:"hidden",permissions:["fe.secure.read.provisioningConfiguration"]},audits:{visibility:"always",permissions:["fe.secure.read.audits"]},subscriptions:{visibility:"hidden",permissions:["fe.subscriptions.*"]},allAccounts:{visibility:"byPermissions",permissions:["fe.account-hierarchy.read.subAccount"]},groups:{visibility:"hidden",permissions:["fe.secure.read.groups"]}}};class pD{constructor(){this._theme=fD.theme,this._themeV2=fD.themeV2,this._navigation=fD.navigation,this._localizations=fD.localizations,this._integrations=fD.integrations}static getInstance(e="default"){return this._instances[e]}static set(e,t="default"){const n=new pD;return n.set(e),pD._instances[t]=n,n}get theme(){var e;return null!=(e=this._theme)?e:{}}get themeV2(){var e;return null!=(e=this._themeV2)?e:{}}get navigation(){var e;return null!=(e=this._navigation)?e:{}}get localizations(){var e;return null!=(e=this._localizations)?e:{}}get integrations(){var e;return null!=(e=this._integrations)?e:{}}set(e){try{var t,n,a,i,o,r,s,l,c;this._navigation=nD().all([null!=(t=fD.navigation)?t:{},null!=(n=null==e?void 0:e.navigation)?n:{}]),this._theme=nD().all([null!=(a=fD.theme)?a:{},yD(null==e?void 0:e.theme,fD.theme)]),this._themeV2=nD().all([null!=(i=fD.themeV2)?i:{},null!=(o=null==e?void 0:e.themeV2)?o:{}]),this._localizations=nD().all([null!=(r=fD.localizations)?r:{},null!=(s=null==e?void 0:e.localizations)?s:{}]),this._integrations=nD().all([null!=(l=fD.integrations)?l:{},null!=(c=null==e?void 0:e.integrations)?c:{}])}catch(e){this._navigation=fD.navigation,this._theme=fD.theme,this._themeV2=fD.themeV2,this._localizations=fD.localizations,this._integrations=fD.integrations}}}pD._instances={};var gD=function(e){return e.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("")},SD=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=document.createElement(t);return Object.keys(n).forEach((function(e){return a.setAttribute(e,n[e])})),e.appendChild(a),a},vD=function(e){return new Promise((function(t,n){var a=4e3,i=setInterval((function(){return null!=e.themeSetter?(clearInterval(i),void t(!0)):a<0?(n("Failed to load Renderer with themeSetter"),void clearInterval(i)):void(a-=50)}),50)}))},hD=function(e){var t=e.toString();if(t){var n=new URL(window.location.href);n.search=t,window.history.pushState(null,"",n.toString())}};let mD,AD,bD,TD,ED,ID,kD,OD,PD,LD,wD,DD;!function(e){e.phoneNumber="phoneNumber"}(mD||(mD={})),function(e){e.Name="name",e.PhoneNumber="phoneNumber",e.Address="address",e.JobTitle="jobTitle"}(AD||(AD={})),function(e){e.LoginSessions="loginSessions",e.Mfa="mfa"}(bD||(bD={})),function(e){e.Name="name",e.PhoneNumber="phoneNumber"}(TD||(TD={})),function(e){e.CompanyName="companyName",e.Address="address",e.Website="website",e.Timezone="timezone",e.Currency="currency"}(ED||(ED={})),function(e){e.Invoices="invoices"}(ID||(ID={})),function(e){e.SessionManagement="sessionManagement",e.GeneralSettings="generalSettings",e.IpRestrictions="ipRestrictions",e.DomainRestrictions="domainRestrictions"}(kD||(kD={})),function(e){e.IdleSessionTimeout="idleSessionTimeout",e.ForceReLogin="forceReLogin",e.MaximumConcurrentSessions="maximumConcurrentSessions"}(OD||(OD={})),function(e){e.Mfa="mfa",e.UserLockout="userLockout",e.PasswordHistory="passwordHistory"}(PD||(PD={})),function(e){e.IpAddressRestrictions="ipAddressRestrictions"}(LD||(LD={})),function(e){e.RestrictSignupByEmailDomain="restrictSignupByEmailDomain"}(wD||(wD={})),function(e){e.Settings="settings",e.CustomLogin="customLogin"}(DD||(DD={}));const UD={hidden:"hidden",viewOnly:"viewOnly",edit:"edit"},CD={hidden:"hidden",edit:"edit"},RD="6.185.0-alpha.2";var _D={admin_portal_ip_restrictions:"on",admin_portal_domain_restrictions:"on","new-mfa-pages":"on","show-passkeys-new":"on","groups-admin-box-new":"on","msp-all-accounts-new":"on","temporary-users":"on"},ND=function(){function e(t,n){var a,i,o=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];P(this,e),this.name=void 0,this.iframeRendering=void 0,this.options=void 0,this.loading=!0,this.cdnUrl="https://assets.frontegg.com/admin-box/".concat(RD),this.customElementName="",this.adminPortalEl=void 0,this.adminPortalRenderer=void 0,this.loginBoxEl=void 0,this.checkoutDialogEl=void 0,this.checkoutDialogRenderer=void 0,this.adminPortalContainer=void 0,this.loginBoxContainer=void 0,this.checkoutDialogContainer=void 0,this.loginBoxRenderer=void 0,this.store=void 0,this.loadingListeners=[],this.updateLocalizations=void 0,this.loadAdminBoxMetadata=M(G().mark((function e(){var t,n,a,i,r;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xr,o.options.metadata){e.next=12;break}return e.prev=2,e.next=5,t("/metadata",{entityName:"adminBox"});case 5:r=e.sent,o.options.metadata=null!=(n=null==r||null==(a=r.rows)||null==(i=a[0])?void 0:i.configuration)?n:{},e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("failed to get admin portal metadata",e.t0);case 12:pD.set(o.options.metadata,o.name);case 13:case"end":return e.stop()}}),e,null,[[2,9]])}))),this.requestAuthorize=M(G().mark((function e(){var t,n,a;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=null==(t=o.options.authOptions)||null==(n=t.hostedLoginOptions)?void 0:n.loadUserOnFirstLoad,o.options.builderMode||"nextjs"===o.options.framework||(o.options.hostedLoginBox&&!o.options.customLoginBox?a&&o.store.dispatch({type:"auth/requestHostedLoginAuthorizeV2",payload:{shouldRedirectToLogin:!1,firstTime:!0}}):o.store.dispatch({type:"auth/requestAuthorize",payload:!0}));case 2:case"end":return e.stop()}}),e)}))),this.loadFeatureFlags=M(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.options.previewMode&&!o.options.builderMode){e.next=4;break}Jr.set(_D,o.name),e.next=15;break;case 4:return e.prev=4,e.next=7,Yr();case 7:t=e.sent,o.options.overrideFeatureFlags&&Object.assign(t,o.options.overrideFeatureFlags),Jr.set(t,o.name),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("failed to get admin portal feature flags",e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])}))),this.setFeatureFlagsForPreview=function(e){Jr.set(Object.assign({},_D,e),o.name)},this.queryFeatureFlags=function(e){return Jr.getFeatureFlags(e,o.name)},this.updateLocalizationsSetter=function(e){o.updateLocalizations=e},this.getEntitlementsFromStore=function(){var e;return null==(e=o.store.getState().auth.user)?void 0:e.entitlements},this.getUserFromStore=function(){return o.store.getState().auth.user},this.getEntitlementsQueryData=function(e){var t=o.getUserFromStore();return{entitlements:o.getEntitlementsFromStore(),attributes:{custom:e,jwt:t},isV2:_(o.queryFeatureFlags([Hr]),1)[0]}};var l=gD(n),c="frontegg-app-".concat(l);this.iframeRendering=r,this.name=l,this.options=Object.assign({},t,{contextOptions:Object.assign({requestCredentials:"include"},t.contextOptions)}),this.options.cdnUrl&&(this.cdnUrl=this.options.cdnUrl),this.customElementName=c;var d,u,y=this.options.authOptions?Object.assign({},this.options.authOptions,{hostedLoginBox:this.options.hostedLoginBox}):{hostedLoginBox:this.options.hostedLoginBox};if(y.disableSilentRefresh=null==(a=this.options.authOptions)?void 0:a.disableSilentRefresh,this.options.store){if(this.store=this.options.store,!s&&this.options.store.getState().root.appName!==n)throw Error("Mismatch in store names")}else this.store=Xw({context:this.options.contextOptions,appName:this.name},this,this.options.previewMode,y,{auth:null!=(d=this.options.authOptions)?d:{},audits:null!=(u=this.options.auditsOptions)?u:{}},!1,this.options.urlStrategy);C.setInstance(l,this),this.setEntitlementsOptions(t.entitlementsOptions),this.setSessionContext({enableSessionPerTenant:null==(i=t.authOptions)?void 0:i.enableSessionPerTenant}),zo.setAppName(l)}var t,n,a,i;return U(e,[{key:"setEntitlementsOptions",value:function(e){zo.setEntitlementsOptions(Object.assign({},e))}},{key:"setSessionContext",value:function(e){zo.setSessionContext(Object.assign({},e))}},{key:"initContainers",value:(i=M(G().mark((function e(t){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.adminPortalEl=t.adminPortalEl,this.loginBoxEl=t.loginBoxEl,this.checkoutDialogEl=t.checkoutDialogEl,this.adminPortalContainer=t.adminPortalContainer,this.loginBoxContainer=t.loginBoxContainer,this.checkoutDialogContainer=t.checkoutDialogContainer;try{"nextjs"!==this.options.framework&&document.body.classList.add("frontegg-loading")}catch(e){console.error("Failed to add frontegg-loading to body classList")}return e.next=9,this.loadFeatureFlags();case 9:return e.next=11,Promise.all([this.loadAdminBoxMetadata(),this.requestAuthorize()]);case 11:this.options.previewMode||this.options.customLoginBox||(this.loadLoginBox(),n=this.name,a=void 0,void 0,o=void 0,null==(o=null==(i=pD.getInstance(n))||null==(a=i.integrations)?void 0:a.gtm)||o.filter((function(e){var t=e.id;return e.enabled&&function(e){return/^GTM-[a-zA-Z0-9]+$/.test(e)}(t)})).forEach((function(e){var t=e.id,n=document.createElement("script");n.innerHTML="\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(t,"');\n "),document.body.appendChild(n)}))),this.options.lazyLoadAdminPortal||this.loadScript("FronteggAdminPortal");case 13:case"end":return e.stop()}var n,a,i,o}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"updateMetadata",value:function(e){var t;pD.set(e,this.name),null!=e&&e.localizations&&(null==(t=this.updateLocalizations)||t.call(this,e.localizations))}},{key:"addOnLoadedListener",value:function(e){this.loading?this.loadingListeners.push(e):e()}},{key:"ready",value:function(e){this.loading?e():this.addOnLoadedListener(e)}},{key:"loginWithRedirect",value:function(){this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/requestHostedLoginAuthorize"})}},{key:"logout",value:function(){this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/logout"})}},{key:"loadScript",value:function(e){var t=this;return new Promise((function(n,a){if(window[e])n(window[e]);else{var i=document.createElement("script");i.src="".concat(t.cdnUrl,"/").concat({FronteggLoginBox:"login-box/index.js",FronteggAdminPortal:"admin-portal/index.js"}[e]),i.setAttribute("id","".concat(e,"Script")),i.setAttribute("cdn-url",t.cdnUrl),i.onload=function(){window["".concat(e,"Init")]?n(window["".concat(e,"Init")]({FronteggRestApi:k,FronteggTypes:O})):n(window[e])},i.onerror=function(e){console.log("Profile page error",e),a(e)},document.body.append(i)}}))}},{key:"loadLoginBox",value:(a=M(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadScript("FronteggLoginBox");case 2:e.sent.render(this.loginBoxEl,{injector:this,options:this.options}),this.loading=!1,this.loadingListeners.forEach((function(e){try{e()}catch(e){console.error("Failed to call loadLoginBoxListener",e)}})),this.loadingListeners=[];case 7:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"showAdminPortal",value:(n=M(G().mark((function e(t){var n,a;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null!=t?t:{isMultiApp:!1}).isMultiApp,zo.setRequestSource(ua.AdminPortal),e.next=4,this.loadScript("FronteggAdminPortal");case 4:a=e.sent,this.adminPortalRenderer=a.render(this.adminPortalEl,{injector:this,options:Object.assign({isMultiApp:n},this.options)});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"hideAdminPortal",value:function(){try{var e,t=new URLSearchParams(window.location.search);null==(e=this.adminPortalRenderer)||e.unmount(),hD(t),zo.setRequestSource(null)}catch(e){console.error("Failed to unmount admin portal",e)}}},{key:"showCheckoutDialog",value:(t=M(G().mark((function e(t){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadScript("FronteggAdminPortal");case 2:n=e.sent,this.checkoutDialogRenderer=n.renderCheckoutDialog(this.checkoutDialogEl,Object.assign({injector:this},t,{options:this.options}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"hideCheckoutDialog",value:function(){try{var e;null==(e=this.checkoutDialogRenderer)||e.unmount()}catch(e){console.error("Failed to unmount checkout dialog",e)}}},{key:"getFeatureEntitlements",value:function(e,t){var n=this.getEntitlementsQueryData(t);return((e,t,n,a)=>{var i;return Zw(),a?(0,Qw.tE)(t,e,n):eD(null==e||null==(i=e.features)?void 0:i[t],el.MISSING_FEATURE)})(n.entitlements,e,n.attributes,n.isV2)}},{key:"getPermissionEntitlements",value:function(e,t){var n=this.getEntitlementsQueryData(t);return((e,t,n,a)=>{var i;return Zw(),a?(0,Qw.wJ)(t,e,n):eD(null==e||null==(i=e.permissions)?void 0:i[t],el.MISSING_PERMISSION)})(n.entitlements,e,n.attributes,n.isV2)}},{key:"getEntitlements",value:function(e,t){return"permissionKey"in e?this.getPermissionEntitlements(e.permissionKey,t):this.getFeatureEntitlements(e.featureKey,t)}},{key:"loadEntitlements",value:function(e){this.store.dispatch({type:"auth/loadEntitlements",payload:{callback:e}})}},{key:"stepUp",value:function(e){var t=this.store.getState(),n=(null==t?void 0:t.auth)||{},a=n.hostedLoginBox,i=n.routes.stepUpUrl;a?this.store.dispatch({type:"auth/stepUpHostedLogin",payload:e}):((e,t,n)=>{kv();const a=new URLSearchParams(window.location.search);n&&a.set("maxAge",n.toString()),t(`${e}${a?`?${a}`:""}`,{refresh:!1})})(i,t.auth.onRedirectTo,null==e?void 0:e.maxAge)}},{key:"isSteppedUp",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(null==(e=this.store.getState())?void 0:e.auth)||{},a=n.user;return Iv(a,t)}},{key:"close",value:function(){this.hideAdminPortal(),this.hideCheckoutDialog()}}]),e}(),MD=function(){function e(){P(this,e)}return U(e,null,[{key:"setAuthentication",value:function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"default",i=C.getInstance(a);e&&t?(zo.setAccessToken(t),zo.setUser(Object.assign({},n,{accessToken:t})),i.store.dispatch($a.setState({isLoading:!1,isAuthenticated:e,user:n})),i.store.dispatch($a.loadTenants())):(zo.setAccessToken(null),zo.setUser(null),i.store.dispatch($a.setState({isLoading:!1,isAuthenticated:!1,user:null})))}}]),e}(),FD=function(){function e(){P(this,e)}return U(e,null,[{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";C.getInstance(e).showAdminPortal()}},{key:"showMultiApp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";C.getInstance(e).showAdminPortal({isMultiApp:!0})}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";C.getInstance(e).hideAdminPortal()}}]),e}(),GD=function(){function e(){P(this,e)}return U(e,null,[{key:"show",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";C.getInstance(t).showCheckoutDialog(e)}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";C.getInstance(e).hideCheckoutDialog()}}]),e}(),xD=function(e){var t;return null!=(t=window.FronteggAdminPortal.adminPortalStaticThemesDefaults[e])?t:void 0},VD=function(){function e(t,n,a,i){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];P(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.setRoute=function(){},this.themeSetter=void 0,this.themeOptions={};var r={baseUrl:"preview"};if(a){if(this.store=a,!o&&a.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=Xw({context:r,appName:t},this,!0,void 0,void 0,!0);this.options=Object.assign({themeOptions:n,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:r},i),this.app=new ND(this.options,t,!0),pD.set({},t)}var t;return U(e,[{key:"render",value:(t=M(G().mark((function e(t){var n,a,i,o,r=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.querySelector("#root"))||((n=t.ownerDocument.createElement("div")).setAttribute("id","root"),t.appendChild(n)),this.app.adminPortalContainer=t,this.app.adminPortalEl=n,a=function(e){r.themeSetter=e},i=function(e){r.setRoute=e},e.next=8,this.app.loadScript("FronteggAdminPortal");case 8:return o=e.sent,this.app.adminPortalRenderer=o.renderPage(n,{options:this.options,injector:this.app,setThemeSetter:a,setStaticRouteSetter:i}),this.app.loading=!1,e.next=13,vD(this);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setStaticRoute",value:function(e){var t;null==(t=this.setRoute)||t.call(this,e)}},{key:"unmount",value:function(){try{var e;null==(e=this.app.adminPortalRenderer)||e.unmount()}catch(e){console.error("Failed to unmount admin Portal renderer",e)}}},{key:"setTheme",value:function(e){var t;this.themeOptions=e,this.themeSetter||console.warn("this.themeSetter is not defined yet"),null==(t=this.themeSetter)||t.call(this,this.themeOptions)}}]),e}(),jD="modern",BD=function(e){var t,n=window.FronteggAdminPortal.themes;return null!=(t=n[e])?t:n[jD]},WD=function(){function e(t,n,a,i){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];P(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.themeSetter=void 0,this.setRoute=function(){},this.themeOptions={};var r={baseUrl:"preview"};if(a){if(this.store=a,!o&&a.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=Xw({context:r,appName:t},this,!0,void 0,void 0,!0);this.options=Object.assign({themeOptions:n,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:r,onRedirectTo:function(){console.debug("path")}},i),this.app=new ND(this.options,t,!0,o),pD.set({},t)}var t;return U(e,[{key:"render",value:(t=M(G().mark((function e(t){var n,a,i,o,r=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t.querySelector("#root"))||((n=t.ownerDocument.createElement("div")).setAttribute("id","root"),t.appendChild(n)),this.app.loginBoxContainer=t,this.app.loginBoxEl=n,a=function(e){r.themeSetter=e},i=function(e){r.setRoute=e},e.next=8,this.app.loadScript("FronteggLoginBox");case 8:return o=e.sent,this.app.loginBoxRenderer=o.renderPage(n,{options:this.options,injector:this.app,setThemeSetter:a,setStaticRouteSetter:i,staticRoute:"/account/login"}),e.next=12,vD(this);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){try{var e;null==(e=this.app.loginBoxRenderer)||e.unmount()}catch(e){console.error("Failed to unmount login box renderer",e)}}},{key:"setTheme",value:function(e){var t;this.themeOptions=e,this.themeSetter||console.warn("this.themeSetter is not defined yet"),null==(t=this.themeSetter)||t.call(this,this.themeOptions)}},{key:"setStaticRoute",value:function(e){var t;this.setRoute||console.warn("this.setRoute is not defined yet"),null==(t=this.setRoute)||t.call(this,e)}},{key:"setStore",value:function(e){this.store.dispatch({type:"auth/setState",payload:e})}}]),e}();function zD(e,t){return zD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zD(e,t)}function $D(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zD(e,t)}function KD(e,t){if(t&&("object"===L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function HD(e){return HD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HD(e)}function qD(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function JD(e,t,n){return JD=qD()?Reflect.construct.bind():function(e,t,n){var a=[null];a.push.apply(a,t);var i=new(Function.bind.apply(e,a));return n&&zD(i,n.prototype),i},JD.apply(null,arguments)}function YD(e){var t="function"==typeof Map?new Map:void 0;return YD=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return JD(e,arguments,HD(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),zD(n,e)},YD(e)}function XD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=HD(e);if(t){var i=HD(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return KD(this,n)}}var QD=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=new ND(e,t);if("undefined"!=typeof document){var a;if(!e.contextOptions.baseUrl){var i=new Error('Edit <FronteggProvider/> options { ContextOptions: { baseUrl: "" } } in order to connect your application');throw document.body.innerHTML="",alert(i.message),i}if(!customElements.get("frontegg-app")){var o=function(e){$D(n,e);var t=XD(n);function n(){var e;P(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).app=null,e}return U(n,[{key:"connectedCallback",value:function(){this.updateContent()}},{key:"attributeChangedCallback",value:function(e,t,n){if("app-name"===e){if(null===t)return;if(t===n)return;this.innerHTML="",null===n?this.remove():this.updateContent()}console.debug("attributeChangedCallback",e,t,n)}},{key:"updateContent",value:function(){var e,t=null!=(e=this.getAttribute("app-name"))?e:"default",n=C.getInstance(t);if(null===n)throw Error("FronteggApp not found for appName: '".concat(t,"'"));this.setAttribute("id","frontegg-app-".concat(n.name));var a=SD(this,"div",{id:"frontegg-admin-portal-container-".concat(n.name)}),i=SD(this,"div",{id:"frontegg-login-box-container-".concat(n.name)}),o=SD(this,"div",{id:"frontegg-checkout-dialog-container-".concat(n.name)}),r=a.attachShadow({mode:"open"}),s=i.attachShadow({mode:"open"}),l=o.attachShadow({mode:"open"}),c=SD(r,"div",{id:"frontegg-admin-portal-".concat(n.name),class:"frontegg-root-content"}),d=SD(s,"div",{id:"frontegg-login-box-".concat(n.name),class:"frontegg-root-content"}),u=SD(l,"div",{id:"frontegg-checkout-dialog-".concat(n.name),class:"frontegg-root-content"});n.initContainers({adminPortalEl:c,loginBoxEl:d,adminPortalContainer:a,loginBoxContainer:i,checkoutDialogContainer:o,checkoutDialogEl:u})}}],[{key:"observedAttributes",get:function(){return["app-name"]}}]),n}(YD(HTMLElement));customElements.define("frontegg-app",o)}null==(a=document.querySelector('frontegg-app[app-name="'.concat(n.name,'"]')))||a.remove();var r=document.createElement("frontegg-app");r.setAttribute("app-name",n.name),document.body.appendChild(r)}return n}})(),a})()));