"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7046],{88779:function(e,n,t){t.d(n,{G:function(){return i},T:function(){return a}});var r=t(85381),i={parse:function(e){var n=e.key,t=e.propertyType,r=n.split(" | ");return"account_event"===t||"user_event"===t?1===r.length?"allTime":r[1]:void 0},serialize:function(e){var n=e.key,t=e.timeRange;return void 0===t||"allTime"===t?n:"".concat(n," | ").concat(t)}},a=function(e){return e.map((function(e){return void 0!==e.property?{key:i.serialize({key:e.property.key,timeRange:e.timeRange}),operator:Array.isArray(e.value)?"between"===e.condition?"between":"eq"===e.condition?"in":"not_in":"empty"===e.condition?"eq":"not_empty"===e.condition?"neq":e.condition,value:Array.isArray(e.value)?(0,r.Z)(e.value).sort():"datetime"===e.dataType&&["empty","not_empty"].includes(e.value)?null:e.value,value_type:e.dataType}:{key:e.propertyType,operator:e.condition,value:e.value,value_type:e.dataType}}))}},36076:function(e,n,t){t.d(n,{F2:function(){return w},Lp:function(){return g},cb:function(){return j}});var r=t(2464),i=t(56101),a=t(88349),o=t(50168),l=t(26704),d=t(78749),u=t(33872),s=t(34885),c=t(3708),p=t(20385),m=t(90944),f=t(91140),v=t(86776),h=t(30423),y=(0,i.Z)((0,p.I)("FieldArrayName"),2),x=y[0],g=y[1],b=s.memo((function(e){var n=e.disabled,t=e.id,r=e["data-testid"],i=e.remove,l=e.children;return(0,a.jsxs)("div",{className:"default-children-wrapper flex w-full items-center gap-2",children:[(0,m.wI)(l,{id:t,"data-testid":r}),(0,a.jsx)(v.z,{type:"button",size:"small",buttonType:"tertiary",id:"remove-field-button","data-testid":"remove-field-button",onClick:i,disabled:n,className:"remove-button",children:(0,a.jsx)(v.z.IconOnly,{icon:o.T})})]})}));b.displayName="DefaultChildrenWrapper",b.whyDidYouRender=!0;var j=s.memo((function(e){return(0,a.jsx)("div",{className:"field-array-field-children-container","data-last-item":e["data-last-item"],children:(0,m.wI)(e.children,(0,r.Z)({},e))})}));function w(e){var n=e.name,t=e.children,i=e.className,o=e.label,p=e.addButton,m=e.addButtonPosition,y=void 0===m?"end":m,g=e.direction,j=void 0===g?"vertical":g,w=e.disabled,Z=void 0!==w&&w,_=e.id,k=e.wrapChildren,N=void 0===k?b:k,T=e.emptyStateComponent,C=e.minimumFields,A=void 0===C?0:C,S=e.maximumFields,R=void 0===S?1/0:S,z=(0,u.Z)("common").t,F=(0,f.J)(_,!0),I=(0,c.Dq)({name:n}),M=I.fields,Y=I.append,E=I.remove,L=(0,s.useCallback)((function(){return null===p||M.length>=R?null:void 0!==p?(0,a.jsx)(p,{id:"add-field-button","data-testid":"add-field-button",append:Y,disabled:Z}):(0,a.jsxs)(v.z,{type:"button",buttonType:"tertiary",size:"small",className:"max-w-max",id:"add-field-button",onClick:function(){Y({},{shouldFocus:!0})},disabled:Z,children:[(0,a.jsx)(v.z.LeftIcon,{icon:l.p}),(0,a.jsx)(v.z.Text,{children:z("add")})]})}),[p,Y,Z,M.length,R,z]),P=(0,s.useCallback)((function(e){return null===N?(0,a.jsx)(s.Fragment,{children:e.children}):(0,a.jsx)(N,(0,r.Z)({},e))}),[N]),D="function"===typeof t;return(0,a.jsxs)("div",{className:i,children:[void 0===o?null:(0,a.jsx)(h.AZ,{label:o,id:F}),(0,a.jsxs)("div",{className:(0,d.Z)("field-array field-array-fields-container flex gap-2","horizontal"===j?"flex-row flex-wrap":"flex-col"),id:F,"data-testid":F,children:["start"===y&&(0,a.jsx)(L,{}),D&&t(M,E),0===M.length&&void 0!==T&&(0,a.jsx)(T,{}),!D&&M.map((function(e,r){var i=function(){E(r)};return(0,a.jsx)(s.Fragment,{children:s.Children.toArray(t).map((function(e,t){return s.isValidElement(e)?(0,a.jsx)(x,{value:"".concat(n,".").concat(r),children:(0,a.jsx)(P,{id:"".concat(F,"-").concat(r),"data-testid":"".concat(F,"-").concat(r),"data-last-item":M.length-1===r,disabled:Z,fields:M,remove:M.length<=A?void 0:i,append:Y,index:r,children:e})},t):null}))},e.id)})),"end"===y&&(0,a.jsx)(L,{})]}),"bottom"===y&&(0,a.jsx)(L,{})]})}j.displayName="ChildrenWrapperWithoutRemoveButton",j.whyDidYouRender=!0,w.displayName="ControlledFieldArray",w.whyDidYouRender=!0},25192:function(e,n,t){t.d(n,{T9:function(){return x},bR:function(){return h},fD:function(){return f}});var r=t(2464),i=t(26542),a=t(50854),o=t(85381),l=t(88349),d=t(66151),u=t.n(d),s=t(34885),c=t(3708),p=t(45902),m=t(36076);function f(e){var n=(0,m.Lp)();return(0,s.useMemo)((function(){return void 0===n||null===n?e:"".concat(n,".").concat(e)}),[n,e])}var v=RegExp("(?:[^\\s]+\\[\\d\\]\\.(?<field_name>[^\\s]+))?(?:\\s+)?(?<message>[^\\[\\]]*)$");function h(e){var n;if(void 0!==e){var t,r=null!==(t=null===(n=e.match(v))||void 0===n?void 0:n.groups)&&void 0!==t?t:{},i=r.message,a=r.field_name;if(void 0!==a||void 0!==i)return void 0===a?i:"".concat(a," ").concat(null!==i&&void 0!==i?i:"")}}var y=function(e,n){var t=h(null===e||void 0===e?void 0:e.message);return"string"===typeof t&&t.startsWith(n)?t.replace(n,u()(n)):t};function x(e,n){var t=n.name,d=(0,a.Z)(n,["name"]),u=s.forwardRef((function(n,t){var a=(0,c.Gc)(),d=f(n.name);if("value"in n||null===a)return(0,l.jsx)(e,(0,i.Z)((0,r.Z)({},n),{forwardedRef:t}));var u=n.errorSerializer,s=void 0===u?y:u;return(0,l.jsx)(c.Qr,{name:d,render:function(a){var u=a.field,c=u.name,m=u.onBlur,f=u.onChange,v=u.ref,h=u.value,y=a.fieldState.error;return(0,l.jsx)(e,(0,i.Z)((0,r.Z)({},n),{name:c,value:h,onBlur:function(e){var t;m(),null===(t=n.onBlur)||void 0===t||t.call(n,e)},onChange:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i,a;f.apply(void 0,(0,o.Z)(t)),null===(a=n.onChange)||void 0===a||(i=a).call.apply(i,[n].concat((0,o.Z)(t)))},error:s(y,d),forwardedRef:function(e){(0,p.p)(e,[t,v])}}))}})}));return Object.assign(u,(0,i.Z)((0,r.Z)({},d),{displayName:t,whyDidYouRender:!0}))}},80277:function(e,n,t){t.d(n,{W:function(){return l}});var r=t(88349),i=t(34885),a=t(66567),o=function(e){var n=e.children,t=e.keys,i=(0,a.K)(t);return(0,r.jsx)(r.Fragment,{children:n(i)})},l=i.memo(o);Object.assign(l,{whyDidYouRender:!0,displayName:"RenderScope",defaultProps:{__TYPE:"FormRenderScope"}})},66567:function(e,n,t){t.d(n,{K:function(){return o},n:function(){return d}});var r=t(88349),i=t(34885),a=t(3708);function o(e){var n=(0,i.useRef)("function"===typeof e||Array.isArray(e)&&0===e.length?void 0:{name:Array.isArray(e)?e:Object.keys(e)}),t=(0,a.qo)(n.current);return(0,i.useMemo)((function(){return void 0!==n.current&&Array.isArray(t)?t.reduce((function(e,t,r){return e[n.current.name[r]]=t,e}),{}):t}),[t])}var l=function(e){var n=e.children,t=e.condition,a=o(t);return(0,i.useMemo)((function(){return"function"===typeof t?t(a):Object.keys(t).every((function(e){return a[e]===t[e]}))}),[t,a])?(0,r.jsx)(r.Fragment,{children:n}):null},d=i.memo(l);Object.assign(d,{displayName:"When",whyDidYouRender:!0})},10322:function(e,n,t){t.d(n,{s:function(){return x}});var r=t(2464),i=t(88349),a=t(6126),o=t(33872),l=t(34885),d=t(86776),u=t(83815),s=t(58782),c=t(86205),p=t(5749),m=t(26542);function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function v(e){return f(e)&&"type"in e&&"message"in e&&"ref"in e}function h(e){if(!f(e))return{};for(var n in e)return e[n];return{}}function y(e,n){var t=Object.keys(e);return t.reduce((function(i,a){var o=e[a];if(null===o||void 0===o||0===a.length)return i;var l,d=function(e){if(Array.isArray(e))return e;if("object"===typeof e&&(void 0!==(null===e||void 0===e?void 0:e[0])||void 0!==(null===e||void 0===e?void 0:e[0]))){var n=(0,r.Z)({},e);return delete n.type,delete n.message,delete n.ref,Array.from((0,m.Z)((0,r.Z)({},n),{length:Object.keys(n).length}))}return e}(o);if(Array.isArray(d)){var u={};if(v(o)&&(u[a]={count:null,type:o.type}),d.length>0&&v(d[0])){var s=d[0];return(0,m.Z)((0,r.Z)({},i,u),(0,p.Z)({},a,{type:s.type,count:null}))}var c=d.filter((function(e){return!v(e)})).map((function(e){if(void 0!==e&&null!==e)return y(1===Object.keys(e).length&&!v(h(e))?h(e):e)})).filter(Boolean);return(0,r.Z)({},u,c.reduce((function(e,n){for(var t in n){var r="".concat(a,"_").concat(t),i=n[t],o=e[r],l="number"!==typeof(null===o||void 0===o?void 0:o.count)?1:o.count+1;e[r]={type:i.type,count:l}}return e}),i))}if(v(o)){var x=void 0===n?a:"".concat(n,"_").concat(a);return(0,m.Z)((0,r.Z)({},i),(0,p.Z)({},x,{type:o.type,count:null}))}if(f(l=o)&&"label"in l&&"value"in l){var g=void 0!==n&&1===t.length?n:a;return(0,m.Z)((0,r.Z)({},i),(0,p.Z)({},g,{type:o.value.type,count:null}))}return(0,r.Z)({},i,y(o,a))}),{})}var x=function(e){var n=e.errors,t=e.children,p=e.errorToolTipPlacement,m=e.translate,f=e.className,v=e.buttonType,h=void 0===v?"primary":v,x=e.size,g=(0,o.Z)("components.formErrors").t,b=(0,l.useMemo)((function(){return y(n)}),[n]),j=(0,l.useMemo)((function(){return Object.keys(b)}),[b]),w=(0,l.useMemo)((function(){return j.length}),[j.length]);return 0===w?(0,i.jsx)(i.Fragment,{children:t}):(0,i.jsx)(c.u,{id:"form-issues",debounce:!0,popperComponent:(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg bg-white shadow-elevated",style:{width:316},children:[(0,i.jsxs)("div",{className:"flex rounded-t-lg bg-red-lighter p-4",children:[(0,i.jsxs)("div",{className:"relative flex w-full flex-col gap-1",children:[(0,i.jsx)(s.x,{type:"extra-small",color:"labels",children:g("proceedText")}),(0,i.jsx)(u.X,{type:"medium",color:"red",style:{maxWidth:146},children:g("issuesText",{count:w})})]}),(0,i.jsx)("img",{className:"absolute",style:{right:0,top:-26},src:"/images/illustrations/form-error-illustration.svg",width:131,height:108})]}),(0,i.jsx)("div",{className:"flex flex-col gap-3 pb-2",children:j.map((function(e,n){var t=b[e];return(0,i.jsxs)("div",{className:"inline-flex gap-1 px-3",children:[(0,i.jsx)("div",{className:"flex h-4 w-4 flex-shrink-0 flex-grow-0 items-center justify-center rounded-sm bg-neutral-darker",children:(0,i.jsx)(u.X,{id:"error-number-".concat(n),type:"extra-small",children:n+1})}),(0,i.jsx)(s.x,{type:"small",color:"body",id:"error-list-item-".concat(n),children:m("formErrors.".concat(e,".").concat(t.type),(0,r.Z)({},t))})]},n)}))})]}),placement:null!==p&&void 0!==p?p:"top",offset:{top:8,left:-108},children:(0,i.jsxs)(d.z,{type:"button",buttonType:h,size:x,className:f,disabled:!0,children:[(0,i.jsx)(d.z.LeftIcon,{icon:a.j}),(0,i.jsx)(d.z.Text,{children:g("issues",{count:w})})]})})};x.displayName="WithFormErrors",x.whyDidYouRender=!0},98436:function(e,n,t){t.d(n,{F:function(){return o},V:function(){return l}});var r=t(56101),i=t(20385),a=(0,r.Z)((0,i.I)("FormErrors",{}),2),o=a[0],l=a[1]},29959:function(e,n,t){t.d(n,{a:function(){return u}});var r=t(31470),i=t(85381),a=t(36716),o=t(36786),l=t.n(o),d=t(34885);function u(){var e=(0,d.useState)({}),n=e[0],t=e[1],o=(0,d.useCallback)((function(e){return(0,r.Z)((function(){var n,r,o,d,u=arguments;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:for(n=u.length,r=new Array(n),o=0;o<n;o++)r[o]=u[o];return[4,e.apply(void 0,(0,i.Z)(r))];case 1:return d=a.sent(),t((function(e){return l()(e,d.errors)?e:d.errors})),[2,d]}}))}))}),[]);return{formErrors:n,schemaResolver:o}}},71092:function(e,n,t){t.d(n,{F2:function(){return $},Mm:function(){return J},ZT:function(){return O},Zy:function(){return B},l0:function(){return H}});var r=t(31470),i=t(5749),a=t(2464),o=t(26542),l=t(50854),d=t(56101),u=t(85381),s=t(36716),c=t(88349),p=t(37252),m=t(94131),f=t(26704),v=t(50168),h=t(78749),y=t(85764),x=t.n(y),g=t(87191),b=t.n(g),j=t(66151),w=t.n(j),Z=t(34885),_=t(3708),k=t(21896),N=t(36241),T=t(88779),C=t(20385),A=t(5582),S=t(86776),R=t(91140),z=t(90944),F=t(30423),I=t(45902),M=t(80277),Y=t(66567),E=t(10322),L=t(29959),P=t(98436),D=(0,d.Z)((0,C.I)("CustomForm"),2),V=D[0],O=D[1],B=(0,Z.createContext)({});function q(e){return"input"===e.type&&"hidden"===e.props.type}function W(e,n){var t=void 0!==n;return["CheckboxInput","ToggleInput","RecaptchaInput"].includes(e)?!!t&&n:t?n:""}function G(e){return q(e)||void 0!==e.props.__TYPE&&String(e.props.__TYPE).endsWith("Input")}function K(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{defaultValues:{},fieldArrayDefaultValues:{},fieldArrayAppendValues:{},itemSchema:{},steps:[]};if(null===e||"object"!==typeof e||!("props"in e))return n;if(void 0===e.props.children||0===e.props.children.length){if(G(e)){if(n.steps.length>0){var t=n.steps[n.steps.length-1];null===t||void 0===t||t.inputs.push(e.props.name)}n.defaultValues[e.props.name]=W(e.props.__TYPE,e.props.defaultValue),void 0!==e.props.validation&&(n.itemSchema=(0,o.Z)((0,a.Z)({},n.itemSchema),(0,i.Z)({},e.props.name,e.props.validation)))}return n}if("FieldArray"===e.props.__TYPE){if(n.steps.length>0){var r=n.steps[n.steps.length-1];null===r||void 0===r||r.inputs.push(e.props.name)}return void 0!==e.props.validation&&(n.itemSchema=(0,o.Z)((0,a.Z)({},n.itemSchema),(0,i.Z)({},e.props.name,e.props.validation))),n.fieldArrayDefaultValues[e.props.formKey]=e.props.defaultValue,n}var l="Step"===e.props.__TYPE||"AccordionStep"===e.props.__TYPE,d=l&&!1===e.props.enabled;if(d)return n;var s=Z.Children.toArray(e.props.children).reduce((function(e,n){return K(n,e)}),(0,o.Z)((0,a.Z)({},n),{steps:l?(0,u.Z)(n.steps).concat([{id:e.props.id,inputs:[]}]):n.steps}));return x()(s,n)}var J=Z.memo((function(e){var n=e.children,t=e.size,r=void 0===t?"medium":t,i=e.className,o=e.icon,l=e.buttonType,d=void 0===l?"primary":l,u=e.iconPosition,s=void 0===u?"left":u,p=e.allowMultipleSubmits,m=void 0===p||p,f=e.errorTranslate,v=(0,_.Gc)().formState,h=v.isValid,y=v.isSubmitting,x=v.isSubmitSuccessful,g=(0,P.V)(),b=O(),j=(0,Z.useMemo)((function(){return m?y:y||x}),[y,x,m]),w=null!==b?b.isLoading:j,k=(0,Z.useMemo)((function(){return(0,c.jsxs)(S.z,{className:i,disabled:w||!h,type:"submit",id:"submit-button",size:r,isLoading:w,buttonType:d,children:[void 0!==o&&!w&&"left"===s&&Z.Children.toArray(n).length>0&&(0,c.jsx)(S.z.LeftIcon,{icon:o}),void 0!==o&&!w&&0===Z.Children.toArray(n).length&&(0,c.jsx)(S.z.IconOnly,{icon:o}),Z.Children.toArray(n).length>0&&(0,c.jsx)(S.z.Text,{children:n}),void 0!==o&&!w&&"right"===s&&Z.Children.toArray(n).length>0&&(0,c.jsx)(S.z.RightIcon,{icon:o})]})}),[d,n,i,o,s,w,h,r]);return void 0!==f?(0,c.jsx)(E.s,{errors:(0,a.Z)({},null!==g&&void 0!==g?g:{}),translate:f,className:i,size:r,buttonType:d,children:k}):(0,c.jsx)(c.Fragment,{children:k})}));function $(e){var n=e.children,t=e.formKey,r=e.addButtonText,i=e.label,d=e.mode,u=void 0===d?"vertical":d,s=e.addButton,p=e.className,y=e.addButtonPosition,x=void 0===y?"end":y,g=e.minimumFields,j=void 0===g?0:g,w=e.disabled,N=void 0!==w&&w,C=e.hideRemoveButton,I=void 0!==C&&C,M=e.id,Y=e.onChange,E=(0,R.J)(M,!0),L=(0,Z.useContext)(B).fieldArrayAppendValues,P=(0,_.Gc)().watch,D=(0,_.Dq)({name:t}),V=D.fields,O=D.append,q=D.remove;(0,k.Z)((function(){P((function(e,n){var r;n.name===t&&(null===Y||void 0===Y||Y(null!==(r=e[t])&&void 0!==r?r:[]))}))}));var W=(0,Z.useMemo)((function(){return"function"===typeof n?[]:Z.Children.toArray(n).filter(G)}),[n]),K=(0,Z.useMemo)((function(){var e=L[t];return N?(0,c.jsx)(Z.Fragment,{}):void 0===s?(0,c.jsxs)(S.z,{onClick:function(n){n.preventDefault(),n.stopPropagation(),O(e)},type:"button",id:"".concat(E,"-add"),buttonType:"tertiary",size:"small",className:"max-w-max",children:[(0,c.jsx)(S.z.LeftIcon,{color:"primary",icon:f.p,size:"small"}),(0,c.jsx)(S.z.Text,{children:r})]}):"function"===typeof s?s({append:O,fieldAppendValue:e,id:"".concat(E,"-add"),formKey:t}):(0,z.wI)(s,(0,o.Z)((0,a.Z)({},s.props),{id:"".concat(E,"-add"),"data-testid":"".concat(E,"-add"),append:O,formKey:t,onClick:function(n){var t,r;null===(r=(t=s.props).onClick)||void 0===r||r.call(t,n),n.preventDefault(),n.stopPropagation(),O(e)}}))}),[s,r,O,N,L,E,t]),J=(0,Z.useCallback)((function(){return"function"===typeof n?n(V,q):null}),[n,V,q]),$="function"===typeof n;return(0,c.jsxs)("div",{className:(0,h.Z)("flex w-full flex-col gap-2",p),id:E,"data-testid":E,children:[void 0===i?null:(0,c.jsx)(F.AZ,{label:i}),(0,c.jsxs)("div",{className:(0,h.Z)("field-array-fields-container flex gap-2","vertical"===u?"flex-col":"flex-row flex-wrap"),children:["start"===x&&K,$?(0,c.jsx)(J,{}):V.map((function(e,n){return(0,c.jsxs)("div",{className:(0,h.Z)("field-array-field-children-container relative flex gap-2",{"pr-12":!I}),"data-testid":"".concat(E,"-field-").concat(n),"data-last-item":V.length-1===n,children:[W.map((function(r,i){var d=function(){q(n)};if(!Z.isValidElement(r))return null;var u=r.props.name,s="".concat(t,".").concat(n,".").concat(u);return(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(_.Qr,{defaultValue:void 0===e[u]?"":e[u],name:s,render:function(t){var i,c=t.field.onChange,p=(0,l.Z)(t.field,["onChange"]),f={disabled:N,onChange:function(e){var n,t;c(e),null===(t=(n=r.props).onChange)||void 0===t||t.call(n,e)},remove:V.length<=j?void 0:d,append:O};if("FilterInput"===r.props.__TYPE){var v=p.value.isMatched,h=void 0!==v?b()(p.value,"isMatched"):p.value;f=(0,a.Z)((0,o.Z)((0,a.Z)({},f),{isMatched:v}),function(e,n){var t;if("[object Object]"!==Object.prototype.toString.call(n))return{};"key"in n||(n=(0,T.T)([n])[0]);var r,i=(0,A.f)(null===(t=Object.values(e.filters))||void 0===t?void 0:t.reduce((function(e,n){return e.concat(n.items)}),[]),[n])[0];return(0,o.Z)((0,a.Z)({},i),{condition:null!==(r=i.condition)&&void 0!==r?r:"eq"})}(r.props,h))}var y=(0,m.dG)(p,f,{key:["FilterInput","FilterWithAndInput","TimeRangeInput"].includes(r.props.__TYPE)?e.id:s,defaultValue:"FilterInput"===r.props.__TYPE?void 0:null!==(i=p.value)&&void 0!==i?i:["FilterWithAndInput","TimeRangeInput"].includes(r.props.__TYPE)?void 0:"",id:["FilterWithAndInput","TimeRangeInput"].includes(r.props.__TYPE)?"".concat(E,"-").concat(n):"".concat(E,"-").concat(n,"-").concat(u),itemIndex:n});return Z.cloneElement(r,y)}})},i)})),(0,c.jsx)("div",{className:"absolute right-2",style:{top:"calc(50% - 16px)"},children:N||I?(0,c.jsx)(Z.Fragment,{}):(0,c.jsx)(S.z,{buttonType:"tertiary",size:"small",onClick:function(){q(n)},id:"".concat(E,"-").concat(n,"-remove"),className:(0,h.Z)(V.length<=j&&"!invisible"),children:(0,c.jsx)(S.z.IconOnly,{icon:v.T})})})]},e.id)})),"end"===x&&K]}),"bottom"===x&&K]})}J.displayName="SubmitButton",J.defaultProps={__TYPE:"SubmitButton"},J.whyDidYouRender=!0,$.displayName="FieldArray",$.defaultProps={__TYPE:"FieldArray"},$.whyDidYouRender=!0;var X=function(e){var n=e.forwardedRef,t=e.children,i=e.autosave,d=void 0!==i&&i,u=e.className,f=e.onSubmit,v=e.submitText,y=void 0===v?"Submit":v,g=e.showSubmitButton,b=void 0===g||g,j=e.allowMultipleSubmits,T=void 0!==j&&j,C=e.postSubmit,A=e.onChange,F=e.onError,M=e.id,Y=e._skipValidation,E=void 0!==Y&&Y,D=(0,R.J)(M),O=(0,Z.useMemo)((function(){return Z.Children.toArray(t).reduce((function(e,n){var t=K(n);return x()(e,t)}),{})}),[t]),W=(0,Z.useMemo)((function(){return Object.keys(O.itemSchema).reduce((function(e,n){var t=O.itemSchema[n];return void 0===t||(e[n]="required"===t.spec.presence),e}),{})}),[O.itemSchema]),J=(0,L.a)(),$=J.formErrors,X=J.schemaResolver,Q=(0,Z.useMemo)((function(){return N.Ry().shape(O.itemSchema)}),[O.itemSchema]),H=(0,_.cI)((0,a.Z)({mode:"onChange",defaultValues:Object.assign({},O.defaultValues,O.fieldArrayDefaultValues)},E?{}:{resolver:X((0,p.X)(Q))})),U=H.handleSubmit,ee=H.setError,ne=H.formState,te=H.control,re=H.watch,ie=(0,Z.useMemo)((function(){return{fieldArrayAppendValues:O.fieldArrayAppendValues}}),[O.fieldArrayAppendValues]),ae=(0,Z.useCallback)((function(e,n){var t=function(n){if(void 0===n)return{};var t=ne.errors[e.props.name];return void 0!==t&&Array.isArray(t)?{errors:t}:void 0!==t?{error:"string"===typeof t.message&&t.message.startsWith(n)?t.message.replace(n,w()(n)):t.message}:{}};if(null===e||void 0===e.props||"FormRenderScope"===e.props.__TYPE)return e;if(void 0===e.props.children||0===e.props.children.length)return G(e)?(0,c.jsx)(_.Qr,{name:e.props.name,defaultValue:e.props.defaultValue,control:te,render:function(r){var i=r.field,a=i.value,o=i.ref,d=(0,l.Z)(r.field,["value","ref"]),u=(0,m.dG)(d,e.props,n,t(e.props.name),q(e)||"TextInput"===e.props.__TYPE?{}:{value:a},{ref:function(n){(0,I.p)(n,[o,e.ref])}});return(0,c.jsx)(c.Fragment,{children:(0,z.wI)(e,u)})}}):e;if("FieldArray"===e.props.__TYPE)return(0,c.jsx)(B.Provider,{value:ie,children:(0,z.wI)(e,(0,m.dG)(e.props,n,t(e.props.name)))});var r=(0,m.dG)((0,o.Z)((0,a.Z)({},e.props),{children:Z.Children.map(e.props.children,(function(e){return ae(e,n)}))}),"SubmitButton"===e.props.__TYPE?{id:"".concat(D,"-submit")}:{});return(0,o.Z)((0,a.Z)({},e),{props:r})}),[te,ie,D,ne.errors]),oe=(0,Z.useCallback)(function(){var e=(0,r.Z)((function(e){var n;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return void 0===f?[3,2]:[4,f(e)];case 1:void 0!==(n=t.sent())&&n.status>=200&&n.status<299?null===C||void 0===C||C(n):void 0!==n&&n.status>=400&&void 0!==F&&(F(n),ee("server",n.data)),t.label=2;case 2:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[F,f,C,ee]);(0,k.Z)((function(){var e=re(function(){var e=(0,r.Z)((function(e){return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return null===A||void 0===A||A(e),d&&void 0!==f?Object.keys(Q.fields).every((function(n){return Q.fields[n].isValidSync(e[n])}))?[4,f(e)]:[3,2]:[2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}));return function(n){return e.apply(this,arguments)}}());return function(){e.unsubscribe()}}));var le=T?ne.isSubmitting:ne.isSubmitting||ne.isSubmitSuccessful,de=(0,Z.useCallback)(function(){var e=(0,r.Z)((function(e){return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return e.stopPropagation(),e.nativeEvent.stopPropagation(),[4,U(oe)(e)];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[U,oe]),ue=(0,Z.useMemo)((function(){return{isLoading:le,extractionResult:O,formId:D}}),[D,le,O]);return(0,c.jsx)(V,{value:ue,children:(0,c.jsx)(_.RV,(0,o.Z)((0,a.Z)({},H),{children:(0,c.jsx)("form",{id:D,"data-testid":D,ref:n,onSubmit:de,className:(0,h.Z)("flex w-full flex-col",u),children:(0,c.jsxs)(P.F,{value:$,children:[Z.Children.toArray(t).filter(Boolean).map((function(e,n){var t=e.props,r={key:n,required:W[t.name]};return ae(e,r)})),b&&(0,c.jsx)("div",{className:"mt-8! sm:grid sm:grid-flow-row-dense sm:gap-3",children:b&&(0,c.jsx)(S.z,{block:!0,isLoading:le,type:"submit",buttonType:"primary",size:"large",disabled:le||!ne.isValid,id:"".concat(D,"-submit"),children:(0,c.jsx)(S.z.Text,{children:y})})})]})})}))})},Q=(0,Z.forwardRef)((function(e,n){return(0,c.jsx)(X,(0,o.Z)((0,a.Z)({},e),{forwardedRef:n}))})),H=Object.assign(Q,{When:Y.n,RenderScope:M.W,displayName:"Form",whyDidYouRender:!0})},83815:function(e,n,t){t.d(n,{X:function(){return p}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349),l=t(78749),d=t(34885),u={deprecatedSmall:"text-deprecated-small-heading",deprecatedMedium:"text-deprecated-medium-heading",deprecatedLarge:"text-deprecated-large-heading",deprecatedSubheading:"text-deprecated-sub-heading"},s={display:"text-heading-display",large:"text-heading-large",regular:"text-heading-regular",medium:"text-heading-medium",small:"text-heading-small","extra-small":"text-heading-extra-small uppercase text-labels leading tracking-wider"},c={neutral:"text-heading",primary:"text-primary",blue:"text-blue",teal:"text-teal",purple:"text-purple",green:"text-green",red:"text-red",yellow:"text-yellow",orange:"text-orange",pink:"text-pink",cyan:"text-cyan",lime:"text-lime"},p=d.memo((function(e){var n=e.as,t=void 0===n?"h3":n,d=e.children,p=e.className,m=e.id,f=e.size,v=void 0===f?"deprecatedSubheading":f,h=e.color,y=void 0===h?"neutral":h,x=e.truncate,g=void 0!==x&&x,b=e.type,j=(0,a.Z)(e,["as","children","className","id","size","color","truncate","type"]);return(0,o.jsx)(t,(0,i.Z)((0,r.Z)({},j),{className:(0,l.Z)("font-ibm",void 0===b?u[v]:s[b],g&&"truncate","font-semibold","h6"===t&&"tracking-[1px]",c[y],p),"data-testid":m,id:m,children:d}))}));p.displayName="Heading",p.whyDidYouRender=!0},35526:function(e,n,t){t.d(n,{F:function(){return x},r:function(){return y}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349),l=t(18985),d=t(78749),u=t(33872),s=t(77005),c=t.n(s),p=t(34885),m=t(58782),f=t(97090),v={deprecatedSmall:"text-deprecated",deprecatedMedium:"text-deprecated-medium-text",deprecatedLarge:"text-deprecated-large-text"},h={primary:"text-primary hover:text-primary-dark",secondary:"text-alternative hover:text-labels",white:"text-white"},y=p.memo((function(e){var n,t=e.bold,l=void 0!==t&&t,u=e.type,s=void 0===u?"primary":u,m=e.to,f=void 0===m?"#":m,y=e.id,x=e.onClick,g=e.underline,b=void 0===g||g,j=e.className,w=e.children,Z=e.size,_=void 0===Z?"deprecatedMedium":Z,k=e.disabled,N=void 0!==k&&k,T=(0,a.Z)(e,["bold","type","to","id","onClick","underline","className","children","size","disabled"]),C=f.includes("//"),A=C?p.Fragment:c(),S=C?{}:{href:f,passHref:!0},R=Object.assign({},T,C?{href:f}:{});return(0,o.jsx)(A,(0,i.Z)((0,r.Z)({},S),{children:(0,o.jsx)("a",(0,i.Z)((0,r.Z)({},R),{target:null!==(n=T.target)&&void 0!==n?n:C?"_blank":void 0,className:(0,d.Z)("focus:outline-none flex select-none items-center text-sm",v[_],h[s],b?"hover:underline":"hover:no-underline",l&&"font-semibold",N&&"pointer-events-none cursor-default",j),"data-testid":y,id:y,onClick:x,role:"link","aria-disabled":N,children:w}))}))}));y.displayName="Link",y.whyDidYouRender=!0;var x=(0,p.memo)((function(e){var n=e.to,t=e.className,r=e.size,i=void 0===r?"deprecatedMedium":r,a=e.type,s=void 0===a?"small":a,c=(0,u.Z)("common").t;return(0,o.jsxs)("a",{href:n,target:"_blank",rel:"noreferrer",className:(0,d.Z)("inline-block max-w-max items-center border-b border-dashed border-transparent hover:border-primary",t),children:[(0,o.jsx)(m.x,{color:"primary",size:i,type:s,className:"font-normal",as:"span",children:c("learnMore")}),(0,o.jsx)(f.J,{color:"primary",icon:l.f,size:{small:"xs",medium:"small",large:"small"}[i],className:"inline"})]})}));x.displayName="LearnMore",x.whyDidYouRender=!0},30423:function(e,n,t){t.d(n,{AZ:function(){return j},TD:function(){return x},ht:function(){return b},hu:function(){return g},oi:function(){return w}});var r=t(2464),i=t(26542),a=t(88349),o=t(4876),l=t(11880),d=t(53951),u=t(78749),s=t(34885),c=t(91140),p=t(45902),m=t(25192),f=t(97090),v=t(68436),h=t(58782),y=t(86205),x={loading:o.$,invalid:l.i,valid:d.g},g={loading:"labels",invalid:"red",valid:"green"},b=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{small:"".concat(e?"pl-8":"pl-2"," ").concat(n?"pr-8":"pr-2"," py-1.5 my-px"),medium:" ".concat(e?"pl-8":"pl-2.5"," ").concat(n?"pr-8":"pr-2.5"," py-2.5 my-px"),large:"".concat(e?"pl-8":"pl-3"," ").concat(n?"pr-8":"pr-3"," py-3.5 my-px")}},j=function(e){var n=e.id,t=e.label,r=e.labelSize,i=void 0===r?"small":r,o=e.helperText,l=e.tooltip,d=e.required,s=void 0!==d&&d,c=e.length,p=e.dir,m=void 0===p?"vertical":p;return(0,a.jsxs)(a.Fragment,{children:[void 0!==t&&(0,a.jsxs)("label",{htmlFor:n,className:(0,u.Z)("input-label flex w-full select-none items-center gap-1","vertical"===m?"small"===i?"mb-1":"mb-2":""),children:["string"===typeof t?(0,a.jsxs)(v._,{bold:!0,type:i,color:"small"===i?"neutral":"neutral-dark",id:"label",className:"input-label__text","data-input-label-size":i,children:[t,s&&" *"]}):t,void 0!==l&&(0,a.jsx)(y.u.InfoIcon,{arrowColor:"white",className:"input-label__tooltip ml-2.5 !p-2",children:(0,a.jsx)(h.x,{color:"labels",id:"info-icon",children:l})}),void 0!==c&&(0,a.jsx)(h.x,{as:"span",type:"small",className:"input-label__length-text ml-auto",color:"labels",id:"length","data-testvalue":c,children:c})]}),void 0!==o&&(0,a.jsx)(h.x,{type:"small",className:"input-label__helper-text mb-1",color:"labels",id:"helper-text",children:o})]})};j.whyDidYouRender=!0,j.displayName="InputLabel";var w=(0,m.T9)((function(e){var n,t=e.autoFocus,o=void 0!==t&&t,l=e.className,d=e.disabled,m=void 0!==d&&d,y=e.readonly,w=void 0!==y&&y,Z=e.error,_=e.icon,k=e.id,N=e.label,T=e.labelSize,C=e.helperText,A=e.maxLength,S=e.name,R=e.onBlur,z=e.onChange,F=e.onKeyDown,I=e.onPaste,M=e.placeholder,Y=e.required,E=void 0!==Y&&Y,L=e.tooltip,P=e.size,D=void 0===P?"medium":P,V=e.type,O=void 0===V?"text":V,B=e.asyncState,q=e.prefix,W=e.value,G=e.autoComplete,K=e.forwardedRef,J=e.onFocus,$=e.min,X=e.max,Q=(0,c.J)(k,!0),H=(0,s.useMemo)((function(){return null!==(n=null===W||void 0===W?void 0:W.length)&&void 0!==n?n:0}),[W]),U=(0,s.useMemo)((function(){return null!==Z&&void 0!==Z&&Z.length>0?{"aria-invalid":!0,"aria-describedby":"error-".concat(Q)}:{}}),[Z,Q]),ee=(0,s.useCallback)((function(e){null===e.currentTarget&&Object.assign(e,{currentTarget:e.target}),null===z||void 0===z||z(e)}),[z]),ne=(0,s.useRef)(null),te=null!==q&&void 0!==q;return(0,a.jsxs)("div",{className:(0,u.Z)("w-full",l),"data-testid":"input-parent",children:[(0,a.jsx)(j,{id:Q,label:N,labelSize:T,helperText:C,tooltip:L,required:E}),(0,a.jsxs)("div",{className:(0,u.Z)("rh-text-input__outer flex rounded-md border bg-white transition-colors duration-150 ease-in-out focus-within:z-10 focus-within:ring-4",void 0!==Z?"border-red focus-within:ring-red":"border-default focus-within:border-primary focus-within:ring-primary",m&&"cursor-not-allowed bg-neutral-darker",w&&"cursor-text bg-neutral-dark"),children:[te&&(0,a.jsx)("div",{className:"relative flex flex-shrink-0 items-center rounded-l-md border-r border-default bg-neutral-darker py-1 pl-2 pr-2",children:(0,a.jsx)(v._,{id:"prefix",children:q})}),(0,a.jsxs)("div",{className:(0,u.Z)("relative flex w-full items-center gap-2"),onClick:function(){var e;return null===(e=ne.current)||void 0===e?void 0:e.focus()},children:[void 0!==_&&(0,a.jsx)(f.J,{className:"absolute left-2",color:m?"alternative":"labels",icon:_,id:"input-icon"}),(0,a.jsx)("input",(0,i.Z)((0,r.Z)({},U),{value:null!==W&&void 0!==W?W:"",autoComplete:G,maxLength:A,ref:function(e){(0,p.p)(e,[K,ne])},name:S,id:Q,"data-testid":Q,type:O,autoFocus:o,className:(0,u.Z)(["rh-text-input__inner focus:outline-none block w-full rounded-md bg-transparent text-regular font-normal text-heading placeholder-default focus:ring-0",b(void 0!==_,void 0!==B)[D],m&&"cursor-not-allowed !text-alternative",w&&"cursor-not-allowed"]),placeholder:M,disabled:m||w,onChange:ee,onKeyDown:F,onBlur:R,onPaste:I,onFocus:J,min:$,max:X})),void 0!==A&&(0,a.jsx)(h.x,{as:"span",type:"small",className:"absolute right-2",id:"max-length","data-testvalue":A,children:"".concat(H.toString(),"/").concat(A)}),void 0!==B&&0!==H&&(0,a.jsx)(f.J,{icon:x[B],color:g[B],className:"absolute right-2",id:"async-state-icon","data-testvalue":B})]})]}),"loading"!==B&&void 0!==Z&&null!==Z&&(0,a.jsx)(v._,{className:"mt-1",color:"red",type:"small",id:"error-".concat(Q),children:Z})]})}),{name:"TextInput"})},88435:function(e,n,t){t.d(n,{C:function(){return r}});var r=function(e){return/^account_event.*/.test(e)?"account_event":/^user_event.*/.test(e)?"user_event":/^account\.(engagement_level|engagement_trend)$/.test(e)?"account_engagement":/^user\.(engagement_level|engagement_trend)$/.test(e)?"user_engagement":/^account\.(activation_step_count|activated)$/.test(e)?"account_activation":/^user\.(activation_step_count|activated)$/.test(e)?"user_activation":/^account./.test(e)?"account_trait":/^user./.test(e)?"user_trait":e.split(".")[0]}},90944:function(e,n,t){t.d(n,{Ac:function(){return f},Dk:function(){return c},IX:function(){return p},Qs:function(){return m},wI:function(){return s}});var r=t(85381),i=t(48721),a=t(21846),o=t.n(a),l=t(66151),d=t.n(l),u=t(34885);t(36241);function s(e,n){for(var t=arguments.length,i=new Array(t>2?t-2:0),a=2;a<t;a++)i[a-2]=arguments[a];var o;return u.isValidElement(e)?(o=u).cloneElement.apply(o,[e,n].concat((0,r.Z)(i))):e}var c=function(e){return(0,i.Z)(e,"hh:mm aaa")},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e.match(/(^\w)|([ ]\w)/g);return null===n?"":n.slice(0,2).join("").replace(" ","")};function m(e){return d()(o()(e))}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null===e||0===e.length?"#":/^https?:\/\//.test(e)?e:e.replace(/^(?=.)/,"https://")}},5582:function(e,n,t){t.d(n,{f:function(){return a}});var r=t(88779),i=t(88435),a=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.map((function(n){var t=(0,i.C)(n.key),a="account_event"===t||"user_event"===t?{key:n.key.includes("|")?n.key.split("|")[0].trim():n.key,dtype:"number",label:(n.key.includes("|")?n.key.split("|")[0].trim():n.key).replace(/(account_event|user_event)\./,""),values:[]}:e.find((function(e){return e.key===n.key})),o=Array.isArray(n.value)?"between"===n.operator?"between":"in"===n.operator?"eq":"neq":null===n.value?"eq"===n.operator?"empty":"not_empty":n.operator,l="datetime"===(null===a||void 0===a?void 0:a.dtype)&&null===n.value?"neq"===o?"not_empty":"empty":n.value;return{propertyType:t,property:a,condition:"eq"===o&&null===n.value?"empty":"neq"===o&&null===n.value?"not_empty":o,value:l,timeRange:r.G.parse({key:n.key,propertyType:t}),dataType:void 0===a?n.value_type:a.dtype}}))}},18985:function(e,n,t){t.d(n,{f:function(){return l}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349);t(34885);function l(e){var n=e.height,t=e.width,l=(0,a.Z)(e,["height","width"]);return(0,o.jsx)("svg",(0,i.Z)((0,r.Z)({},l),{width:t,height:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M16.95 7.05L7.05 16.95M10 7L16.95 7.049L17 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}))}l.displayName="ArrowUpRightIcon",l.whyDidYouRender=!0},53951:function(e,n,t){t.d(n,{g:function(){return l}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349);function l(e){var n,t=e.height,l=e.width,d=(0,a.Z)(e,["height","width"]);return(0,o.jsxs)("svg",(0,i.Z)((0,r.Z)({},d),{width:l,height:t,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{y:"0.5",width:"20",height:"20",rx:"10",fill:"currentColor"}),(0,o.jsx)("path",{d:"M14 7.75L8.5 13.25L6 10.75",stroke:null!==(n=d.stroke)&&void 0!==n?n:"white",strokeLinecap:"round",strokeLinejoin:"round"})]}))}l.displayName="CheckFilledIcon",l.whyDidYouRender=!0},11880:function(e,n,t){t.d(n,{i:function(){return l}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349);t(34885);function l(e){var n=e.height,t=e.width,l=(0,a.Z)(e,["height","width"]);return(0,o.jsxs)("svg",(0,i.Z)((0,r.Z)({},l),{width:t,height:n,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{y:"0.5",width:"20",height:"20",rx:"10",fill:"#DF5662"}),(0,o.jsx)("path",{d:"M10.0005 11L10.0005 8M10.0005 13C10 13.25 10 13.25 10 13.5",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"})]}))}l.displayName="NotMatchedIcon",l.whyDidYouRender=!0},26704:function(e,n,t){t.d(n,{p:function(){return l}});var r=t(2464),i=t(26542),a=t(50854),o=t(88349);t(34885);function l(e){var n=e.height,t=e.width,l=(0,a.Z)(e,["height","width"]);return(0,o.jsxs)("svg",(0,i.Z)((0,r.Z)({},l),{width:t,height:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",children:[(0,o.jsx)("path",{d:"M8.33333 4V12.6667",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M12.6667 8.33333H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}))}l.displayName="PlusIcon",l.whyDidYouRender=!0}}]);
//# sourceMappingURL=7046-58ebd93481dbf29b.js.map