aiware-js 1.0.0-master.1344 → 1.0.0-master.1345

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js-core.esm123.js CHANGED
@@ -1 +1 @@
1
- import{b5 as generateUtilityClasses,b4 as generateUtilityClass,b6 as styled,b7 as capitalize,b8 as _extends,bv as alpha,r as reactExports,b9 as useThemeProps,ba as _objectWithoutPropertiesLoose,j as jsxRuntimeExports,bb as clsx,bc as composeClasses,au as AvailableComponents,aI as selectIsSuperAdmin,ad as combineReducers,A as AIWareCacheProvider,b as AIWareThemeProvider,u as useSelector,ao as selectIsFullscreenEnabled,az as selectOrgId,a9 as isEqual,p as hidePanel,v as mountPanel,B as Box,aW as loginUrlSelector,a6 as selectApiConfigs,ah as preferredLanguageSelector,ai as lodashExports,a8 as baseGraphQLApiWithError,_ as all,aj as showMessage,ak as MessageSeverity,al as AIWareFormatMessage,aK as guid}from"./js-core.esm4.js";import{bE as ButtonBase,D as DynamicModuleLoader,A as AIWareIntlProvider,B as Button,ac as ProgressStepper,M as MemoizedFormattedMessage,G as Grid,T as Typography,p as Divider,o as Delete,g as Add$1,bh as Group,Y as startCase}from"./js-core.esm7.js";import{g as generateState,ad as generateSingleState,y as tableInfiniteScroll,ae as imageUpload,P as useForm,Q as FormProvider,a3 as LoadingButton,ak as EmptyState,z as centerComponents,S as Stack,c as Skeleton,B as panelComponents,aN as useFormContext,b as TextField,aO as Controller,ai as CustomColorInput,aj as ButtonPreview,l as Switch,I as IconButton,A as Avatar,a as Chip,aP as FormBuilder,t as CopyText,al as EditOutlined,aJ as VisibilityOutlined,aI as DeleteOutline,aH as ContextMenu}from"./js-core.esm9.js";import{a as selectAdminCenterOrgId,h as selectAdminCenterOrgGuidParameter,g as selectAdminCenterOrgParameter,A as AvatarGroup}from"./js-core.esm27.js";import{g as groupBy,u as upperCase}from"./js-core.esm82.js";import{s as snakeCase}from"./js-core.esm55.js";import{c as cloneDeep,d as defaultsDeep}from"./js-core.esm70.js";import{k as kebabCase}from"./js-core.esm22.js";import{u as useDropzone}from"./js-core.esm124.js";import{A as Add}from"./js-core.esm40.js";import{u as useDispatch}from"./js-core.esm14.js";import"./js-core.esm8.js";function getToggleButtonUtilityClass(e){return generateUtilityClass("MuiToggleButton",e)}let toggleButtonClasses=generateUtilityClasses("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),_excluded$1=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],useUtilityClasses$1=e=>{var{classes:e,fullWidth:t,selected:r,disabled:n,size:o,color:i}=e,r={root:["root",r&&"selected",n&&"disabled",t&&"fullWidth","size"+capitalize(o),i]};return composeClasses(r,getToggleButtonUtilityClass,e)},ToggleButtonRoot=styled(ButtonBase,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{e=e.ownerState;return[t.root,t["size"+capitalize(e.size)]]}})(({theme:e,ownerState:t})=>{let r="standard"===t.color?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r="standard"===t.color?e.vars.palette.text.primary:e.vars.palette[t.color].main,n="standard"===t.color?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_extends({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:"1px solid "+(e.vars||e).palette.divider,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{["&."+toggleButtonClasses.disabled]:{color:(e.vars||e).palette.action.disabled,border:"1px solid "+(e.vars||e).palette.action.disabledBackground},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},["&."+toggleButtonClasses.selected]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:alpha(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:alpha(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:alpha(r,e.palette.action.selectedOpacity)}}}},"small"===t.size&&{padding:7,fontSize:e.typography.pxToRem(13)},"large"===t.size&&{padding:15,fontSize:e.typography.pxToRem(15)})}),ToggleButton=reactExports.forwardRef(function(e,t){e=useThemeProps({props:e,name:"MuiToggleButton"});let{children:r,className:n,color:o="standard",disabled:i=!1,disableFocusRipple:a=!1,fullWidth:s=!1,onChange:l,onClick:c,selected:u,size:p="medium",value:d}=e,m=_objectWithoutPropertiesLoose(e,_excluded$1);var e=_extends({},e,{color:o,disabled:i,disableFocusRipple:a,fullWidth:s,size:p}),g=useUtilityClasses$1(e);return jsxRuntimeExports.jsx(ToggleButtonRoot,_extends({className:clsx(g.root,n),disabled:i,focusRipple:!a,ref:t,onClick:e=>{c&&(c(e,d),e.defaultPrevented)||l&&l(e,d)},onChange:l,value:d,ownerState:e,"aria-pressed":u},m,{children:r}))});function isValueSelected(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?0<=t.indexOf(e):e===t)}function getToggleButtonGroupUtilityClass(e){return generateUtilityClass("MuiToggleButtonGroup",e)}let toggleButtonGroupClasses=generateUtilityClasses("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical"]),_excluded=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],useUtilityClasses=e=>{var{classes:e,orientation:t,fullWidth:r,disabled:n}=e,r={root:["root","vertical"===t&&"vertical",r&&"fullWidth"],grouped:["grouped","grouped"+capitalize(t),n&&"disabled"]};return composeClasses(r,getToggleButtonGroupUtilityClass,e)},ToggleButtonGroupRoot=styled("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{e=e.ownerState;return[{["& ."+toggleButtonGroupClasses.grouped]:t.grouped},{["& ."+toggleButtonGroupClasses.grouped]:t["grouped"+capitalize(e.orientation)]},t.root,"vertical"===e.orientation&&t.vertical,e.fullWidth&&t.fullWidth]}})(({ownerState:e,theme:t})=>_extends({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"vertical"===e.orientation&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{["& ."+toggleButtonGroupClasses.grouped]:_extends({},"horizontal"===e.orientation?{"&:not(:first-of-type)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0},[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.`+toggleButtonGroupClasses.selected]:{borderLeft:0,marginLeft:0}}:{"&:not(:first-of-type)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-of-type)":{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.`+toggleButtonGroupClasses.selected]:{borderTop:0,marginTop:0}})})),ToggleButtonGroup=reactExports.forwardRef(function(e,t){e=useThemeProps({props:e,name:"MuiToggleButtonGroup"});let{children:r,className:n,color:o="standard",disabled:i=!1,exclusive:a=!1,fullWidth:s=!1,onChange:l,orientation:c="horizontal",size:u="medium",value:p}=e,d=_objectWithoutPropertiesLoose(e,_excluded);e=_extends({},e,{disabled:i,fullWidth:s,orientation:c,size:u});let m=useUtilityClasses(e),g=(t,r)=>{if(l){var n=p&&p.indexOf(r);let e;p&&0<=n?(e=p.slice()).splice(n,1):e=p?p.concat(r):[r],l(t,e)}},f=(e,t)=>{l&&l(e,p===t?null:t)};return jsxRuntimeExports.jsx(ToggleButtonGroupRoot,_extends({role:"group",className:clsx(m.root,n),ref:t,ownerState:e},d,{children:reactExports.Children.map(r,e=>reactExports.isValidElement(e)?reactExports.cloneElement(e,{className:clsx(m.grouped,e.props.className),onChange:a?f:g,selected:void 0===e.props.selected?isValueSelected(e.props.value,p):e.props.selected,size:e.props.size||u,fullWidth:s,color:e.props.color||o,disabled:e.props.disabled||i}):null)}))});var OrgazionRegistrationStatus,OrgDocumentType,OrgDocumentStatus,ImportStatus,SHARED_TEXT={title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.title",defaultMessage:"Registration",description:"Admin Center Registration Title"})},subTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.sub-title",defaultMessage:"Create a custom branded registration page for users of this Organization.",description:"Admin Center Registration Subtitle"})},panel:{editTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.panel.edit-title",defaultMessage:"Edit Registration",description:"Admin Center Registration Panel Edit Title"})},createTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.panel.create-title",defaultMessage:"New Registration",description:"Admin Center Registration Panel Create Title"})}},form:{basicInfo:{newDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.description.new",defaultMessage:"Create a custom branded registration page for this organization, with a dedicated domain for users to access their aiWARE account.",description:"Description for the basic info step in registration form"})},editDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.description.edit",defaultMessage:"Edit your custom branded registration page for this organization.",description:"Description for the basic info step in registration form"})},brandLogoTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.brand-logo-title",defaultMessage:"Brand Logo",description:"Title for brand logo section"})},brandLogoDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.brand-logo-description",defaultMessage:"This logo will be used on your registration page.",description:"Description for brand logo usage"})},customUrlTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.custom-url-title",defaultMessage:"Custom Registration URL Slug",description:"Title for custom URL slug section"})},customUrlDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.custom-url-description",defaultMessage:"Type in the slug name that will be added to your registration url.",description:"Description for custom URL slug input"})},urlExample:function(e){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.url-example",defaultMessage:"URL Example: {url}",description:"Example of how the custom URL will look",values:{url:e}})}},userAccess:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.description",defaultMessage:"Manage registered users product roles and groups when they join this Organization.",description:"Description for the user access step"})},openRegistration:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration",defaultMessage:"Open Registration",description:"Open registration toggle button"})},allowlistOnly:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.allowlist-only",defaultMessage:"Allowlist only",description:"Allowlist only toggle button"})},openRegistrationDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration-description",defaultMessage:"Anyone can register for this Organization.",description:"Description for open registration"})},chooseUserAccess:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.choose-user-access",defaultMessage:"Choose User Access",description:"Button text for choosing user access"})},openRegistrationGroupDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration-group-description",defaultMessage:"Users who register will join this group and receive access to these products.",description:"Description for open registration group access"})},restrictedRegistrationDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.restricted-registration-description",defaultMessage:"Create a list of domains that are allowed to register for this Organization.",description:"Description for restricted registration"})},adminApprovalTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.admin-approval-title",defaultMessage:"Admin Approval Required",description:"Title for admin approval section"})},adminApprovalDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.admin-approval-description",defaultMessage:"Any user who registers for this Organization must first be approved by an Admin user.",description:"Description for admin approval requirement"})}},appearance:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.description",defaultMessage:"Customize the look and feel of your registration page by changing options below.",description:"Description for the appearance step in registration form"})},buttonColorTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.button-color-title",defaultMessage:"Customize Button Color",description:"Title for button color customization section"})},buttonColorDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.button-color-description",defaultMessage:"Change the primary and secondary color of the login and sign up pages to match your brand.",description:"Description for button color customization"})},veritoneBrandingTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.veritone-branding-title",defaultMessage:"Remove Veritone Branding",description:"Title for Veritone branding removal option"})},veritoneBrandingDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.veritone-branding-description",defaultMessage:"When enabled, Veritone logos and branding will be removed from your custom login page.",description:"Description for Veritone branding removal option"})}},formBuilder:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.form-builder.description",defaultMessage:"Create a custom Registration Form for your organization.",description:"Description for the form builder step in registration form"})}},legalInfo:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.description",defaultMessage:"Create a custom branded registration page for this organization, with a dedicated domain for users to access their aiWARE account.",description:"Description for the legal info step in registration form"})},termsOfServiceTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-title",defaultMessage:"Terms of Service",description:"Title for terms of service section"})},termsOfServiceDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-description",defaultMessage:"Include a custom terms of service that will be displayed for all users during registration.",description:"Description for terms of service input"})},termsOfServiceUploadButton:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-upload-button",defaultMessage:"Upload Terms of Service",description:"Button for uploading terms of service"})},termsOfServiceUploadInfo:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-upload-info",defaultMessage:"file must be .txt or .pdf format",description:"Info for uploading terms of service"})},privacyPolicyTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.privacy-policy-title",defaultMessage:"Privacy Policy",description:"Title for privacy policy section"})},privacyPolicyDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.privacy-policy-description",defaultMessage:"Add your own Privacy Policy that will display during registration in in your app footer.",description:"Description for privacy policy input"})},fileName:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.file-name",defaultMessage:"File Name",description:"File name label"})},status:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.status",defaultMessage:"Status",description:"Status label"})}}},emptyState:{title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.title",defaultMessage:"No Custom Registration Page Found",description:"Admin Center custom login table empty state"})},description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.description",defaultMessage:"You haven’t created a custom registration for this Organization",description:"Admin Center custom login table empty state"})},createButton:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.create-button",defaultMessage:"Create Custom Registration",description:"Admin Center custom login table empty state"})},error:{title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.error.title",defaultMessage:"Error Loading Registrations",description:"Admin Center custom login table empty state"})},description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.error.description",defaultMessage:"An error occurred while loading registrations. Please try again.",description:"Admin Center custom login table empty state"})}}}},SLICE_NAME="adminCenterRegistration",TEST_ID="os-admin-center.registration",TEST_ID_PANEL="os-admin-center.custom-registration-panel",CUSTOM_REGISTRATION_PANEL_ID=AvailableComponents.ADMIN_CENTER_CUSTOM_REGISTRATION_PANEL,useRegistrationPanel=((e=>{e.open="open",e.restricted="restricted"})(OrgazionRegistrationStatus=OrgazionRegistrationStatus||{}),(e=>{e.privacy_policy="privacyPolicy",e.terms_of_service="termsOfService"})(OrgDocumentType=OrgDocumentType||{}),(e=>{e.active="active",e.inactive="inactive"})(OrgDocumentStatus=OrgDocumentStatus||{}),function(){var t=useDispatch(),r=useSelector(selectIsFullscreenEnabled);return function(e){t(mountPanel({panelId:CUSTOM_REGISTRATION_PANEL_ID,microFrontend:{name:CUSTOM_REGISTRATION_PANEL_ID,config:e?{id:e}:{}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"large",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))}});function asyncGeneratorStep$6(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$6(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$6(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$6(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$8(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$a(t,e,r[e])})}return t}function _ts_generator$7(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function getSignedWritableUrl(e,t){return _getSignedWritableUrl.apply(this,arguments)}function _getSignedWritableUrl(){return(_getSignedWritableUrl=_async_to_generator$6(function(t,r){var n,o;return _ts_generator$7(this,function(e){switch(e.label){case 0:return n="getSignedWritableUrl",o="query ".concat(n,"($name: String!) {\n ").concat(n,"(key: $name) {\n bucket,\n expiresInSeconds,\n getUrl,\n key,\n unsignedUrl,\n url,\n }\n }"),[4,baseGraphQLApiWithError(_object_spread$8({query:o,variables:{name:r},operationName:n},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function asyncGeneratorStep$5(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$5(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$5(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$5(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$9(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$7(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$9(t,e,r[e])})}return t}function _ts_generator$6(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}(e=>{e.Idle="idle",e.Uploading="uploading",e.Uploaded="uploaded",e.Failed="failed",e.Aborted="aborted"})(ImportStatus=ImportStatus||{});var REGISTRATION_FIELDS="\n id\n organizationGuid\n name\n slug\n files {\n name\n url\n type\n status\n }\n openRegistrationStatus\n adminApprovalRequired\n uiSettings {\n logo\n veritoneBranding\n customRegistrationFields\n registrationButtonStyle\n }\n domainSettings {\n domainName\n authGroupId\n applicationRoleIds\n }\n dateCreated\n dateModified\n";function createRegistrationConfiguration(e){return _createRegistrationConfiguration.apply(this,arguments)}function _createRegistrationConfiguration(){return(_createRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n=t.item,i=o="createRegistrationConfiguration",s=null==(s=t.additionalSelectors)?void 0:s.orgGuid,a="\n mutation ".concat(o,"($input: CreateRegistrationConfigurationInput!) {\n ").concat(i,"(input: $input) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n "),s={input:_object_spread$7({},s&&{organizationGuid:s},n)},[4,baseGraphQLApiWithError(_object_spread$7({query:a,variables:s,operationName:o},r))];case 1:return[2,e.sent()[i]]}})})).apply(this,arguments)}function updateRegistrationConfiguration(e){return _updateRegistrationConfiguration.apply(this,arguments)}function _updateRegistrationConfiguration(){return(_updateRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,s=t.item,o=n="updateRegistrationConfiguration",i="\n mutation ".concat(n,"($id: ID!, $input: UpdateRegistrationConfiguration!) {\n ").concat(o,"(id: $id, input: $input) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n "),a={organizationGuid:s.organizationGuid,name:s.name,slug:s.slug,files:s.files,openRegistrationStatus:s.openRegistrationStatus,adminApprovalRequired:s.adminApprovalRequired,uiSettings:s.uiSettings,domainSettings:s.domainSettings.map(function(e){var t;return{domainName:e.domainName,authGroupId:null!=(t=e.authGroupId)?t:"",applicationRoleIds:e.applicationRoleIds}})},s={id:s.id,input:a},[4,baseGraphQLApiWithError(_object_spread$7({query:i,variables:s,operationName:n},r))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function deleteRegistrationConfiguration(e){return _deleteRegistrationConfiguration.apply(this,arguments)}function _deleteRegistrationConfiguration(){return(_deleteRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n=t.itemToDelete,o="deleteRegistrationConfiguration",i="\n mutation ".concat(o,"($id: ID!) {\n ").concat("deleteRegistrationConfiguration","(id: $id) {\n id\n }\n }\n "),a={id:n.id},[4,baseGraphQLApiWithError(_object_spread$7({query:i,variables:a,operationName:o},r))];case 1:return e.sent(),[2,n]}})})).apply(this,arguments)}function getRegistrationConfiguration(e){return _getRegistrationConfiguration.apply(this,arguments)}function _getRegistrationConfiguration(){return(_getRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,o="registrationConfiguration",i=t.payload,a="\n query ".concat(n="getRegistrationConfiguration","($id: ID!) {\n ").concat(o,"(id: $id) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }"),[4,baseGraphQLApiWithError(_object_spread$7({query:a,variables:{id:i},operationName:n},r))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function getOrgRegistrationConfiguration(e){return _getOrgRegistrationConfiguration.apply(this,arguments)}function _getOrgRegistrationConfiguration(){return(_getOrgRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n="fetchCustomRegistrationConfig",o="organization",i="registrationConfigurations",a=t.additionalSelectors.orgId,s="\n query ".concat(n,"($orgId: ID!) {\n ").concat(o," (id: $orgId) {\n ").concat(i," {\n records {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$7({query:s,variables:{orgId:a},operationName:n},r))];case 1:return[2,e.sent()[o][i].records]}})})).apply(this,arguments)}function _array_like_to_array$4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_without_holes$2(e){if(Array.isArray(e))return _array_like_to_array$4(e)}function asyncGeneratorStep$4(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$4(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$4(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$4(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$2(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$6(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$8(t,e,r[e])})}return t}function _to_consumable_array$2(e){return _array_without_holes$2(e)||_iterable_to_array$2(e)||_unsupported_iterable_to_array$4(e)||_non_iterable_spread$2()}function _unsupported_iterable_to_array$4(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$4(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$4(e,t):void 0}function _ts_generator$5(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var fetchAppRoles=(()=>{var t=_async_to_generator$4(function(t){var r,n,o,i,a,s,l,c;return _ts_generator$5(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n="organization",o="applications",i=t.payload,a="\n query ".concat(s="fetchAppRoles"," ($id: ID!){\n ").concat(n," (id: $id) {\n roles(isAppEventRole: false) {\n id\n name\n appName\n description\n }\n }\n ").concat(o," (\n limit: 999\n ) {\n records {\n id\n name\n description\n iconUrl\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$6({query:a,operationName:s,variables:{id:i.orgId}},r))];case 1:return a=e.sent(),s=a[n].roles,l=a[o].records,c=groupBy(s,"appName"),[2,Object.keys(c).map(function(t){var e=l.find(function(e){return snakeCase(e.name)===t});return{id:t,icon:null==e?void 0:e.iconUrl,description:null==e?void 0:e.description,label:upperCase(startCase(t)),roles:_to_consumable_array$2(c[t])}})]}})});return function(e){return t.apply(this,arguments)}})();function asyncGeneratorStep$3(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$3(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$3(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$3(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$7(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$5(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$7(t,e,r[e])})}return t}function ownKeys$5(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$5(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$5(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator$4(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var _obj,_obj1,getAuthGroups=(()=>{var t=_async_to_generator$3(function(t){var r,n,o,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,i=t.additionalSelectors,n=t.payload,i=i,o="authGroups",i="\n query authGroups {\n ".concat(o," ").concat(null!=i&&i.isSuperAdmin?'(ownerOrganization: "'.concat(n.orgId,'")'):""," {\n records {\n id\n name\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread_props$5(_object_spread$5({},r),{query:i}))];case 1:return[2,e.sent()[o].records]}})});return function(e){return t.apply(this,arguments)}})(),namespace$3="registration",_generateState$2=generateState({sliceName:SLICE_NAME,namespace:namespace$3,dedupeResponse:!0,apiCalls:{read:getOrgRegistrationConfiguration,delete:deleteRegistrationConfiguration,getAdditionalSelectors:function(){return{orgId:selectAdminCenterOrgId}}},toast:{update:{success:"Registration configuration updated successfully",error:"Failed to update Registration configuration"},delete:{success:"Registration configuration successfully removed",error:"Failed to remove Registration configuration"}}}),slice$3=_generateState$2.slice,selectors$4=_generateState$2.selectors,sagas$3=_generateState$2.sagas,initialState$3=_generateState$2.initialState,namespace$2="registrationWizard",_generateSingleState=generateSingleState({sliceName:SLICE_NAME,namespace:namespace$2,apiCalls:{read:getRegistrationConfiguration,create:createRegistrationConfiguration,update:updateRegistrationConfiguration,getAdditionalSelectors:function(){return{orgGuid:selectAdminCenterOrgGuidParameter}}},additionalState:{activeStep:1,wizard:{name:"",slug:"",files:[],openRegistrationStatus:"open",uiSettings:{logo:"",veritoneBranding:!1,customRegistrationFields:{},registrationButtonStyle:{textColor:"#FFF",backgroundColor:"#1E88E5"}},adminApprovalRequired:!1,domainSettings:[]}},toast:{create:{success:"Registration Created",error:"Failed to create Registration, please try again later."},update:{success:"Registration Updated",error:"Failed to update Registration, please try again later."}}}),slice$2=_generateSingleState.slice,selectors$3=_generateSingleState.selectors,sagas$2=_generateSingleState.sagas,initialState$2=_generateSingleState.initialState,namespace$1="appRoles",_generateState$1=generateState({namespace:namespace$1,sliceName:SLICE_NAME,dedupeResponse:!0,apiCalls:{read:fetchAppRoles,getAdditionalSelectors:function(){return{isSuperAdmin:selectIsSuperAdmin}}}}),slice$1=_generateState$1.slice,selectors$2=_generateState$1.selectors,sagas$1=_generateState$1.sagas,initialState$1=_generateState$1.initialState,namespace="authGroups",_generateState=generateState({namespace:namespace,sliceName:SLICE_NAME,dedupeResponse:!0,apiCalls:{read:getAuthGroups,getAdditionalSelectors:function(){return{isSuperAdmin:selectIsSuperAdmin}}}}),slice=_generateState.slice,selectors$1=_generateState.selectors,sagas=_generateState.sagas,initialState=_generateState.initialState;function _define_property$6(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}_define_property$6(_obj={},namespace$3,initialState$3),_define_property$6(_obj,namespace$2,initialState$2),_define_property$6(_obj,namespace$1,initialState$1),_define_property$6(_obj,namespace,initialState);_define_property$6(_obj1={},namespace$3,slice$3.actions),_define_property$6(_obj1,namespace$2,slice$2.actions),_define_property$6(_obj1,namespace$1,slice$1.actions),_define_property$6(_obj1,namespace,slice.actions);var _obj2,_obj3,actions=_obj1,selectors=(_define_property$6(_obj2={},namespace$3,selectors$4),_define_property$6(_obj2,namespace$2,selectors$3),_define_property$6(_obj2,namespace$1,selectors$2),_define_property$6(_obj2,namespace,selectors$1),_obj2),rootReducer=combineReducers((_define_property$6(_obj3={},namespace$3,slice$3.reducer),_define_property$6(_obj3,namespace$2,slice$2.reducer),_define_property$6(_obj3,namespace$1,slice$1.reducer),_define_property$6(_obj3,namespace,slice.reducer),_obj3));function _ts_generator$3(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function rootSaga(){return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,all([sagas$3.watchRead(),sagas$3.watchUpdate(),sagas$3.watchDelete(),sagas$2.watchRead(),sagas$2.watchCreate(),sagas$2.watchUpdate(),sagas$1.watchRead(),sagas.watchRead()])];case 1:return e.sent(),[2]}})}function _define_property$5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function getAdminCenterRegistrationModule(){return{id:SLICE_NAME,reducerMap:_define_property$5({},SLICE_NAME,rootReducer),sagas:[rootSaga],initialActions:[]}}var TableHeader=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{"data-testid":"custom-registration-table-header",sx:{height:32,pl:3},alignItems:"center",display:"flex",container:!0,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-name",defaultMessage:"Name",description:"Shared Custom Login Table header column name"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-slug",defaultMessage:"Slug",description:"Shared Custom Login Table header column slug"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-colors",defaultMessage:"Date Created",description:"Date Created"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-logo",defaultMessage:"Modified Date",description:"Modified Date"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1})]}),jsxRuntimeExports.jsx(Divider,{})]})};function _array_like_to_array$3(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes$2(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$2(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest$2(){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 _sliced_to_array$2(e,t){return _array_with_holes$2(e)||_iterable_to_array_limit$2(e,t)||_unsupported_iterable_to_array$3(e,t)||_non_iterable_rest$2()}function _unsupported_iterable_to_array$3(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$3(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$3(e,t):void 0}var convertTime=function(e){var e=_sliced_to_array$2(e.split(":").map(Number),2),t=e[0],e=e[1],r=12<=t?"PM":"AM";return"".concat(t%12||12,":").concat(e.toString().padStart(2,"0")," ").concat(r)},dateFormatter=function(e){var t,r,n;return(e=e&&(isNaN(Number(e))?new Date(e):new Date(Number(e))))?(t=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),n=e.getFullYear(),e=convertTime(e.toTimeString().split(" ")[0]),{date:"".concat(t,"/").concat(r,"/").concat(n),time:e}):"N/A"},itemHeight$1=60,TableRow=function(e){var t=e.index,r=e.testId,n=e.onEdit,o=e.onView,i=e.onDelete,e=e.item,a="".concat(itemHeight$1-1,"px"),s="/".concat(e.slug),l=reactExports.useCallback(function(){return null==o?void 0:o()},[o]),c=reactExports.useCallback(function(){return null==n?void 0:n()},[n]),u=reactExports.useCallback(function(){return null==i?void 0:i()},[i]);return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",minHeight:a,cursor:"pointer",borderBottom:"1px solid #D5DFE9",display:"grid","&:hover":{backgroundColor:"#F5F7FA"}},"data-testid":"".concat(r,"-table-row-").concat(t),onClick:c,children:jsxRuntimeExports.jsxs(Grid,{"data-testid":"".concat(r,"-registration-item"),sx:{width:"100%",height:"100%",paddingLeft:"15px"},alignItems:"center",display:"flex",container:!0,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,children:jsxRuntimeExports.jsx(Typography,{"data-testid":"registration-table-row-name",children:e.name})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,sx:{paddingRight:"10px"},children:jsxRuntimeExports.jsx(CopyText,{id:"registration-slug",value:s,sx:{fontWeight:"bold",padding:"2px 5px",fontSize:"small",wordBreak:"break-all"}})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(RenderDate,{date:e.dateCreated,testId:"registration-table-row-created"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(RenderDate,{date:e.dateModified,testId:"registration-table-row-modified"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1,onClick:function(e){return e.stopPropagation()},children:jsxRuntimeExports.jsx(RegContextMenu,{onEdit:c,onView:l,onDelete:u,testId:r})})]})})},RenderDate=function(e){var t=e.date,e=e.testId,t=dateFormatter(t);return"N/A"!==t?jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontWeight:400,"data-testid":"".concat(e,"-date"),children:t.date}),jsxRuntimeExports.jsx(Typography,{variant:"caption",fontSize:"12px","data-testid":"".concat(e,"-time"),children:t.time})]}):jsxRuntimeExports.jsx(Typography,{"data-testid":"".concat(e,"-date"),children:t})},RegContextMenu=function(e){var t=e.onEdit,r=e.onView,n=e.onDelete,e=e.testId,o=reactExports.useMemo(function(){return[{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-edit",defaultMessage:"Edit",description:"Admin Center Registration table row context menu edit"}),onClick:t,testId:"edit",icon:jsxRuntimeExports.jsx(EditOutlined,{fontSize:"small"})},{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-preview",defaultMessage:"View Page",description:"Admin Center Registration table row context menu view page"}),onClick:r,testId:"view",icon:jsxRuntimeExports.jsx(VisibilityOutlined,{fontSize:"small"})},{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-delete",defaultMessage:"Delete",description:"Admin Center Registration table row context menu delete"}),onClick:n,testId:"delete",icon:jsxRuntimeExports.jsx(DeleteOutline,{fontSize:"small"})}]},[t,r,n]);return jsxRuntimeExports.jsx(ContextMenu,{menuItems:o,testId:"".concat(e,"-registration-menu")})},TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,itemHeight=60,Table=function(){var r=useDispatch(),n=useRegistrationPanel(),e=useSelector(selectors.registration.selectItems),t=useSelector(selectors.registration.selectReadStatus);return jsxRuntimeExports.jsx(Box,{height:"calc(100vh - 240px)",children:jsxRuntimeExports.jsx(TableInfiniteScroll,{offset:0,testId:TEST_ID,hasMore:!1,fetchMore:function(){r(actions.registration.readStart(null))},fetchOnMount:0===e.length,items:e,itemHeight:itemHeight,isLoading:"pending"===t,error:"failure"===t,TableHeaderComponent:jsxRuntimeExports.jsx(TableHeader,{}),TableRowComponent:function(e){var t=e.item;return jsxRuntimeExports.jsx(TableRow,{item:t,index:e.index,testId:TEST_ID,onEdit:function(){return n(t.id)},onDelete:function(){r(actions.registration.deleteStart(t))}})},MessageErrorState:SHARED_TEXT.emptyState.error.title(),DescriptionErrorState:SHARED_TEXT.emptyState.error.description(),adjustTableHeight:-40,TableEmptyStateComponent:jsxRuntimeExports.jsx(EmptyState,{title:SHARED_TEXT.emptyState.title(),description:SHARED_TEXT.emptyState.description(),buttonLabel:SHARED_TEXT.emptyState.createButton(),onClick:function(){return n()}})})})},CenterTabHeading=centerComponents.CenterTabHeading,CenterTabContainer=centerComponents.CenterTabContainer,CenterTabContent=centerComponents.CenterTabContent,MainLayout=function(){var e=useRegistrationPanel();return jsxRuntimeExports.jsxs(CenterTabContainer,{testId:TEST_ID,children:[jsxRuntimeExports.jsx(CenterTabHeading,{title:SHARED_TEXT.title(),subtitle:SHARED_TEXT.subTitle(),testId:TEST_ID,HeadingActions:jsxRuntimeExports.jsx(Button,{onClick:function(){return e()},variant:"contained",startIcon:jsxRuntimeExports.jsx(Add,{}),"data-testid":"".concat(TEST_ID,".create-new"),children:"New"})}),jsxRuntimeExports.jsx(CenterTabContent,{testId:TEST_ID,children:jsxRuntimeExports.jsx(Table,{})})]})},CustomRegistrationTab=function(){return jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterRegistrationModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(MainLayout,{})})})})})};function _define_property$4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$4(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$4(t,e,r[e])})}return t}function ownKeys$4(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$4(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$4(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}var ImageUpload=imageUpload.jsx.ImageUpload,FILE_TYPES="image/png, image/svg+xml, image/jpeg",LOGO_SIZE={outerWidth:"366px",outerHeight:"161px"},BasicInfoStep=function(e){var e=e.isEditMode,t=useFormContext(),r=t.register,n=t.control,o=t.formState.errors,t=(0,t.watch)("slug"),i=useSelector(loginUrlSelector);return jsxRuntimeExports.jsxs(Stack,{sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsxs(Stack,{gap:2,children:[!e&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.newDescription()}),e&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.editDescription()}),jsxRuntimeExports.jsx(TextField,_object_spread_props$4(_object_spread$4({},r("name",{required:!0})),{fullWidth:!0,placeholder:"Registration Name",error:!!o.name,helperText:null==(e=o.name)?void 0:e.message,"data-testid":"".concat(TEST_ID,"--registration-name-input")}))]}),jsxRuntimeExports.jsxs(Stack,{gap:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.basicInfo.brandLogoTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.brandLogoDescription()}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",children:["Recommended image size:",jsxRuntimeExports.jsx("br",{}),"300x200 .png or .svg"]}),jsxRuntimeExports.jsx(Controller,{name:"uiSettings.logo",defaultValue:"",control:n,rules:{required:"Brand Logo is required."},render:function(e){var e=e.field,t=e.onChange,e=e.value;return jsxRuntimeExports.jsx(ImageUpload,{testId:"".concat(TEST_ID,"--brand-logo"),image:e,getUrl:!1,outerWidth:LOGO_SIZE.outerWidth,outerHeight:LOGO_SIZE.outerHeight,innerHeight:"145px",innerWidth:"350px",fileTypes:FILE_TYPES,handleChange:function(e){e?getFileAsBase64(e,function(e){"string"==typeof e&&t(e)}):t("")}})}}),o.uiSettings&&"logo"in o.uiSettings&&jsxRuntimeExports.jsx(Typography,{color:"error",variant:"caption",children:null==(e=o.uiSettings.logo)?void 0:e.message})]}),jsxRuntimeExports.jsxs(Stack,{gap:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.basicInfo.customUrlTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.customUrlDescription()}),jsxRuntimeExports.jsx(TextField,_object_spread_props$4(_object_spread$4({},r("slug",{required:!0,pattern:{value:/^[a-z0-9]+(?:-[a-z0-9]+)*$/,message:"Slug must be lowercase and contain only letters, numbers, and hyphens."},minLength:{value:3,message:"Slug must be at least 3 characters long."},setValueAs:function(e){return kebabCase(e)}})),{fullWidth:!0,error:!!o.slug,helperText:null==(n=o.slug)?void 0:n.message,"data-testid":"".concat(TEST_ID,"--registration-slug-input")})),jsxRuntimeExports.jsxs(Typography,{variant:"caption",fontWeight:400,children:[SHARED_TEXT.form.basicInfo.urlExample(i.replace(/(.us-1|https:\/\/)/g,"").replace("login","signup")+"/"),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"black",fontWeight:800,children:"".concat(t||"<slug>")})]})]})]})};function getFileAsBase64(e,t){var r=new FileReader;r.readAsDataURL(e),r.onload=function(){t(r.result)},r.onerror=function(e){console.log("error getting base64: ",e)}}function _array_like_to_array$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes$1(e){if(Array.isArray(e))return e}function _define_property$3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array_limit$1(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest$1(){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 _object_spread$3(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$3(t,e,r[e])})}return t}function ownKeys$3(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$3(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$3(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array$1(e,t){return _array_with_holes$1(e)||_iterable_to_array_limit$1(e,t)||_unsupported_iterable_to_array$2(e,t)||_non_iterable_rest$1()}function _unsupported_iterable_to_array$2(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$2(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$2(e,t):void 0}var ApperanceStep=function(){var e=useFormContext(),t=e.trigger,r=e.watch,e=e.control,n=_sliced_to_array$1(reactExports.useState(null),2),o=n[0],i=n[1],a=useSelector(selectors.registrationWizard.selectItem),n=r("uiSettings.registrationButtonStyle.backgroundColor"),r=r("uiSettings.registrationButtonStyle.textColor"),s=reactExports.useCallback(function(e){i(e?null:"Invalid color selection"),setTimeout(function(){t("uiSettings.registrationButtonStyle")},50)},[t]);return jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".form-appearance"),sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.description()}),jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsxs(Stack,{gap:1,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.appearance.buttonColorTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.buttonColorDescription()})]}),jsxRuntimeExports.jsxs(Stack,{gap:4,bgcolor:"#F5F5F5",border:"1px solid #E0E0E0",p:4,alignItems:"center",children:[jsxRuntimeExports.jsx(Controller,{name:"uiSettings.registrationButtonStyle",control:e,rules:{validate:function(e){return o||!(!e.textColor||!e.backgroundColor)||"Both colors are required"}},render:function(e){var t=e.field;return jsxRuntimeExports.jsx(CustomColorInput,{isButtonColorRequired:!1,buttonColor:t.value.backgroundColor,buttonTextColor:t.value.textColor,onValidationCheck:s,onChangeTextColor:function(e){return t.onChange(_object_spread_props$3(_object_spread$3({},t.value),{textColor:e}))},onChangeButtonColor:function(e){return t.onChange(_object_spread_props$3(_object_spread$3({},t.value),{backgroundColor:e}))},onReset:function(){a&&0<Object.keys(a).length?t.onChange({textColor:a.uiSettings.registrationButtonStyle.textColor,backgroundColor:a.uiSettings.registrationButtonStyle.backgroundColor}):t.onChange({textColor:"#FFFFFF",backgroundColor:"#1E88E5"}),s(!0)}})}}),jsxRuntimeExports.jsx(ButtonPreview,{buttonColor:n,buttonTextColor:r})]})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{gap:1,maxWidth:"80%",children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.appearance.veritoneBrandingTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.veritoneBrandingDescription()})]}),jsxRuntimeExports.jsx(Controller,{name:"uiSettings.veritoneBranding","data-test":"".concat(TEST_ID,".form-input"),"data-testid":"".concat(TEST_ID,".form-input-veritoneBranding"),control:e,defaultValue:!1,render:function(e){var t=e.field;return jsxRuntimeExports.jsx(Switch,{checked:t.value,onChange:function(e){return t.onChange(e.target.checked)},inputProps:{"aria-label":"Remove Veritone Branding"}})}})]})]})};function asyncGeneratorStep$2(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$2(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$2(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$2(n,t,r,o,i,"throw",e)}o(void 0)})}}function _ts_generator$2(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var useUploader=function(e){var t,r=e.accept,n=e.multiple,o=e.onDropAccepted,i=useDispatch(),e=useSelector(preferredLanguageSelector),a=AIWareFormatMessage(e);return useDropzone({accept:r,multiple:n,onDropAccepted:(t=_async_to_generator$2(function(t){var r,n;return _ts_generator$2(this,function(e){switch(e.label){case 0:return r=t[0],n={id:guid(),name:r.name,previewUrl:URL.createObjectURL(r),size:r.size,type:r.type},[4,null==o?void 0:o(r,n)];case 1:return e.sent(),[2]}})}),function(e){return t.apply(this,arguments)}),onDropRejected:function(){var e;i(showMessage({content:null!=(e=a({id:"os-admin-center-registration.snackbar.invalid-file-type",defaultMessage:"Invalid file type. Please upload a PDF or text file.",description:"The error message shows up when the user tries to upload an invalid file type."}))?e:"Invalid file type. Please upload a PDF or text file.",severity:MessageSeverity.Error}))}})};function _array_like_to_array$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_without_holes$1(e){if(Array.isArray(e))return _array_like_to_array$1(e)}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$1(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$1(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$1(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$2(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$2(t,e,r[e])})}return t}function ownKeys$2(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$2(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _to_consumable_array$1(e){return _array_without_holes$1(e)||_iterable_to_array$1(e)||_unsupported_iterable_to_array$1(e)||_non_iterable_spread$1()}function _unsupported_iterable_to_array$1(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$1(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$1(e,t):void 0}function _ts_generator$1(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var URL_PATTERN=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/,validateUrl=function(e){return URL_PATTERN.test(e)||"Please enter a valid URL"},LegalStep=function(){var r,o=useDispatch(),i=useSelector(selectApiConfigs),e=useSelector(preferredLanguageSelector),a=AIWareFormatMessage(e),e=useFormContext(),s=e.setValue,e=e.watch,t=useForm({defaultValues:{privacyPolicyUrl:""},mode:"onChange"}),n=t.control,l=t.formState.errors,c=t.setValue,u=e("files"),t=u.find(function(e){return e.type===OrgDocumentType.terms_of_service&&"active"===e.status}),e=useUploader({accept:["application/pdf","text/plain"],multiple:!1,onDropAccepted:(r=_async_to_generator$1(function(t,r){var n;return _ts_generator$1(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,getSignedWritableUrl(i,r.name)];case 1:return n=e.sent(),[4,fetch(n.url,{method:"PUT",body:t,headers:{"Content-Type":t.type}})];case 2:if(e.sent().ok)return s("files",[{name:t.name,url:n.unsignedUrl,type:OrgDocumentType.terms_of_service}].concat(_to_consumable_array$1(u))),[3,4];throw new Error("Failed to upload file");case 3:return e.sent(),o(showMessage({content:a({id:"os-admin-center-registration.snackbar.upload-failed",defaultMessage:"File upload failed. Please try again.",description:"The error message shows up when file upload fails."}),severity:MessageSeverity.Error})),[3,4];case 4:return[2]}})}),function(e,t){return r.apply(this,arguments)})}),p=e.getInputProps,d=e.open;return reactExports.useEffect(function(){var e=u.find(function(e){return e.type===OrgDocumentType.privacy_policy&&e.status===OrgDocumentStatus.active});e&&c("privacyPolicyUrl",e.url)},[u,c]),jsxRuntimeExports.jsxs(Stack,{sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsx(Stack,{gap:2,children:jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.description()})}),jsxRuntimeExports.jsx(Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{sx:{width:"500px"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.legalInfo.termsOfServiceTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.termsOfServiceDescription()}),jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Button,{"data-testid":"os-admin-center-registration.form.legal-info.terms-of-service-upload",variant:"outlined",size:"large",disabled:!!t,onClick:function(){return d()},children:SHARED_TEXT.form.legalInfo.termsOfServiceUploadButton()}),jsxRuntimeExports.jsx("input",_object_spread_props$2(_object_spread$2({},p()),{style:{display:"none"}}))]})]})}),jsxRuntimeExports.jsx(Stack,{gap:.5,divider:jsxRuntimeExports.jsx(Divider,{}),children:u&&0<u.length&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Stack,{gap:6,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{"& > p":{p:2,fontSize:"14px",fontWeight:"bold"}},children:jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.fileName()})}),u.map(function(e,t){var r;return e.type!==OrgDocumentType.terms_of_service?null:(r=(null==e?void 0:e.status)===OrgDocumentStatus.active||!e.status?"(latest)":"",jsxRuntimeExports.jsxs(Stack,{gap:1,direction:"row",alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{gap:6,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{"& > p":{p:2,fontSize:"14px","& > span":{ml:1,fontSize:"14px"}}},children:[jsxRuntimeExports.jsxs(Typography,{variant:"body1",width:"300px",noWrap:!0,children:["".concat((null==e?void 0:e.name)||"--"),jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"span",children:r})]}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:(null==e?void 0:e.status)||"pending"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{"data-testid":"os-admin-center-registration.form.legal-info.terms-of-service-remove",disabled:e.status===OrgDocumentStatus.inactive,onClick:function(){var r,e;r=t,e=u.map(function(e,t){return t===r&&e.status?_object_spread_props$2(_object_spread$2({},e),{status:OrgDocumentStatus.inactive}):e}).filter(Boolean),s("files",e)},size:"small",children:jsxRuntimeExports.jsx(Delete,{})})})]},e.url))})]})}),jsxRuntimeExports.jsx(Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{sx:{width:"500px"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.legalInfo.privacyPolicyTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.privacyPolicyDescription()})]})}),jsxRuntimeExports.jsx(Controller,{name:"privacyPolicyUrl",control:n,rules:{validate:function(e){return!0===validateUrl(e)||"Please enter a valid URL"}},render:function(e){var r=e.field;return jsxRuntimeExports.jsx(TextField,_object_spread_props$2(_object_spread$2({},r),{fullWidth:!0,label:"Privacy Policy URL",placeholder:"https://example.com/privacy-policy",error:!!l.privacyPolicyUrl,helperText:null==(e=l.privacyPolicyUrl)?void 0:e.message,onChange:function(e){var t;r.onChange(e),e=e.target.value,t=u.filter(function(e){return e.type!==OrgDocumentType.privacy_policy}),e&&t.push({url:e,name:"Privacy Policy",type:OrgDocumentType.privacy_policy}),s("files",t)},"data-testid":"".concat(TEST_ID,".form.legal-info.privacy-policy-url")}))}})]})},useUserAccessPanel=function(){var r=useDispatch(),n=useSelector(selectIsFullscreenEnabled),o=useSelector(selectAdminCenterOrgParameter);return function(e){var t=e.onSave;r(mountPanel({panelId:AvailableComponents.USER_ACCESS_PANEL,microFrontend:{name:AvailableComponents.USER_ACCESS_PANEL,config:{orgId:o,initialData:e.initialData,onSave:t}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:n?0:55,marginStart:n?0:80,size:"medium",parentPanelId:AvailableComponents.ADMIN_CENTER_CUSTOM_REGISTRATION_PANEL,dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))}};function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _define_property$1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest(){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 _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$1(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$1(t,e,r[e])})}return t}function ownKeys$1(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$1(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _unsupported_iterable_to_array(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}var STEP_ID,toogleBtnGroupStyles=_define_property$1({p:.5,paddingBottom:"3px",width:"fit-content",borderRadius:"30px",height:"34px",bgcolor:"rgba(0, 0, 0, 0.1)",display:"flex",gap:.5},"& .".concat(toggleButtonGroupClasses.grouped),{border:0,textTransform:"capitalize",borderRadius:"30px",fontSize:"12px","&:not(:last-of-type)":{borderTopRightRadius:"30px",borderBottomRightRadius:"30px"},"&:not(:first-of-type)":{borderTopLeftRadius:"30px",borderBottomLeftRadius:"30px"},"&.Mui-selected":{color:"black",bgcolor:"#FFF","&:hover":{bgcolor:"#FFF"}},"&:hover":{bgcolor:"rgba(255, 255, 255, 0.5)"}}),UserAccessStep=function(e){var r=e.orgId,n=useDispatch(),t=useUserAccessPanel(),e=useSelector(selectors.appRoles.selectItems),o=useSelector(selectors.authGroups.selectItems),i=_sliced_to_array(reactExports.useState(null),2),a=i[0],s=i[1],i=useFormContext(),l=i.register,c=i.unregister,u=i.control,p=i.watch,d=i.setError,m=i.clearErrors,g=i.trigger,f=i.setValue,x=i.getFieldState,y=p("openRegistrationStatus"),h=p("domainSettings",[]),b=reactExports.useCallback(function(){"open"===y?(a||x("domainSettings").error)&&(s(null),m("domainSettings")):h&&0!==h.length?h.some(function(e){return 0===e.applicationRoleIds.length})?"At least one product role is required for each domain"!==a&&(s("At least one product role is required for each domain"),d("domainSettings",{message:"At least one product role is required for each domain"})):(a||x("domainSettings").error)&&(s(null),m("domainSettings"),g("domainSettings")):"At least one domain setting is required"!==a&&(s("At least one domain setting is required"),d("domainSettings",{message:"At least one domain setting is required"}))},[h,y,a,x,m,d,g]);return reactExports.useEffect(function(){b()},[b]),reactExports.useEffect(function(){var e,t;0<h.length&&(e=h.map(function(e){return e.authGroupId}).filter(function(e){return!lodashExports.isEmpty(e)}),t=h.reduce(function(e,t){return e.push.apply(e,_to_consumable_array(t.applicationRoleIds)),e},[]),e&&0<e.length&&n(actions.authGroups.readStart({orgId:r,authGroupIds:e})),t)&&0<t.length&&n(actions.appRoles.readStart({orgId:r,roleIds:t}))},[n,h]),reactExports.useEffect(function(){"restricted"===y?l("domainSettings",{required:!0,validate:function(e){return 0<e.length&&e.every(function(e){return 0<e.applicationRoleIds.length})}}):c("domainSettings",{keepValue:!0,keepError:!1})},[l,c,y]),jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".user-access-step"),sx:{height:"100%"},p:4,gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.description()}),jsxRuntimeExports.jsx(Controller,{name:"openRegistrationStatus",render:function(e){var r=e.field;return jsxRuntimeExports.jsxs(ToggleButtonGroup,_object_spread_props$1(_object_spread$1({},r),{exclusive:!0,onChange:function(e,t){t&&(r.onChange(t),f("domainSettings",[]))},value:r.value,sx:toogleBtnGroupStyles,children:[jsxRuntimeExports.jsx(ToggleButton,{value:"open","data-testid":"".concat(TEST_ID,".open-registration-toggle-open"),children:SHARED_TEXT.form.userAccess.openRegistration()}),jsxRuntimeExports.jsx(ToggleButton,{value:"restricted","data-testid":"".concat(TEST_ID,".open-registration-toggle-restricted"),children:SHARED_TEXT.form.userAccess.allowlistOnly()})]}))}}),"open"===y&&jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.openRegistrationDescription()}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Button,{variant:"outlined",color:"primary",size:"large","data-testid":"".concat(TEST_ID,".choose-user-access-button"),onClick:function(){t({initialData:null!=h&&h[0]?{authGroupId:h[0].authGroupId,roleIds:h[0].applicationRoleIds}:void 0,onSave:function(e,t){h.length<=0?f("domainSettings",[{domainName:"",authGroupId:""===e.authGroupId?null:e.authGroupId,applicationRoleIds:Object.values(e.roles)}]):f("domainSettings[0]",{authGroupId:""===e.authGroupId?null:e.authGroupId,applicationRoleIds:Object.values(e.roles)}),b(),t()}})},children:SHARED_TEXT.form.userAccess.chooseUserAccess()})}),jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(OpenRegistrationDomains,{authGroups:o,apps:e,domainSettings:h}),a&&jsxRuntimeExports.jsx(Typography,{color:"error","data-testid":"".concat(TEST_ID,".error-message"),children:a})]})]}),"restricted"===y&&jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.restrictedRegistrationDescription()}),jsxRuntimeExports.jsx(DomainInputForm,{authGroups:o,apps:e,domainSettings:h,validateDomainSettings:b}),a&&jsxRuntimeExports.jsx(Typography,{color:"error","data-testid":"".concat(TEST_ID,".error-message"),children:a})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{gap:1,maxWidth:"80%",children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.userAccess.adminApprovalTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.adminApprovalDescription()})]}),jsxRuntimeExports.jsx(Controller,{name:"adminApprovalRequired","data-test":"".concat(TEST_ID,".form-input"),"data-testid":"".concat(TEST_ID,".form-input-adminApprovalRequired"),control:u,defaultValue:!1,render:function(e){var t=e.field;return jsxRuntimeExports.jsx(Switch,{checked:t.value,onChange:function(e){return t.onChange(e.target.checked)},inputProps:{"aria-label":"Admin Approval Required"},"data-testid":"".concat(TEST_ID,".admin-approval-switch")})}})]})]})},DomainInputForm=function(e){function n(n,e){m({initialData:e,onSave:function(e,t){var r=Object.values(e.roles);s("domainSettings[".concat(n,"].authGroupId"),""===e.authGroupId?null:e.authGroupId),s("domainSettings[".concat(n,"].applicationRoleIds"),r),null!=a&&a(),t()}})}function t(e){e={domainName:null==(e=e.domain)?void 0:e.toLowerCase(),authGroupId:null,applicationRoleIds:[]},s("domainSettings",_to_consumable_array(i).concat([e])),p("domain",""),d("domain")}var o=e.apps,i=e.domainSettings,a=e.validateDomainSettings,s=useFormContext().setValue,e=useForm({mode:"onChange",defaultValues:{domain:""}}),r=e.control,l=e.handleSubmit,c=e.formState,u=c.errors,c=c.isValid,p=e.setValue,d=e.clearErrors,m=useUserAccessPanel();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("form",{onSubmit:l(t),children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Controller,{name:"domain",control:r,rules:{validate:function(t){return""!==t&&(!i.some(function(e){return e.domainName===t.toLowerCase()})||"Domain already exists")},pattern:{value:/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/,message:"Invalid domain format"}},render:function(e){var e=e.field;return jsxRuntimeExports.jsx(TextField,_object_spread_props$1(_object_spread$1({},e),{fullWidth:!0,"data-testid":"".concat(TEST_ID,".domain-input"),placeholder:'Add a domain name (e.g. "example.com")',error:!!u.domain,helperText:null==(e=u.domain)?void 0:e.message,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),l(t)())}}))}}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{type:"submit",disabled:!c,"data-testid":"".concat(TEST_ID,".add-domain-button"),children:jsxRuntimeExports.jsx(Add$1,{})})})]})}),0<i.length&&jsxRuntimeExports.jsxs(Stack,{gap:.5,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Domain"}),i.map(function(e,r){var t=0<e.applicationRoleIds.length;return jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,p:2,alignItems:"center",bgcolor:"#F5F5F5",justifyContent:"space-between",width:"100%",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",noWrap:!0,width:"170px",children:e.domainName}),t?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AvatarGroup,{max:4,sx:{"& .Sdk-MuiAvatar-root":{width:"20px",height:"20px",fontSize:"12px",border:"1px solid #F5F5F5",marginLeft:"unset",color:"#5C6269"}},children:e.applicationRoleIds.map(function(t,e){var r=o.find(function(e){return e.roles.some(function(e){return e.id===t})});return jsxRuntimeExports.jsx(Avatar,{src:null==r?void 0:r.icon,sx:{bgcolor:"primary.main",marginLeft:"-8px !important",color:"white !important"},children:null!=(r=null==r?void 0:r.label[0])?r:"--"},e)})}),jsxRuntimeExports.jsx(Button,{variant:"text",color:"primary",size:"small",onClick:function(){return n(r,{authGroupId:e.authGroupId,roleIds:e.applicationRoleIds})},"data-testid":"".concat(TEST_ID,".edit-user-access-button-").concat(r),children:"Edit User Access"})]}):jsxRuntimeExports.jsx(Button,{variant:"text",color:"primary",size:"small",onClick:function(){return n(r)},"data-testid":"".concat(TEST_ID,".add-user-access-button-").concat(r),children:"Add User Access"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{onClick:function(){s("domainSettings",i.filter(function(e,t){return t!==r}))},"data-testid":"".concat(TEST_ID,".delete-domain-button-").concat(r),children:jsxRuntimeExports.jsx(Delete,{})})})]},r)})]})]})},OpenRegistrationDomains=function(e){var t=e.authGroups,i=e.apps,a=e.domainSettings,s=useFormContext(),e=null!=(e=a[0])?e:void 0,r=null==e?void 0:e.authGroupId,t=t.find(function(e){return e.id===r});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(t||e)&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.openRegistrationGroupDescription()}),t&&jsxRuntimeExports.jsxs(Stack,{gap:.5,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Group"}),jsxRuntimeExports.jsx(Stack,{direction:"row",gap:2,alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:4,p:2,alignItems:"center",bgcolor:"#F5F5F5",width:"100%",children:[jsxRuntimeExports.jsx(Group,{}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:t.name})]})})]}),jsxRuntimeExports.jsx(Stack,{gap:.5,children:void 0!==e&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",justifyContent:"space-between",maxWidth:"610px",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Product"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",pr:28,children:"Role"})]}),e.applicationRoleIds.map(function(t,r){var e,n=i.find(function(e){return e.roles.some(function(e){return e.id===t})}),o=null==n?void 0:n.roles.find(function(e){return e.id===t});return jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",p:2,alignItems:"center",bgcolor:"#F5F5F5",width:"100%",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Avatar,{src:null==n?void 0:n.icon,sx:{bgcolor:"primary.main",width:"24px",height:"24px",fontSize:"12px"},children:null!=(e=null==n?void 0:n.label[0])?e:"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:null!=(e=null==n?void 0:n.label)?e:"--"})]}),jsxRuntimeExports.jsx(Typography,{variant:"body1",pr:7,children:null!=(n=null==o?void 0:o.name)?n:"--"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{"data-testid":"".concat(TEST_ID,".delete-product-button"),onClick:function(){s.setValue("domainSettings",a.map(function(e){return _object_spread_props$1(_object_spread$1({},e),{applicationRoleIds:e.applicationRoleIds.filter(function(e,t){return t!==r})})}))},children:jsxRuntimeExports.jsx(Delete,{})})})]})})]})})]})},FormBuilderStep=function(){var e=useFormContext(),t=e.setValue,e=(0,e.watch)("uiSettings.customRegistrationFields");return jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".form-appearance"),sx:{height:"100%"},p:4,gap:3,children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:SHARED_TEXT.form.formBuilder.description()}),jsxRuntimeExports.jsx(Chip,{label:"Optional",variant:"outlined",color:"info",size:"small"})]}),jsxRuntimeExports.jsx(FormBuilder,{initialSchema:e,EmptyState:{description:"Drag in Building Blocks from the left to craft a new Registration Template"},onSchemaChange:function(e){t("uiSettings.customRegistrationFields",e)}})]})},LoadingSkeleton=function(e){e=e.fields;return jsxRuntimeExports.jsxs(Stack,{sx:{p:4,height:"100%"},justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:"100%",height:86}),jsxRuntimeExports.jsx(Box,{sx:{my:8},children:e.map(function(e,t){return jsxRuntimeExports.jsx(Box,{sx:{mb:4},children:jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:e.width||"100%",height:"multiline"===e.type?100:56,sx:{mt:1}})},t)})})]}),jsxRuntimeExports.jsxs(Box,{sx:{mt:4,display:"flex",justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:36,sx:{display:"inline-block"}})}),jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:36})]})]})};function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}(e=>{e[e.BASIC_INFO=1]="BASIC_INFO",e[e.LEGAL=2]="LEGAL",e[e.USER_ACCESS=3]="USER_ACCESS",e[e.FORM_BUILDER=4]="FORM_BUILDER",e[e.APPERANCE=5]="APPERANCE"})(STEP_ID=STEP_ID||{});var PanelHeader=panelComponents.header,PanelContainer=panelComponents.container,CustomRegistrationPanelWizard=function(e){var t,r=e.id,e=e.orgId,o=useDispatch(),n=useSelector(selectIsFullscreenEnabled),i=useSelector(selectors.registrationWizard.selectActiveStep),a=useSelector(selectors.registrationWizard.selectWizard),s=useSelector(selectors.registrationWizard.selectItem),l=useSelector(selectors.registrationWizard.selectReadStatus),c=useSelector(selectors.registrationWizard.selectCreateStatus),u=useSelector(selectors.registrationWizard.selectUpdateStatus),p=useSelector(selectAdminCenterOrgParameter),d=useSelector(selectOrgId),p="".concat(null!=(e=null!=e?e:p)?e:d),m=useForm({mode:"onChange",defaultValues:a}),g=m.trigger,f=m.getValues,e=m.watch,x=m.formState.isValid,y=e(),h=!!r,d="pending"===l,e="pending"===c||"pending"===u,l=[{step:1,label:"Basic Info",component:jsxRuntimeExports.jsx(BasicInfoStep,{isEditMode:h})},{step:2,label:"Legal",component:jsxRuntimeExports.jsx(LegalStep,{})},{step:3,label:"User Access",component:jsxRuntimeExports.jsx(UserAccessStep,{orgId:p})},{step:4,label:"Form Builder",component:jsxRuntimeExports.jsx(FormBuilderStep,{})},{step:5,label:"Apperance",component:jsxRuntimeExports.jsx(ApperanceStep,{})}],p=reactExports.useMemo(function(){return h?x&&!isEqual(s,y):x},[x,h,s,y]),b=reactExports.useMemo(function(){switch(i){case 1:return[{type:"short",width:"100%"}];case 2:return[{type:"long",width:"100%"},{type:"multiline",width:"100%"}];default:return[{type:"short",width:"100%"},{type:"short",width:"100%"}]}},[i]),_=reactExports.useCallback((t=_async_to_generator(function(t){var r,n;return _ts_generator(this,function(e){switch(e.label){case 0:return 0===t?[2]:[4,g()];case 1:return e.sent()&&(r=f(),n=cloneDeep(a),o(actions.registrationWizard.setWizard(defaultsDeep(n,r))),o(actions.registrationWizard.setActiveStep(t))),[2]}})}),function(e){return t.apply(this,arguments)}),[o,f,g,a]),j=reactExports.useCallback(function(){o(actions.registrationWizard.updateResetStatus()),o(actions.registrationWizard.resetCreateStatus()),o(actions.registrationWizard.resetItem()),o(actions.registrationWizard.readResetStatus()),o(hidePanel(CUSTOM_REGISTRATION_PANEL_ID))},[o]),E=reactExports.useCallback(function(){var e=f();console.log("formData",e),o(h?actions.registrationWizard.updateStart(e):actions.registrationWizard.createStart(e))},[o,f,h]);return reactExports.useEffect(function(){s&&0<Object.keys(s).length&&m.reset(s)},[s]),reactExports.useEffect(function(){"success"!==c&&"success"!==u||(o(actions.registration.readStart(null)),j())},[c,u,o,j]),reactExports.useEffect(function(){h&&o(actions.registrationWizard.readStart(r))},[o,r,h]),jsxRuntimeExports.jsxs(PanelContainer,{testId:"".concat(TEST_ID_PANEL,"-panel-container"),panelId:CUSTOM_REGISTRATION_PANEL_ID,isFullScreen:n,children:[jsxRuntimeExports.jsx(PanelHeader,{testId:"".concat(TEST_ID_PANEL,"-panel-header"),title:h?SHARED_TEXT.panel.editTitle():SHARED_TEXT.panel.createTitle(),onPanelClose:j}),d?jsxRuntimeExports.jsx(LoadingSkeleton,{fields:b}):jsxRuntimeExports.jsx(FormProvider,_object_spread_props(_object_spread({},m),{children:jsxRuntimeExports.jsx(ProgressStepper,{entityId:r,enableTabs:h,sessionKey:"customLoginRegistration",idPrefix:"".concat(TEST_ID_PANEL,"-wizard"),panelName:CUSTOM_REGISTRATION_PANEL_ID,steps:l.map(function(e){return e.label}),stepContent:l.map(function(e){return e.component}),onResumeSession:function(e){console.log("session",e)},BodySx:h?{p:2,bgcolor:"#F5F5F5","& #body-container":{bgcolor:"#FFF",borderRadius:"6px",overflowY:"auto"}}:{"& #body-container":{overflowY:"auto"}},FooterSx:h?{bgcolor:"#F5F5F5"}:{},customFinalStepButtons:[jsxRuntimeExports.jsx(LoadingButton,{"data-test":"".concat(TEST_ID_PANEL,"-").concat(h?"save":"submit","-button"),variant:"contained",color:"primary",disabled:!p,onClick:E,loading:e,children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"{testId}.{idPrefix}-app-button",defaultMessage:"{verb}",description:"{verb} app button text",values:{testId:TEST_ID_PANEL,idPrefix:h?"save":"submit",verb:h?"Save":"Submit"}})})],onActiveStepChange:_,nextButtonDisabled:!p})}))]})},CustomRegistrationPanel=function(e){return jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterRegistrationModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(CustomRegistrationPanelWizard,{id:e.id,orgId:e.orgId})})})})})};export{CustomRegistrationPanel,CustomRegistrationTab};
1
+ import{b5 as generateUtilityClasses,b4 as generateUtilityClass,b6 as styled,b7 as capitalize,b8 as _extends,bv as alpha,r as reactExports,b9 as useThemeProps,ba as _objectWithoutPropertiesLoose,j as jsxRuntimeExports,bb as clsx,bc as composeClasses,au as AvailableComponents,aI as selectIsSuperAdmin,ad as combineReducers,A as AIWareCacheProvider,b as AIWareThemeProvider,u as useSelector,ao as selectIsFullscreenEnabled,az as selectOrgId,a9 as isEqual,p as hidePanel,v as mountPanel,B as Box,aW as loginUrlSelector,a6 as selectApiConfigs,ah as preferredLanguageSelector,a8 as baseGraphQLApiWithError,_ as all,aj as showMessage,ak as MessageSeverity,al as AIWareFormatMessage,aK as guid}from"./js-core.esm4.js";import{bE as ButtonBase,D as DynamicModuleLoader,A as AIWareIntlProvider,B as Button,ac as ProgressStepper,M as MemoizedFormattedMessage,G as Grid,T as Typography,p as Divider,o as Delete,aj as isEmpty$1,g as Add$1,bh as Group,Y as startCase}from"./js-core.esm7.js";import{g as generateState,ad as generateSingleState,y as tableInfiniteScroll,ae as imageUpload,P as useForm,Q as FormProvider,a3 as LoadingButton,ak as EmptyState,z as centerComponents,S as Stack,c as Skeleton,B as panelComponents,aN as useFormContext,b as TextField,aO as Controller,ai as CustomColorInput,aj as ButtonPreview,l as Switch,I as IconButton,A as Avatar,a as Chip,aP as FormBuilder,t as CopyText,al as EditOutlined,aJ as VisibilityOutlined,aI as DeleteOutline,aH as ContextMenu}from"./js-core.esm9.js";import{a as selectAdminCenterOrgId,h as selectAdminCenterOrgGuidParameter,g as selectAdminCenterOrgParameter,A as AvatarGroup}from"./js-core.esm27.js";import{g as groupBy,u as upperCase}from"./js-core.esm82.js";import{s as snakeCase}from"./js-core.esm55.js";import{c as cloneDeep,d as defaultsDeep}from"./js-core.esm70.js";import{k as kebabCase}from"./js-core.esm22.js";import{u as useDropzone}from"./js-core.esm124.js";import{A as Add}from"./js-core.esm40.js";import{u as useDispatch}from"./js-core.esm14.js";import"./js-core.esm8.js";function getToggleButtonUtilityClass(e){return generateUtilityClass("MuiToggleButton",e)}let toggleButtonClasses=generateUtilityClasses("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),_excluded$1=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],useUtilityClasses$1=e=>{var{classes:e,fullWidth:t,selected:r,disabled:n,size:o,color:i}=e,r={root:["root",r&&"selected",n&&"disabled",t&&"fullWidth","size"+capitalize(o),i]};return composeClasses(r,getToggleButtonUtilityClass,e)},ToggleButtonRoot=styled(ButtonBase,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{e=e.ownerState;return[t.root,t["size"+capitalize(e.size)]]}})(({theme:e,ownerState:t})=>{let r="standard"===t.color?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r="standard"===t.color?e.vars.palette.text.primary:e.vars.palette[t.color].main,n="standard"===t.color?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_extends({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:"1px solid "+(e.vars||e).palette.divider,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{["&."+toggleButtonClasses.disabled]:{color:(e.vars||e).palette.action.disabled,border:"1px solid "+(e.vars||e).palette.action.disabledBackground},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},["&."+toggleButtonClasses.selected]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:alpha(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:alpha(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:alpha(r,e.palette.action.selectedOpacity)}}}},"small"===t.size&&{padding:7,fontSize:e.typography.pxToRem(13)},"large"===t.size&&{padding:15,fontSize:e.typography.pxToRem(15)})}),ToggleButton=reactExports.forwardRef(function(e,t){e=useThemeProps({props:e,name:"MuiToggleButton"});let{children:r,className:n,color:o="standard",disabled:i=!1,disableFocusRipple:a=!1,fullWidth:s=!1,onChange:l,onClick:c,selected:u,size:p="medium",value:d}=e,m=_objectWithoutPropertiesLoose(e,_excluded$1);var e=_extends({},e,{color:o,disabled:i,disableFocusRipple:a,fullWidth:s,size:p}),g=useUtilityClasses$1(e);return jsxRuntimeExports.jsx(ToggleButtonRoot,_extends({className:clsx(g.root,n),disabled:i,focusRipple:!a,ref:t,onClick:e=>{c&&(c(e,d),e.defaultPrevented)||l&&l(e,d)},onChange:l,value:d,ownerState:e,"aria-pressed":u},m,{children:r}))});function isValueSelected(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?0<=t.indexOf(e):e===t)}function getToggleButtonGroupUtilityClass(e){return generateUtilityClass("MuiToggleButtonGroup",e)}let toggleButtonGroupClasses=generateUtilityClasses("MuiToggleButtonGroup",["root","selected","vertical","disabled","grouped","groupedHorizontal","groupedVertical"]),_excluded=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],useUtilityClasses=e=>{var{classes:e,orientation:t,fullWidth:r,disabled:n}=e,r={root:["root","vertical"===t&&"vertical",r&&"fullWidth"],grouped:["grouped","grouped"+capitalize(t),n&&"disabled"]};return composeClasses(r,getToggleButtonGroupUtilityClass,e)},ToggleButtonGroupRoot=styled("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{e=e.ownerState;return[{["& ."+toggleButtonGroupClasses.grouped]:t.grouped},{["& ."+toggleButtonGroupClasses.grouped]:t["grouped"+capitalize(e.orientation)]},t.root,"vertical"===e.orientation&&t.vertical,e.fullWidth&&t.fullWidth]}})(({ownerState:e,theme:t})=>_extends({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},"vertical"===e.orientation&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{["& ."+toggleButtonGroupClasses.grouped]:_extends({},"horizontal"===e.orientation?{"&:not(:first-of-type)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0},[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.`+toggleButtonGroupClasses.selected]:{borderLeft:0,marginLeft:0}}:{"&:not(:first-of-type)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-of-type)":{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.`+toggleButtonGroupClasses.selected]:{borderTop:0,marginTop:0}})})),ToggleButtonGroup=reactExports.forwardRef(function(e,t){e=useThemeProps({props:e,name:"MuiToggleButtonGroup"});let{children:r,className:n,color:o="standard",disabled:i=!1,exclusive:a=!1,fullWidth:s=!1,onChange:l,orientation:c="horizontal",size:u="medium",value:p}=e,d=_objectWithoutPropertiesLoose(e,_excluded);e=_extends({},e,{disabled:i,fullWidth:s,orientation:c,size:u});let m=useUtilityClasses(e),g=(t,r)=>{if(l){var n=p&&p.indexOf(r);let e;p&&0<=n?(e=p.slice()).splice(n,1):e=p?p.concat(r):[r],l(t,e)}},f=(e,t)=>{l&&l(e,p===t?null:t)};return jsxRuntimeExports.jsx(ToggleButtonGroupRoot,_extends({role:"group",className:clsx(m.root,n),ref:t,ownerState:e},d,{children:reactExports.Children.map(r,e=>reactExports.isValidElement(e)?reactExports.cloneElement(e,{className:clsx(m.grouped,e.props.className),onChange:a?f:g,selected:void 0===e.props.selected?isValueSelected(e.props.value,p):e.props.selected,size:e.props.size||u,fullWidth:s,color:e.props.color||o,disabled:e.props.disabled||i}):null)}))});var OrgazionRegistrationStatus,OrgDocumentType,OrgDocumentStatus,ImportStatus,SHARED_TEXT={title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.title",defaultMessage:"Registration",description:"Admin Center Registration Title"})},subTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.sub-title",defaultMessage:"Create a custom branded registration page for users of this Organization.",description:"Admin Center Registration Subtitle"})},panel:{editTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.panel.edit-title",defaultMessage:"Edit Registration",description:"Admin Center Registration Panel Edit Title"})},createTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.panel.create-title",defaultMessage:"New Registration",description:"Admin Center Registration Panel Create Title"})}},form:{basicInfo:{newDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.description.new",defaultMessage:"Create a custom branded registration page for this organization, with a dedicated domain for users to access their aiWARE account.",description:"Description for the basic info step in registration form"})},editDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.description.edit",defaultMessage:"Edit your custom branded registration page for this organization.",description:"Description for the basic info step in registration form"})},brandLogoTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.brand-logo-title",defaultMessage:"Brand Logo",description:"Title for brand logo section"})},brandLogoDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.brand-logo-description",defaultMessage:"This logo will be used on your registration page.",description:"Description for brand logo usage"})},customUrlTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.custom-url-title",defaultMessage:"Custom Registration URL Slug",description:"Title for custom URL slug section"})},customUrlDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.custom-url-description",defaultMessage:"Type in the slug name that will be added to your registration url.",description:"Description for custom URL slug input"})},urlExample:function(e){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.basic-info.url-example",defaultMessage:"URL Example: {url}",description:"Example of how the custom URL will look",values:{url:e}})}},userAccess:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.description",defaultMessage:"Manage registered users product roles and groups when they join this Organization.",description:"Description for the user access step"})},openRegistration:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration",defaultMessage:"Open Registration",description:"Open registration toggle button"})},allowlistOnly:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.allowlist-only",defaultMessage:"Allowlist only",description:"Allowlist only toggle button"})},openRegistrationDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration-description",defaultMessage:"Anyone can register for this Organization.",description:"Description for open registration"})},chooseUserAccess:function(e){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.choose-user-access",defaultMessage:"{action} User Access",description:"Button text for choosing user access",values:{action:e?"Edit":"Choose"}})},openRegistrationGroupDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.open-registration-group-description",defaultMessage:"Users who register will join this group and receive access to these products.",description:"Description for open registration group access"})},restrictedRegistrationDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.restricted-registration-description",defaultMessage:"Create a list of domains that are allowed to register for this Organization.",description:"Description for restricted registration"})},adminApprovalTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.admin-approval-title",defaultMessage:"Admin Approval Required",description:"Title for admin approval section"})},adminApprovalDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.user-access.admin-approval-description",defaultMessage:"Any user who registers for this Organization must first be approved by an Admin user.",description:"Description for admin approval requirement"})}},appearance:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.description",defaultMessage:"Customize the look and feel of your registration page by changing options below.",description:"Description for the appearance step in registration form"})},buttonColorTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.button-color-title",defaultMessage:"Customize Button Color",description:"Title for button color customization section"})},buttonColorDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.button-color-description",defaultMessage:"Change the primary and secondary color of the login and sign up pages to match your brand.",description:"Description for button color customization"})},veritoneBrandingTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.veritone-branding-title",defaultMessage:"Remove Veritone Branding",description:"Title for Veritone branding removal option"})},veritoneBrandingDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.appearance.veritone-branding-description",defaultMessage:"When enabled, Veritone logos and branding will be removed from your custom login page.",description:"Description for Veritone branding removal option"})}},formBuilder:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.form-builder.description",defaultMessage:"Create a custom Registration Form for your organization.",description:"Description for the form builder step in registration form"})}},legalInfo:{description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.description",defaultMessage:"Create a custom branded registration page for this organization, with a dedicated domain for users to access their aiWARE account.",description:"Description for the legal info step in registration form"})},termsOfServiceTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-title",defaultMessage:"Terms of Service",description:"Title for terms of service section"})},termsOfServiceDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-description",defaultMessage:"Include a custom terms of service that will be displayed for all users during registration.",description:"Description for terms of service input"})},termsOfServiceUploadButton:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-upload-button",defaultMessage:"Upload Terms of Service",description:"Button for uploading terms of service"})},termsOfServiceUploadInfo:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.terms-of-service-upload-info",defaultMessage:"file must be .txt or .pdf format",description:"Info for uploading terms of service"})},privacyPolicyTitle:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.privacy-policy-title",defaultMessage:"Privacy Policy",description:"Title for privacy policy section"})},privacyPolicyDescription:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.privacy-policy-description",defaultMessage:"Add your own Privacy Policy that will display during registration in in your app footer.",description:"Description for privacy policy input"})},fileName:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.file-name",defaultMessage:"File Name",description:"File name label"})},status:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.form.legal-info.status",defaultMessage:"Status",description:"Status label"})}}},emptyState:{title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.title",defaultMessage:"No Custom Registration Page Found",description:"Admin Center custom login table empty state"})},description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.description",defaultMessage:"You haven’t created a custom registration for this Organization",description:"Admin Center custom login table empty state"})},createButton:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.create-button",defaultMessage:"Create Custom Registration",description:"Admin Center custom login table empty state"})},error:{title:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.error.title",defaultMessage:"Error Loading Registrations",description:"Admin Center custom login table empty state"})},description:function(){return jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-registration.empty-state.error.description",defaultMessage:"An error occurred while loading registrations. Please try again.",description:"Admin Center custom login table empty state"})}}}},SLICE_NAME="adminCenterRegistration",TEST_ID="os-admin-center.registration",TEST_ID_PANEL="os-admin-center.custom-registration-panel",CUSTOM_REGISTRATION_PANEL_ID=AvailableComponents.ADMIN_CENTER_CUSTOM_REGISTRATION_PANEL,useRegistrationPanel=((e=>{e.open="open",e.restricted="restricted"})(OrgazionRegistrationStatus=OrgazionRegistrationStatus||{}),(e=>{e.privacy_policy="privacyPolicy",e.terms_of_service="termsOfService"})(OrgDocumentType=OrgDocumentType||{}),(e=>{e.active="active",e.inactive="inactive"})(OrgDocumentStatus=OrgDocumentStatus||{}),function(){var t=useDispatch(),r=useSelector(selectIsFullscreenEnabled);return function(e){t(mountPanel({panelId:CUSTOM_REGISTRATION_PANEL_ID,microFrontend:{name:CUSTOM_REGISTRATION_PANEL_ID,config:e?{id:e}:{}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"large",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))}});function asyncGeneratorStep$6(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$6(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$6(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$6(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$8(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$a(t,e,r[e])})}return t}function _ts_generator$7(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function getSignedWritableUrl(e,t){return _getSignedWritableUrl.apply(this,arguments)}function _getSignedWritableUrl(){return(_getSignedWritableUrl=_async_to_generator$6(function(t,r){var n,o;return _ts_generator$7(this,function(e){switch(e.label){case 0:return n="getSignedWritableUrl",o="query ".concat(n,"($name: String!) {\n ").concat(n,"(key: $name) {\n bucket,\n expiresInSeconds,\n getUrl,\n key,\n unsignedUrl,\n url,\n }\n }"),[4,baseGraphQLApiWithError(_object_spread$8({query:o,variables:{name:r},operationName:n},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function asyncGeneratorStep$5(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$5(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$5(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$5(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$9(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$7(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$9(t,e,r[e])})}return t}function _ts_generator$6(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}(e=>{e.Idle="idle",e.Uploading="uploading",e.Uploaded="uploaded",e.Failed="failed",e.Aborted="aborted"})(ImportStatus=ImportStatus||{});var REGISTRATION_FIELDS="\n id\n organizationGuid\n name\n slug\n files {\n name\n url\n type\n status\n }\n openRegistrationStatus\n adminApprovalRequired\n uiSettings {\n logo\n veritoneBranding\n customRegistrationFields\n registrationButtonStyle\n }\n domainSettings {\n domainName\n authGroupId\n applicationRoleIds\n }\n dateCreated\n dateModified\n";function createRegistrationConfiguration(e){return _createRegistrationConfiguration.apply(this,arguments)}function _createRegistrationConfiguration(){return(_createRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n=t.item,i=o="createRegistrationConfiguration",s=null==(s=t.additionalSelectors)?void 0:s.orgGuid,a="\n mutation ".concat(o,"($input: CreateRegistrationConfigurationInput!) {\n ").concat(i,"(input: $input) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n "),s={input:_object_spread$7({},s&&{organizationGuid:s},n)},[4,baseGraphQLApiWithError(_object_spread$7({query:a,variables:s,operationName:o},r))];case 1:return[2,e.sent()[i]]}})})).apply(this,arguments)}function updateRegistrationConfiguration(e){return _updateRegistrationConfiguration.apply(this,arguments)}function _updateRegistrationConfiguration(){return(_updateRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,s=t.item,o=n="updateRegistrationConfiguration",i="\n mutation ".concat(n,"($id: ID!, $input: UpdateRegistrationConfiguration!) {\n ").concat(o,"(id: $id, input: $input) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n "),a={organizationGuid:s.organizationGuid,name:s.name,slug:s.slug,files:s.files,openRegistrationStatus:s.openRegistrationStatus,adminApprovalRequired:s.adminApprovalRequired,uiSettings:s.uiSettings,domainSettings:s.domainSettings.map(function(e){var t;return{domainName:e.domainName,authGroupId:null!=(t=e.authGroupId)?t:"",applicationRoleIds:e.applicationRoleIds}})},s={id:s.id,input:a},[4,baseGraphQLApiWithError(_object_spread$7({query:i,variables:s,operationName:n},r))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function deleteRegistrationConfiguration(e){return _deleteRegistrationConfiguration.apply(this,arguments)}function _deleteRegistrationConfiguration(){return(_deleteRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n=t.itemToDelete,o="deleteRegistrationConfiguration",i="\n mutation ".concat(o,"($id: ID!) {\n ").concat("deleteRegistrationConfiguration","(id: $id) {\n id\n }\n }\n "),a={id:n.id},[4,baseGraphQLApiWithError(_object_spread$7({query:i,variables:a,operationName:o},r))];case 1:return e.sent(),[2,n]}})})).apply(this,arguments)}function getRegistrationConfiguration(e){return _getRegistrationConfiguration.apply(this,arguments)}function _getRegistrationConfiguration(){return(_getRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,o="registrationConfiguration",i=t.payload,a="\n query ".concat(n="getRegistrationConfiguration","($id: ID!) {\n ").concat(o,"(id: $id) {\n ").concat(REGISTRATION_FIELDS,"\n }\n }"),[4,baseGraphQLApiWithError(_object_spread$7({query:a,variables:{id:i},operationName:n},r))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function getOrgRegistrationConfiguration(e){return _getOrgRegistrationConfiguration.apply(this,arguments)}function _getOrgRegistrationConfiguration(){return(_getOrgRegistrationConfiguration=_async_to_generator$5(function(t){var r,n,o,i,a,s;return _ts_generator$6(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n="fetchCustomRegistrationConfig",o="organization",i="registrationConfigurations",a=t.additionalSelectors.orgId,s="\n query ".concat(n,"($orgId: ID!) {\n ").concat(o," (id: $orgId) {\n ").concat(i," {\n records {\n ").concat(REGISTRATION_FIELDS,"\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$7({query:s,variables:{orgId:a},operationName:n},r))];case 1:return[2,e.sent()[o][i].records]}})})).apply(this,arguments)}function _array_like_to_array$4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_without_holes$2(e){if(Array.isArray(e))return _array_like_to_array$4(e)}function asyncGeneratorStep$4(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$4(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$4(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$4(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$2(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$6(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$8(t,e,r[e])})}return t}function _to_consumable_array$2(e){return _array_without_holes$2(e)||_iterable_to_array$2(e)||_unsupported_iterable_to_array$4(e)||_non_iterable_spread$2()}function _unsupported_iterable_to_array$4(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$4(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$4(e,t):void 0}function _ts_generator$5(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var fetchAppRoles=(()=>{var t=_async_to_generator$4(function(t){var r,n,o,i,a,s,l,c;return _ts_generator$5(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,n="organization",o="applications",i=t.payload,a="\n query ".concat(s="fetchAppRoles"," ($id: ID!){\n ").concat(n," (id: $id) {\n roles(isAppEventRole: false) {\n id\n name\n appName\n description\n }\n }\n ").concat(o," (\n limit: 999\n ) {\n records {\n id\n name\n description\n iconUrl\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$6({query:a,operationName:s,variables:{id:i.orgId}},r))];case 1:return a=e.sent(),s=a[n].roles,l=a[o].records,c=groupBy(s,"appName"),[2,Object.keys(c).map(function(t){var e=l.find(function(e){return snakeCase(e.name)===t});return{id:t,icon:null==e?void 0:e.iconUrl,description:null==e?void 0:e.description,label:upperCase(startCase(t)),roles:_to_consumable_array$2(c[t])}})]}})});return function(e){return t.apply(this,arguments)}})();function asyncGeneratorStep$3(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$3(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$3(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$3(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$7(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$5(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$7(t,e,r[e])})}return t}function ownKeys$5(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$5(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$5(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator$4(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var _obj,_obj1,getAuthGroups=(()=>{var t=_async_to_generator$3(function(t){var r,n,o,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return r=t.apiConfigs,i=t.additionalSelectors,n=t.payload,i=i,o="authGroups",i="\n query authGroups {\n ".concat(o," ").concat(null!=i&&i.isSuperAdmin?'(ownerOrganization: "'.concat(n.orgId,'")'):""," {\n records {\n id\n name\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread_props$5(_object_spread$5({},r),{query:i}))];case 1:return[2,e.sent()[o].records]}})});return function(e){return t.apply(this,arguments)}})(),namespace$3="registration",_generateState$2=generateState({sliceName:SLICE_NAME,namespace:namespace$3,dedupeResponse:!0,apiCalls:{read:getOrgRegistrationConfiguration,delete:deleteRegistrationConfiguration,getAdditionalSelectors:function(){return{orgId:selectAdminCenterOrgId}}},toast:{update:{success:"Registration configuration updated successfully",error:"Failed to update Registration configuration"},delete:{success:"Registration configuration successfully removed",error:"Failed to remove Registration configuration"}}}),slice$3=_generateState$2.slice,selectors$4=_generateState$2.selectors,sagas$3=_generateState$2.sagas,initialState$3=_generateState$2.initialState,namespace$2="registrationWizard",_generateSingleState=generateSingleState({sliceName:SLICE_NAME,namespace:namespace$2,apiCalls:{read:getRegistrationConfiguration,create:createRegistrationConfiguration,update:updateRegistrationConfiguration,getAdditionalSelectors:function(){return{orgGuid:selectAdminCenterOrgGuidParameter}}},additionalState:{activeStep:1,wizard:{name:"",slug:"",files:[],openRegistrationStatus:"open",uiSettings:{logo:"",veritoneBranding:!1,customRegistrationFields:{},registrationButtonStyle:{textColor:"#FFF",backgroundColor:"#1E88E5"}},adminApprovalRequired:!1,domainSettings:[]}},toast:{create:{success:"Registration Created",error:"Failed to create Registration, please try again later."},update:{success:"Registration Updated",error:"Failed to update Registration, please try again later."}}}),slice$2=_generateSingleState.slice,selectors$3=_generateSingleState.selectors,sagas$2=_generateSingleState.sagas,initialState$2=_generateSingleState.initialState,namespace$1="appRoles",_generateState$1=generateState({namespace:namespace$1,sliceName:SLICE_NAME,dedupeResponse:!0,apiCalls:{read:fetchAppRoles,getAdditionalSelectors:function(){return{isSuperAdmin:selectIsSuperAdmin}}}}),slice$1=_generateState$1.slice,selectors$2=_generateState$1.selectors,sagas$1=_generateState$1.sagas,initialState$1=_generateState$1.initialState,namespace="authGroups",_generateState=generateState({namespace:namespace,sliceName:SLICE_NAME,dedupeResponse:!0,apiCalls:{read:getAuthGroups,getAdditionalSelectors:function(){return{isSuperAdmin:selectIsSuperAdmin}}}}),slice=_generateState.slice,selectors$1=_generateState.selectors,sagas=_generateState.sagas,initialState=_generateState.initialState;function _define_property$6(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}_define_property$6(_obj={},namespace$3,initialState$3),_define_property$6(_obj,namespace$2,initialState$2),_define_property$6(_obj,namespace$1,initialState$1),_define_property$6(_obj,namespace,initialState);_define_property$6(_obj1={},namespace$3,slice$3.actions),_define_property$6(_obj1,namespace$2,slice$2.actions),_define_property$6(_obj1,namespace$1,slice$1.actions),_define_property$6(_obj1,namespace,slice.actions);var _obj2,_obj3,actions=_obj1,selectors=(_define_property$6(_obj2={},namespace$3,selectors$4),_define_property$6(_obj2,namespace$2,selectors$3),_define_property$6(_obj2,namespace$1,selectors$2),_define_property$6(_obj2,namespace,selectors$1),_obj2),rootReducer=combineReducers((_define_property$6(_obj3={},namespace$3,slice$3.reducer),_define_property$6(_obj3,namespace$2,slice$2.reducer),_define_property$6(_obj3,namespace$1,slice$1.reducer),_define_property$6(_obj3,namespace,slice.reducer),_obj3));function _ts_generator$3(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function rootSaga(){return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,all([sagas$3.watchRead(),sagas$3.watchUpdate(),sagas$3.watchDelete(),sagas$2.watchRead(),sagas$2.watchCreate(),sagas$2.watchUpdate(),sagas$1.watchRead(),sagas.watchRead()])];case 1:return e.sent(),[2]}})}function _define_property$5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function getAdminCenterRegistrationModule(){return{id:SLICE_NAME,reducerMap:_define_property$5({},SLICE_NAME,rootReducer),sagas:[rootSaga],initialActions:[]}}var TableHeader=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{"data-testid":"custom-registration-table-header",sx:{height:32,pl:3},alignItems:"center",display:"flex",container:!0,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-name",defaultMessage:"Name",description:"Shared Custom Login Table header column name"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-slug",defaultMessage:"Slug",description:"Shared Custom Login Table header column slug"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-colors",defaultMessage:"Date Created",description:"Date Created"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"textSecondary",sx:{cursor:"default"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"custom-registration-table-header-column-logo",defaultMessage:"Modified Date",description:"Modified Date"})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1})]}),jsxRuntimeExports.jsx(Divider,{})]})};function _array_like_to_array$3(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes$2(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$2(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest$2(){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 _sliced_to_array$2(e,t){return _array_with_holes$2(e)||_iterable_to_array_limit$2(e,t)||_unsupported_iterable_to_array$3(e,t)||_non_iterable_rest$2()}function _unsupported_iterable_to_array$3(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$3(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$3(e,t):void 0}var convertTime=function(e){var e=_sliced_to_array$2(e.split(":").map(Number),2),t=e[0],e=e[1],r=12<=t?"PM":"AM";return"".concat(t%12||12,":").concat(e.toString().padStart(2,"0")," ").concat(r)},dateFormatter=function(e){var t,r,n;return(e=e&&(isNaN(Number(e))?new Date(e):new Date(Number(e))))?(t=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),n=e.getFullYear(),e=convertTime(e.toTimeString().split(" ")[0]),{date:"".concat(t,"/").concat(r,"/").concat(n),time:e}):"N/A"},itemHeight$1=60,TableRow=function(e){var t=e.index,r=e.testId,n=e.onEdit,o=e.onView,i=e.onDelete,e=e.item,a="".concat(itemHeight$1-1,"px"),s="/".concat(e.slug),l=reactExports.useCallback(function(){return null==o?void 0:o()},[o]),c=reactExports.useCallback(function(){return null==n?void 0:n()},[n]),u=reactExports.useCallback(function(){return null==i?void 0:i()},[i]);return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",minHeight:a,cursor:"pointer",borderBottom:"1px solid #D5DFE9",display:"grid","&:hover":{backgroundColor:"#F5F7FA"}},"data-testid":"".concat(r,"-table-row-").concat(t),onClick:c,children:jsxRuntimeExports.jsxs(Grid,{"data-testid":"".concat(r,"-registration-item"),sx:{width:"100%",height:"100%",paddingLeft:"15px"},alignItems:"center",display:"flex",container:!0,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,children:jsxRuntimeExports.jsx(Typography,{"data-testid":"registration-table-row-name",children:e.name})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,sx:{paddingRight:"10px"},children:jsxRuntimeExports.jsx(CopyText,{id:"registration-slug",value:s,sx:{fontWeight:"bold",padding:"2px 5px",fontSize:"small",wordBreak:"break-all"}})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(RenderDate,{date:e.dateCreated,testId:"registration-table-row-created"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(RenderDate,{date:e.dateModified,testId:"registration-table-row-modified"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1,onClick:function(e){return e.stopPropagation()},children:jsxRuntimeExports.jsx(RegContextMenu,{onEdit:c,onView:l,onDelete:u,testId:r})})]})})},RenderDate=function(e){var t=e.date,e=e.testId,t=dateFormatter(t);return"N/A"!==t?jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontWeight:400,"data-testid":"".concat(e,"-date"),children:t.date}),jsxRuntimeExports.jsx(Typography,{variant:"caption",fontSize:"12px","data-testid":"".concat(e,"-time"),children:t.time})]}):jsxRuntimeExports.jsx(Typography,{"data-testid":"".concat(e,"-date"),children:t})},RegContextMenu=function(e){var t=e.onEdit,r=e.onView,n=e.onDelete,e=e.testId,o=reactExports.useMemo(function(){return[{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-edit",defaultMessage:"Edit",description:"Admin Center Registration table row context menu edit"}),onClick:t,testId:"edit",icon:jsxRuntimeExports.jsx(EditOutlined,{fontSize:"small"})},{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-preview",defaultMessage:"View Page",description:"Admin Center Registration table row context menu view page"}),onClick:r,testId:"view",icon:jsxRuntimeExports.jsx(VisibilityOutlined,{fontSize:"small"})},{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"registration-table-row-context-menu-delete",defaultMessage:"Delete",description:"Admin Center Registration table row context menu delete"}),onClick:n,testId:"delete",icon:jsxRuntimeExports.jsx(DeleteOutline,{fontSize:"small"})}]},[t,r,n]);return jsxRuntimeExports.jsx(ContextMenu,{menuItems:o,testId:"".concat(e,"-registration-menu")})},TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,itemHeight=60,Table=function(){var r=useDispatch(),n=useRegistrationPanel(),e=useSelector(selectors.registration.selectItems),t=useSelector(selectors.registration.selectReadStatus);return jsxRuntimeExports.jsx(Box,{height:"calc(100vh - 240px)",children:jsxRuntimeExports.jsx(TableInfiniteScroll,{offset:0,testId:TEST_ID,hasMore:!1,fetchMore:function(){r(actions.registration.readStart(null))},fetchOnMount:0===e.length,items:e,itemHeight:itemHeight,isLoading:"pending"===t,error:"failure"===t,TableHeaderComponent:jsxRuntimeExports.jsx(TableHeader,{}),TableRowComponent:function(e){var t=e.item;return jsxRuntimeExports.jsx(TableRow,{item:t,index:e.index,testId:TEST_ID,onEdit:function(){return n(t.id)},onDelete:function(){r(actions.registration.deleteStart(t))}})},MessageErrorState:SHARED_TEXT.emptyState.error.title(),DescriptionErrorState:SHARED_TEXT.emptyState.error.description(),adjustTableHeight:-40,TableEmptyStateComponent:jsxRuntimeExports.jsx(EmptyState,{title:SHARED_TEXT.emptyState.title(),description:SHARED_TEXT.emptyState.description(),buttonLabel:SHARED_TEXT.emptyState.createButton(),onClick:function(){return n()}})})})},CenterTabHeading=centerComponents.CenterTabHeading,CenterTabContainer=centerComponents.CenterTabContainer,CenterTabContent=centerComponents.CenterTabContent,MainLayout=function(){var e=useRegistrationPanel();return jsxRuntimeExports.jsxs(CenterTabContainer,{testId:TEST_ID,children:[jsxRuntimeExports.jsx(CenterTabHeading,{title:SHARED_TEXT.title(),subtitle:SHARED_TEXT.subTitle(),testId:TEST_ID,HeadingActions:jsxRuntimeExports.jsx(Button,{onClick:function(){return e()},variant:"contained",startIcon:jsxRuntimeExports.jsx(Add,{}),"data-testid":"".concat(TEST_ID,".create-new"),children:"New"})}),jsxRuntimeExports.jsx(CenterTabContent,{testId:TEST_ID,children:jsxRuntimeExports.jsx(Table,{})})]})},CustomRegistrationTab=function(){return jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterRegistrationModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(MainLayout,{})})})})})};function _define_property$4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$4(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$4(t,e,r[e])})}return t}function ownKeys$4(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$4(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$4(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}var ImageUpload=imageUpload.jsx.ImageUpload,FILE_TYPES="image/png, image/svg+xml, image/jpeg",LOGO_SIZE={outerWidth:"366px",outerHeight:"161px"},BasicInfoStep=function(e){var e=e.isEditMode,t=useFormContext(),r=t.register,n=t.control,o=t.formState.errors,t=(0,t.watch)("slug"),i=useSelector(loginUrlSelector);return jsxRuntimeExports.jsxs(Stack,{sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsxs(Stack,{gap:2,children:[!e&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.newDescription()}),e&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.editDescription()}),jsxRuntimeExports.jsx(TextField,_object_spread_props$4(_object_spread$4({},r("name",{required:!0})),{fullWidth:!0,placeholder:"Registration Name",error:!!o.name,helperText:null==(e=o.name)?void 0:e.message,"data-testid":"".concat(TEST_ID,"--registration-name-input")}))]}),jsxRuntimeExports.jsxs(Stack,{gap:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.basicInfo.brandLogoTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.brandLogoDescription()}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",children:["Recommended image size:",jsxRuntimeExports.jsx("br",{}),"300x200 .png or .svg"]}),jsxRuntimeExports.jsx(Controller,{name:"uiSettings.logo",defaultValue:"",control:n,rules:{required:"Brand Logo is required."},render:function(e){var e=e.field,t=e.onChange,e=e.value;return jsxRuntimeExports.jsx(ImageUpload,{testId:"".concat(TEST_ID,"--brand-logo"),image:e,getUrl:!1,outerWidth:LOGO_SIZE.outerWidth,outerHeight:LOGO_SIZE.outerHeight,innerHeight:"145px",innerWidth:"350px",fileTypes:FILE_TYPES,handleChange:function(e){e?getFileAsBase64(e,function(e){"string"==typeof e&&t(e)}):t("")}})}}),o.uiSettings&&"logo"in o.uiSettings&&jsxRuntimeExports.jsx(Typography,{color:"error",variant:"caption",children:null==(e=o.uiSettings.logo)?void 0:e.message})]}),jsxRuntimeExports.jsxs(Stack,{gap:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.basicInfo.customUrlTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.basicInfo.customUrlDescription()}),jsxRuntimeExports.jsx(TextField,_object_spread_props$4(_object_spread$4({},r("slug",{required:!0,pattern:{value:/^[a-z0-9]+(?:-[a-z0-9]+)*$/,message:"Slug must be lowercase and contain only letters, numbers, and hyphens."},minLength:{value:3,message:"Slug must be at least 3 characters long."},setValueAs:function(e){return kebabCase(e)}})),{fullWidth:!0,error:!!o.slug,helperText:null==(n=o.slug)?void 0:n.message,"data-testid":"".concat(TEST_ID,"--registration-slug-input")})),jsxRuntimeExports.jsxs(Typography,{variant:"caption",fontWeight:400,children:[SHARED_TEXT.form.basicInfo.urlExample(i.replace(/(.us-1|https:\/\/)/g,"").replace("login","signup")+"/"),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"black",fontWeight:800,children:"".concat(t||"<slug>")})]})]})]})};function getFileAsBase64(e,t){var r=new FileReader;r.readAsDataURL(e),r.onload=function(){t(r.result)},r.onerror=function(e){console.log("error getting base64: ",e)}}function _array_like_to_array$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes$1(e){if(Array.isArray(e))return e}function _define_property$3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array_limit$1(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest$1(){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 _object_spread$3(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$3(t,e,r[e])})}return t}function ownKeys$3(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$3(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$3(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array$1(e,t){return _array_with_holes$1(e)||_iterable_to_array_limit$1(e,t)||_unsupported_iterable_to_array$2(e,t)||_non_iterable_rest$1()}function _unsupported_iterable_to_array$2(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$2(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$2(e,t):void 0}var ApperanceStep=function(){var e=useFormContext(),t=e.trigger,r=e.watch,e=e.control,n=_sliced_to_array$1(reactExports.useState(null),2),o=n[0],i=n[1],a=useSelector(selectors.registrationWizard.selectItem),n=r("uiSettings.registrationButtonStyle.backgroundColor"),r=r("uiSettings.registrationButtonStyle.textColor"),s=reactExports.useCallback(function(e){i(e?null:"Invalid color selection"),setTimeout(function(){t("uiSettings.registrationButtonStyle")},50)},[t]);return jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".form-appearance"),sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.description()}),jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsxs(Stack,{gap:1,children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.appearance.buttonColorTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.buttonColorDescription()})]}),jsxRuntimeExports.jsxs(Stack,{gap:4,bgcolor:"#F5F5F5",border:"1px solid #E0E0E0",p:4,alignItems:"center",children:[jsxRuntimeExports.jsx(Controller,{name:"uiSettings.registrationButtonStyle",control:e,rules:{validate:function(e){return o||!(!e.textColor||!e.backgroundColor)||"Both colors are required"}},render:function(e){var t=e.field;return jsxRuntimeExports.jsx(CustomColorInput,{isButtonColorRequired:!1,buttonColor:t.value.backgroundColor,buttonTextColor:t.value.textColor,onValidationCheck:s,onChangeTextColor:function(e){return t.onChange(_object_spread_props$3(_object_spread$3({},t.value),{textColor:e}))},onChangeButtonColor:function(e){return t.onChange(_object_spread_props$3(_object_spread$3({},t.value),{backgroundColor:e}))},onReset:function(){a&&0<Object.keys(a).length?t.onChange({textColor:a.uiSettings.registrationButtonStyle.textColor,backgroundColor:a.uiSettings.registrationButtonStyle.backgroundColor}):t.onChange({textColor:"#FFFFFF",backgroundColor:"#1E88E5"}),s(!0)}})}}),jsxRuntimeExports.jsx(ButtonPreview,{buttonColor:n,buttonTextColor:r})]})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{gap:1,maxWidth:"80%",children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.appearance.veritoneBrandingTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.appearance.veritoneBrandingDescription()})]}),jsxRuntimeExports.jsx(Controller,{name:"uiSettings.veritoneBranding","data-test":"".concat(TEST_ID,".form-input"),"data-testid":"".concat(TEST_ID,".form-input-veritoneBranding"),control:e,defaultValue:!1,render:function(e){var t=e.field;return jsxRuntimeExports.jsx(Switch,{checked:t.value,onChange:function(e){return t.onChange(e.target.checked)},inputProps:{"aria-label":"Remove Veritone Branding"}})}})]})]})};function asyncGeneratorStep$2(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$2(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$2(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$2(n,t,r,o,i,"throw",e)}o(void 0)})}}function _ts_generator$2(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var useUploader=function(e){var t,r=e.accept,n=e.multiple,o=e.onDropAccepted,i=useDispatch(),e=useSelector(preferredLanguageSelector),a=AIWareFormatMessage(e);return useDropzone({accept:r,multiple:n,onDropAccepted:(t=_async_to_generator$2(function(t){var r,n;return _ts_generator$2(this,function(e){switch(e.label){case 0:return r=t[0],n={id:guid(),name:r.name,previewUrl:URL.createObjectURL(r),size:r.size,type:r.type},[4,null==o?void 0:o(r,n)];case 1:return e.sent(),[2]}})}),function(e){return t.apply(this,arguments)}),onDropRejected:function(){var e;i(showMessage({content:null!=(e=a({id:"os-admin-center-registration.snackbar.invalid-file-type",defaultMessage:"Invalid file type. Please upload a PDF or text file.",description:"The error message shows up when the user tries to upload an invalid file type."}))?e:"Invalid file type. Please upload a PDF or text file.",severity:MessageSeverity.Error}))}})};function _array_like_to_array$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_without_holes$1(e){if(Array.isArray(e))return _array_like_to_array$1(e)}function asyncGeneratorStep$1(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator$1(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep$1(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep$1(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property$2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$2(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$2(t,e,r[e])})}return t}function ownKeys$2(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$2(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _to_consumable_array$1(e){return _array_without_holes$1(e)||_iterable_to_array$1(e)||_unsupported_iterable_to_array$1(e)||_non_iterable_spread$1()}function _unsupported_iterable_to_array$1(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$1(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$1(e,t):void 0}function _ts_generator$1(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var URL_PATTERN=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/,validateUrl=function(e){return URL_PATTERN.test(e)||"Please enter a valid URL"},LegalStep=function(){var r,o=useDispatch(),i=useSelector(selectApiConfigs),e=useSelector(preferredLanguageSelector),a=AIWareFormatMessage(e),e=useFormContext(),s=e.setValue,e=e.watch,t=useForm({defaultValues:{privacyPolicyUrl:""},mode:"onChange"}),n=t.control,l=t.formState.errors,c=t.setValue,u=e("files"),t=u.find(function(e){return e.type===OrgDocumentType.terms_of_service&&"active"===e.status}),e=useUploader({accept:["application/pdf","text/plain"],multiple:!1,onDropAccepted:(r=_async_to_generator$1(function(t,r){var n;return _ts_generator$1(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,getSignedWritableUrl(i,r.name)];case 1:return n=e.sent(),[4,fetch(n.url,{method:"PUT",body:t,headers:{"Content-Type":t.type}})];case 2:if(e.sent().ok)return s("files",[{name:t.name,url:n.unsignedUrl,type:OrgDocumentType.terms_of_service}].concat(_to_consumable_array$1(u))),[3,4];throw new Error("Failed to upload file");case 3:return e.sent(),o(showMessage({content:a({id:"os-admin-center-registration.snackbar.upload-failed",defaultMessage:"File upload failed. Please try again.",description:"The error message shows up when file upload fails."}),severity:MessageSeverity.Error})),[3,4];case 4:return[2]}})}),function(e,t){return r.apply(this,arguments)})}),p=e.getInputProps,d=e.open;return reactExports.useEffect(function(){var e=u.find(function(e){return e.type===OrgDocumentType.privacy_policy&&e.status===OrgDocumentStatus.active});e&&c("privacyPolicyUrl",e.url)},[u,c]),jsxRuntimeExports.jsxs(Stack,{sx:{height:"100%"},p:4,gap:6,children:[jsxRuntimeExports.jsx(Stack,{gap:2,children:jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.description()})}),jsxRuntimeExports.jsx(Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{sx:{width:"500px"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.legalInfo.termsOfServiceTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.termsOfServiceDescription()}),jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Button,{"data-testid":"os-admin-center-registration.form.legal-info.terms-of-service-upload",variant:"outlined",size:"large",disabled:!!t,onClick:function(){return d()},children:SHARED_TEXT.form.legalInfo.termsOfServiceUploadButton()}),jsxRuntimeExports.jsx("input",_object_spread_props$2(_object_spread$2({},p()),{style:{display:"none"}}))]})]})}),jsxRuntimeExports.jsx(Stack,{gap:.5,divider:jsxRuntimeExports.jsx(Divider,{}),children:u&&0<u.length&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Stack,{gap:6,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{"& > p":{p:2,fontSize:"14px",fontWeight:"bold"}},children:jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.fileName()})}),u.map(function(e,t){var r;return e.type!==OrgDocumentType.terms_of_service?null:(r=(null==e?void 0:e.status)===OrgDocumentStatus.active||!e.status?"(latest)":"",jsxRuntimeExports.jsxs(Stack,{gap:1,direction:"row",alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{gap:6,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{"& > p":{p:2,fontSize:"14px","& > span":{ml:1,fontSize:"14px"}}},children:[jsxRuntimeExports.jsxs(Typography,{variant:"body1",width:"300px",noWrap:!0,children:["".concat((null==e?void 0:e.name)||"--"),jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"span",children:r})]}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:(null==e?void 0:e.status)||"pending"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{"data-testid":"os-admin-center-registration.form.legal-info.terms-of-service-remove",disabled:e.status===OrgDocumentStatus.inactive,onClick:function(){var r,e;r=t,e=u.map(function(e,t){return t===r&&e.status?_object_spread_props$2(_object_spread$2({},e),{status:OrgDocumentStatus.inactive}):e}).filter(Boolean),s("files",e)},size:"small",children:jsxRuntimeExports.jsx(Delete,{})})})]},e.url))})]})}),jsxRuntimeExports.jsx(Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{sx:{width:"500px"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.legalInfo.privacyPolicyTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.legalInfo.privacyPolicyDescription()})]})}),jsxRuntimeExports.jsx(Controller,{name:"privacyPolicyUrl",control:n,rules:{validate:function(e){return!0===validateUrl(e)||"Please enter a valid URL"}},render:function(e){var r=e.field;return jsxRuntimeExports.jsx(TextField,_object_spread_props$2(_object_spread$2({},r),{fullWidth:!0,label:"Privacy Policy URL",placeholder:"https://example.com/privacy-policy",error:!!l.privacyPolicyUrl,helperText:null==(e=l.privacyPolicyUrl)?void 0:e.message,onChange:function(e){var t;r.onChange(e),e=e.target.value,t=u.filter(function(e){return e.type!==OrgDocumentType.privacy_policy}),e&&t.push({url:e,name:"Privacy Policy",type:OrgDocumentType.privacy_policy}),s("files",t)},"data-testid":"".concat(TEST_ID,".form.legal-info.privacy-policy-url")}))}})]})},useUserAccessPanel=function(){var r=useDispatch(),n=useSelector(selectIsFullscreenEnabled),o=useSelector(selectAdminCenterOrgParameter);return function(e){var t=e.onSave;r(mountPanel({panelId:AvailableComponents.USER_ACCESS_PANEL,microFrontend:{name:AvailableComponents.USER_ACCESS_PANEL,config:{orgId:o,initialData:e.initialData,onSave:t}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:n?0:55,marginStart:n?0:80,size:"medium",parentPanelId:AvailableComponents.ADMIN_CENTER_CUSTOM_REGISTRATION_PANEL,dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))}};function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _define_property$1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _non_iterable_rest(){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 _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$1(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property$1(t,e,r[e])})}return t}function ownKeys$1(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$1(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _unsupported_iterable_to_array(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}var STEP_ID,toogleBtnGroupStyles=_define_property$1({p:.5,paddingBottom:"3px",width:"fit-content",borderRadius:"30px",height:"34px",bgcolor:"rgba(0, 0, 0, 0.1)",display:"flex",gap:.5},"& .".concat(toggleButtonGroupClasses.grouped),{border:0,textTransform:"capitalize",borderRadius:"30px",fontSize:"12px","&:not(:last-of-type)":{borderTopRightRadius:"30px",borderBottomRightRadius:"30px"},"&:not(:first-of-type)":{borderTopLeftRadius:"30px",borderBottomLeftRadius:"30px"},"&.Mui-selected":{color:"black",bgcolor:"#FFF","&:hover":{bgcolor:"#FFF"}},"&:hover":{bgcolor:"rgba(255, 255, 255, 0.5)"}}),UserAccessStep=function(e){var r=e.orgId,n=useDispatch(),t=useUserAccessPanel(),e=useSelector(selectors.appRoles.selectItems),o=useSelector(selectors.authGroups.selectItems),i=_sliced_to_array(reactExports.useState(null),2),a=i[0],s=i[1],i=useFormContext(),l=i.register,c=i.unregister,u=i.control,p=i.watch,d=i.setError,m=i.clearErrors,g=i.trigger,f=i.setValue,x=i.getFieldState,y=p("openRegistrationStatus"),h=p("domainSettings",[]),i=h.some(function(e){return 0<e.applicationRoleIds.length}),b=reactExports.useCallback(function(){"open"===y?(a||x("domainSettings").error)&&(s(null),m("domainSettings")):h&&0!==h.length?h.some(function(e){return 0===e.applicationRoleIds.length})?"At least one product role is required for each domain"!==a&&(s("At least one product role is required for each domain"),d("domainSettings",{message:"At least one product role is required for each domain"})):(a||x("domainSettings").error)&&(s(null),m("domainSettings"),g("domainSettings")):"At least one domain setting is required"!==a&&(s("At least one domain setting is required"),d("domainSettings",{message:"At least one domain setting is required"}))},[h,y,a,x,m,d,g]);return reactExports.useEffect(function(){b()},[b]),reactExports.useEffect(function(){var e,t;0<h.length&&(e=h.map(function(e){return e.authGroupId}).filter(function(e){return!isEmpty$1(e)}),t=h.reduce(function(e,t){return e.push.apply(e,_to_consumable_array(t.applicationRoleIds)),e},[]),e&&0<e.length&&n(actions.authGroups.readStart({orgId:r,authGroupIds:e})),t)&&0<t.length&&n(actions.appRoles.readStart({orgId:r,roleIds:t}))},[n,h]),reactExports.useEffect(function(){"restricted"===y?l("domainSettings",{required:!0,validate:function(e){return 0<e.length&&e.every(function(e){return 0<e.applicationRoleIds.length})}}):c("domainSettings",{keepValue:!0,keepError:!1})},[l,c,y]),jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".user-access-step"),sx:{height:"100%"},p:4,gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.description()}),jsxRuntimeExports.jsx(Controller,{name:"openRegistrationStatus",render:function(e){var r=e.field;return jsxRuntimeExports.jsxs(ToggleButtonGroup,_object_spread_props$1(_object_spread$1({},r),{exclusive:!0,onChange:function(e,t){t&&(r.onChange(t),f("domainSettings",[]))},value:r.value,sx:toogleBtnGroupStyles,children:[jsxRuntimeExports.jsx(ToggleButton,{value:"open","data-testid":"".concat(TEST_ID,".open-registration-toggle-open"),children:SHARED_TEXT.form.userAccess.openRegistration()}),jsxRuntimeExports.jsx(ToggleButton,{value:"restricted","data-testid":"".concat(TEST_ID,".open-registration-toggle-restricted"),children:SHARED_TEXT.form.userAccess.allowlistOnly()})]}))}}),"open"===y&&jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.openRegistrationDescription()}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Button,{variant:"outlined",color:"primary",size:"large","data-testid":"".concat(TEST_ID,".choose-user-access-button"),onClick:function(){t({initialData:null!=h&&h[0]?{authGroupId:h[0].authGroupId,roleIds:h[0].applicationRoleIds}:void 0,onSave:function(e,t){h.length<=0?f("domainSettings",[{domainName:"",authGroupId:""===e.authGroupId?null:e.authGroupId,applicationRoleIds:Object.values(e.roles)}]):f("domainSettings[0]",{authGroupId:""===e.authGroupId?null:e.authGroupId,applicationRoleIds:Object.values(e.roles)}),b(),t()}})},children:SHARED_TEXT.form.userAccess.chooseUserAccess(i)})}),jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(OpenRegistrationDomains,{authGroups:o,apps:e,domainSettings:h}),a&&jsxRuntimeExports.jsx(Typography,{color:"error","data-testid":"".concat(TEST_ID,".error-message"),children:a})]})]}),"restricted"===y&&jsxRuntimeExports.jsxs(Stack,{gap:4,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.restrictedRegistrationDescription()}),jsxRuntimeExports.jsx(DomainInputForm,{authGroups:o,apps:e,domainSettings:h,validateDomainSettings:b}),a&&jsxRuntimeExports.jsx(Typography,{color:"error","data-testid":"".concat(TEST_ID,".error-message"),children:a})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{gap:1,maxWidth:"80%",children:[jsxRuntimeExports.jsx(Typography,{variant:"h3",children:SHARED_TEXT.form.userAccess.adminApprovalTitle()}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.adminApprovalDescription()})]}),jsxRuntimeExports.jsx(Controller,{name:"adminApprovalRequired","data-test":"".concat(TEST_ID,".form-input"),"data-testid":"".concat(TEST_ID,".form-input-adminApprovalRequired"),control:u,defaultValue:!1,render:function(e){var t=e.field;return jsxRuntimeExports.jsx(Switch,{checked:t.value,onChange:function(e){return t.onChange(e.target.checked)},inputProps:{"aria-label":"Admin Approval Required"},"data-testid":"".concat(TEST_ID,".admin-approval-switch")})}})]})]})},DomainInputForm=function(e){function n(n,e){m({initialData:e,onSave:function(e,t){var r=Object.values(e.roles);s("domainSettings[".concat(n,"].authGroupId"),""===e.authGroupId?null:e.authGroupId),s("domainSettings[".concat(n,"].applicationRoleIds"),r),null!=a&&a(),t()}})}function t(e){e={domainName:null==(e=e.domain)?void 0:e.toLowerCase(),authGroupId:null,applicationRoleIds:[]},s("domainSettings",_to_consumable_array(i).concat([e])),p("domain",""),d("domain")}var o=e.apps,i=e.domainSettings,a=e.validateDomainSettings,s=useFormContext().setValue,e=useForm({mode:"onChange",defaultValues:{domain:""}}),r=e.control,l=e.handleSubmit,c=e.formState,u=c.errors,c=c.isValid,p=e.setValue,d=e.clearErrors,m=useUserAccessPanel();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("form",{onSubmit:l(t),children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Controller,{name:"domain",control:r,rules:{validate:function(t){return""!==t&&(!i.some(function(e){return e.domainName===t.toLowerCase()})||"Domain already exists")},pattern:{value:/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/,message:"Invalid domain format"}},render:function(e){var e=e.field;return jsxRuntimeExports.jsx(TextField,_object_spread_props$1(_object_spread$1({},e),{fullWidth:!0,"data-testid":"".concat(TEST_ID,".domain-input"),placeholder:'Add a domain name (e.g. "example.com")',error:!!u.domain,helperText:null==(e=u.domain)?void 0:e.message,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),l(t)())}}))}}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{type:"submit",disabled:!c,"data-testid":"".concat(TEST_ID,".add-domain-button"),children:jsxRuntimeExports.jsx(Add$1,{})})})]})}),0<i.length&&jsxRuntimeExports.jsxs(Stack,{gap:.5,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Domain"}),i.map(function(e,r){var t=0<e.applicationRoleIds.length;return jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,p:2,alignItems:"center",bgcolor:"#F5F5F5",justifyContent:"space-between",width:"100%",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",noWrap:!0,width:"170px",children:e.domainName}),t?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AvatarGroup,{max:4,sx:{"& .Sdk-MuiAvatar-root":{width:"20px",height:"20px",fontSize:"12px",border:"1px solid #F5F5F5",marginLeft:"unset",color:"#5C6269"}},children:e.applicationRoleIds.map(function(t,e){var r=o.find(function(e){return e.roles.some(function(e){return e.id===t})});return jsxRuntimeExports.jsx(Avatar,{src:null==r?void 0:r.icon,sx:{bgcolor:"primary.main",marginLeft:"-8px !important",color:"white !important"},children:null!=(r=null==r?void 0:r.label[0])?r:"--"},e)})}),jsxRuntimeExports.jsx(Button,{variant:"text",color:"primary",size:"small",onClick:function(){return n(r,{authGroupId:e.authGroupId,roleIds:e.applicationRoleIds})},"data-testid":"".concat(TEST_ID,".edit-user-access-button-").concat(r),children:"Edit User Access"})]}):jsxRuntimeExports.jsx(Button,{variant:"text",color:"primary",size:"small",onClick:function(){return n(r)},"data-testid":"".concat(TEST_ID,".add-user-access-button-").concat(r),children:"Add User Access"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{onClick:function(){s("domainSettings",i.filter(function(e,t){return t!==r}))},"data-testid":"".concat(TEST_ID,".delete-domain-button-").concat(r),children:jsxRuntimeExports.jsx(Delete,{})})})]},r)})]})]})},OpenRegistrationDomains=function(e){var t=e.authGroups,i=e.apps,a=e.domainSettings,s=useFormContext(),e=null!=(e=a[0])?e:void 0,r=null==e?void 0:e.authGroupId,t=t.find(function(e){return e.id===r});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(t||e)&&jsxRuntimeExports.jsx(Typography,{variant:"body1",children:SHARED_TEXT.form.userAccess.openRegistrationGroupDescription()}),t&&jsxRuntimeExports.jsxs(Stack,{gap:.5,children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Group"}),jsxRuntimeExports.jsx(Stack,{direction:"row",gap:2,alignItems:"center",children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:4,p:2,alignItems:"center",bgcolor:"#F5F5F5",width:"100%",children:[jsxRuntimeExports.jsx(Group,{}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:t.name})]})})]}),jsxRuntimeExports.jsx(Stack,{gap:.5,children:void 0!==e&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",justifyContent:"space-between",maxWidth:"610px",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",children:"Product"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",fontSize:"12px",pr:28,children:"Role"})]}),e.applicationRoleIds.map(function(t,r){var e,n=i.find(function(e){return e.roles.some(function(e){return e.id===t})}),o=null==n?void 0:n.roles.find(function(e){return e.id===t});return jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",p:2,alignItems:"center",bgcolor:"#F5F5F5",width:"100%",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Avatar,{src:null==n?void 0:n.icon,sx:{bgcolor:"primary.main",width:"24px",height:"24px",fontSize:"12px"},children:null!=(e=null==n?void 0:n.label[0])?e:"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:null!=(e=null==n?void 0:n.label)?e:"--"})]}),jsxRuntimeExports.jsx(Typography,{variant:"body1",pr:7,children:null!=(n=null==o?void 0:o.name)?n:"--"})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(IconButton,{"data-testid":"".concat(TEST_ID,".delete-product-button"),onClick:function(){s.setValue("domainSettings",a.map(function(e){return _object_spread_props$1(_object_spread$1({},e),{applicationRoleIds:e.applicationRoleIds.filter(function(e,t){return t!==r})})}))},children:jsxRuntimeExports.jsx(Delete,{})})})]})})]})})]})},FormBuilderStep=function(){var e=useFormContext(),t=e.setValue,e=(0,e.watch)("uiSettings.customRegistrationFields");return jsxRuntimeExports.jsxs(Stack,{"data-testid":"".concat(TEST_ID,".form-appearance"),sx:{height:"100%"},p:4,gap:3,children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:SHARED_TEXT.form.formBuilder.description()}),jsxRuntimeExports.jsx(Chip,{label:"Optional",variant:"outlined",color:"info",size:"small"})]}),jsxRuntimeExports.jsx(FormBuilder,{initialSchema:e,EmptyState:{description:"Drag in Building Blocks from the left to craft a new Registration Template"},onSchemaChange:function(e){t("uiSettings.customRegistrationFields",e)}})]})},LoadingSkeleton=function(e){e=e.fields;return jsxRuntimeExports.jsxs(Stack,{sx:{p:4,height:"100%"},justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:"100%",height:86}),jsxRuntimeExports.jsx(Box,{sx:{my:8},children:e.map(function(e,t){return jsxRuntimeExports.jsx(Box,{sx:{mb:4},children:jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:e.width||"100%",height:"multiline"===e.type?100:56,sx:{mt:1}})},t)})})]}),jsxRuntimeExports.jsxs(Box,{sx:{mt:4,display:"flex",justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:36,sx:{display:"inline-block"}})}),jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:36})]})]})};function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function _async_to_generator(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);(n="function"==typeof Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):n).forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator(n,o){var i,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;l;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}(e=>{e[e.BASIC_INFO=1]="BASIC_INFO",e[e.LEGAL=2]="LEGAL",e[e.USER_ACCESS=3]="USER_ACCESS",e[e.FORM_BUILDER=4]="FORM_BUILDER",e[e.APPERANCE=5]="APPERANCE"})(STEP_ID=STEP_ID||{});var PanelHeader=panelComponents.header,PanelContainer=panelComponents.container,CustomRegistrationPanelWizard=function(e){var t,r=e.id,e=e.orgId,o=useDispatch(),n=useSelector(selectIsFullscreenEnabled),i=useSelector(selectors.registrationWizard.selectActiveStep),a=useSelector(selectors.registrationWizard.selectWizard),s=useSelector(selectors.registrationWizard.selectItem),l=useSelector(selectors.registrationWizard.selectReadStatus),c=useSelector(selectors.registrationWizard.selectCreateStatus),u=useSelector(selectors.registrationWizard.selectUpdateStatus),p=useSelector(selectAdminCenterOrgParameter),d=useSelector(selectOrgId),p="".concat(null!=(e=null!=e?e:p)?e:d),m=useForm({mode:"onChange",defaultValues:a}),g=m.trigger,f=m.getValues,e=m.watch,x=m.formState.isValid,y=e(),h=!!r,d="pending"===l,e="pending"===c||"pending"===u,l=[{step:1,label:"Basic Info",component:jsxRuntimeExports.jsx(BasicInfoStep,{isEditMode:h})},{step:2,label:"Legal",component:jsxRuntimeExports.jsx(LegalStep,{})},{step:3,label:"User Access",component:jsxRuntimeExports.jsx(UserAccessStep,{orgId:p})},{step:4,label:"Form Builder",component:jsxRuntimeExports.jsx(FormBuilderStep,{})},{step:5,label:"Apperance",component:jsxRuntimeExports.jsx(ApperanceStep,{})}],p=reactExports.useMemo(function(){return h?x&&!isEqual(s,y):x},[x,h,s,y]),b=reactExports.useMemo(function(){switch(i){case 1:return[{type:"short",width:"100%"}];case 2:return[{type:"long",width:"100%"},{type:"multiline",width:"100%"}];default:return[{type:"short",width:"100%"},{type:"short",width:"100%"}]}},[i]),_=reactExports.useCallback((t=_async_to_generator(function(t){var r,n;return _ts_generator(this,function(e){switch(e.label){case 0:return 0===t?[2]:[4,g()];case 1:return e.sent()&&(r=f(),n=cloneDeep(a),o(actions.registrationWizard.setWizard(defaultsDeep(n,r))),o(actions.registrationWizard.setActiveStep(t))),[2]}})}),function(e){return t.apply(this,arguments)}),[o,f,g,a]),j=reactExports.useCallback(function(){o(actions.registrationWizard.updateResetStatus()),o(actions.registrationWizard.resetCreateStatus()),o(actions.registrationWizard.resetItem()),o(actions.registrationWizard.readResetStatus()),o(hidePanel(CUSTOM_REGISTRATION_PANEL_ID))},[o]),E=reactExports.useCallback(function(){var e=f();console.log("formData",e),o(h?actions.registrationWizard.updateStart(e):actions.registrationWizard.createStart(e))},[o,f,h]);return reactExports.useEffect(function(){s&&0<Object.keys(s).length&&m.reset(s)},[s]),reactExports.useEffect(function(){"success"!==c&&"success"!==u||(o(actions.registration.readStart(null)),j())},[c,u,o,j]),reactExports.useEffect(function(){h&&o(actions.registrationWizard.readStart(r))},[o,r,h]),jsxRuntimeExports.jsxs(PanelContainer,{testId:"".concat(TEST_ID_PANEL,"-panel-container"),panelId:CUSTOM_REGISTRATION_PANEL_ID,isFullScreen:n,children:[jsxRuntimeExports.jsx(PanelHeader,{testId:"".concat(TEST_ID_PANEL,"-panel-header"),title:h?SHARED_TEXT.panel.editTitle():SHARED_TEXT.panel.createTitle(),onPanelClose:j}),d?jsxRuntimeExports.jsx(LoadingSkeleton,{fields:b}):jsxRuntimeExports.jsx(FormProvider,_object_spread_props(_object_spread({},m),{children:jsxRuntimeExports.jsx(ProgressStepper,{entityId:r,enableTabs:h,sessionKey:"customLoginRegistration",idPrefix:"".concat(TEST_ID_PANEL,"-wizard"),panelName:CUSTOM_REGISTRATION_PANEL_ID,steps:l.map(function(e){return e.label}),stepContent:l.map(function(e){return e.component}),onResumeSession:function(e){console.log("session",e)},BodySx:h?{p:2,bgcolor:"#F5F5F5","& #body-container":{bgcolor:"#FFF",borderRadius:"6px",overflowY:"auto"}}:{"& #body-container":{overflowY:"auto"}},FooterSx:h?{bgcolor:"#F5F5F5"}:{},customFinalStepButtons:[jsxRuntimeExports.jsx(LoadingButton,{"data-test":"".concat(TEST_ID_PANEL,"-").concat(h?"save":"submit","-button"),variant:"contained",color:"primary",disabled:!p,onClick:E,loading:e,children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"{testId}.{idPrefix}-app-button",defaultMessage:"{verb}",description:"{verb} app button text",values:{testId:TEST_ID_PANEL,idPrefix:h?"save":"submit",verb:h?"Save":"Submit"}})})],onActiveStepChange:_,nextButtonDisabled:!p})}))]})},CustomRegistrationPanel=function(e){return jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterRegistrationModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(CustomRegistrationPanelWizard,{id:e.id,orgId:e.orgId})})})})})};export{CustomRegistrationPanel,CustomRegistrationTab};
Binary file